1 Reply Latest reply on Apr 27, 2007 8:34 AM by Dennis

    AJAX Navigation

    Dennis Newbie

      Hello!

      My problem is:

      A ajax based menu with navigation rules out of the pages.xml...
      I tried to adapt a a4j include example (the faces-config.xml) to use with seam, but the application does not show the behavior.

      Has anybody a set of more than one navigation rule to build a full ajax application?

      In the documentation I have not seen something like navigation via ajax in the pages.xml

        • 1. Re: AJAX Navigation
          Dennis Newbie

          pages.xml

           <page view-id="/login.xhtml">
           <navigation from-action="#{identity.login}">
           <rule if="#{identity.loggedIn}">
           <redirect view-id="/start.xhtml"/>
           </rule>
           </navigation>
           </page>
          
           <page view-id="/empty.xhtml">
           <navigation from-action="next">
           <render view-id="/start/home.xhtml"/>
           </navigation>
           </page>
          
           <page view-id="/start/1.xhtml">
           <navigation from-action="next">
           <render view-id="/start/2.xhtml"/>
           </navigation>
           </page>
          


          start.xhtml
          <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
           template="/layout/template.xhtml">
          
          <ui:define name="body">
          <f:view>
           <h:outputText value="Welcome, #{identity.username}" rendered="#{identity.loggedIn}"/>
           <h:form>
           <h:panelGrid columns="2">
           <h:outputText value="Type the Text:" />
           <h:inputText value="#{bean.text}">
           <a4j:support event="onkeyup" reRender="repeater" />
           </h:inputText>
           <h:outputText value="Text in the AJAX Response:" />
           <h:outputText id="repeater" value="#{bean.text}" />
          
           </h:panelGrid>
           <hr />
           <a4j:log />
           <a4j:commandButton value="Next" action="next" reRender="content" />
           <h:panelGroup id="content">
           <a4j:include viewId="/start/empty.xhtml" />
           </h:panelGroup>
           </h:form>
          </f:view>
          </ui:define>
          </ui:composition>
          


          The other referenced xhtml files does not contain anyathingn useful except static text.

          My firefox reload the empty.xhtml (he shows the page a little bit moved to the left site)...