John I'm a little confused with step 2. > > 1) componentA - trigger event > onSuccessFromLogin() { > componentResources.triggerEvent("LoginComplete"... > > 2) container of both A and B components - handover event > onLoginComplete(Object[] ctxValues) { > componentB.onLoginComplete(ctxValues) I don't understand this method, where does it belong? I thought the idea was not to couple these so tightly together? > ... > } > > 3) componentB - handle event > onLoginComplete(Object[] ctxValues) { > ajaxResponseRenderer.addRender(zone); > }
Also, can componentResources.triggerEvent("LoginComplete", null, null) be called from any component and fire the event handler within the layout component? I have an example where I have layout, page, component and I'm trying to trigger logginComplete from the component to the layout and can't seem to get it to work. looks kinda like this @Events({Create.LOGINREGISTER}) public class Create { public static final String LOGINREGISTER = "showLoginRegister"; public void onValidateFromForm() { setVehicleData(); if (form.isValid() && userProfile == null) { System.out.println("onValidate"); componentResources.triggerEvent(LOGINREGISTER, null, null); } } } public class Layout { void onShowLoginRegister() { function = Function.LOGIN; if (request.isXHR()) { ajaxResponseRenderer.addRender(loginRegisterModalZone); } } } SellIndex calls Layout component and also calls Create component. The login exist in the layout and I'm trying to fire it from the Create component. <html t:type="layout"> <t:create/> </html> > > This is a little clumsy, looks boilerplate and should be done in the > background with a publisher-subscriber annotation provided by the framework > IMO. But it is completely decoupled with respect to the components. :) > > regards, > John --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org