2 Replies Latest reply on Oct 7, 2008 9:38 AM by kanwar sangha

    Redirecting to xxxxList.xhtml after persist action

    Val Sw Expert
      I have a page say reagent.xhtml with some form fields, on clicking "Save", it calls reagentHome.persist, values are persited to database but the page display remains the same i.e. reagent.xhtml, I need it should directly go to reagentList.xhtml

      When user clicks "Save" from reagent.xhtml, I need it should directly go to reagentList.xhtml as it happens when we click "Done", reagent.xhtml goes to reagentList.xhtml.

      Not sure what is the right way, should we add navigation in reagent.pages.xml or main pages.xml

      reagent.xhtml
      -------------
      <div class="actionButtons">
          <h:commandButton id="save"
                  value="Save"
                 action="#{reagentHome.persist}"
                  rendered="#{!reagentHome.managed}"/>
          <h:commandButton id="update"
                  value="Save"
                 action="#{reagentHome.update}"
                  rendered="#{reagentHome.managed}"/>                 
          <h:commandButton id="delete"
                  value="Delete"
                 action="#{reagentHome.remove}"
                 immediate="true"
                  rendered="#{reagentHome.managed}"/>
          <s:button propagation="end"
                       id="done"
                    value="Done"
                     view="/reagentList.xhtml"/>
      </div>