6 Replies Latest reply on Apr 23, 2012 10:26 AM by hantsy bai

    How to load partial page content dynamically.

    hantsy bai Master

      I tried to user ui:included to load content in my new Seam3 application dynamically, but it did not work as my seam 2 application.


      The following steps were expected.



      1. click a link.


      <h:commandLink value="Company Search">
              <f:ajax render=":form:contentPane" execute="@this"  listener="{ set the content view }/>


      2.fire a navigation event and obseve the event.



      navEvent.fire(new NavigationEvent(



      public void onViewChanged(
                  @Observes(during = TransactionPhase.BEFORE_COMPLETION, notifyObserver = Reception.IF_EXISTS) NavigationEvent e) {
              if (log.isDebugEnabled()) {
                  log.debug(" view changed...@" + e);
              if (e.getMainView() != null) {
              if (e.getSidebarView() != null) {


      3. rerender the content



      <h:panelGroup id="contentPane" layout="block" styleClass="ch-box">
                              <ui:insert name="pageTitle" />
                          <ui:include src="#{nav.contentView}" />


      The third step is problematic here....the rendering is delayed, when the event had been fired, it still kept in the original page, when I refreshed the page manully, it will load the page correctly.


      Where is wrong in these steps?


      I have used this mode in my seam2 application, and I think every Seam 2 developer should remember the RichFaces Photoalbum application, it also used the Seam2 events.



      BTW: My development envoirment, JBoss 7.0.1(Majarro 2.0.2, Weld 1.1.5), JDK 7.


      Any suggestions here?