0 Replies Latest reply on Nov 20, 2008 12:24 AM by Neil C

    Choosing Button Action Based On Whether Pageflow Running

    Neil C Novice

      I have a Quick Search button that appears on every page in my application, and some of these pages are part of a pageflow definition. 

      For pages within a pageflow, the button looks like this:

      <h:commandButton id="quickSearchButton" value="Go" action="quickSearch"/>

      And I have this in the pageflow:

      <transition name="quickSearch" to="quickSearchResults">
                  <action ref-name="doQuickSearch"/>

      For those pages that are not within the pageflow, I want the button to look like this:

      <h:commandButton id="quickSearchButton" value="Go" action="#{quickSearchAction.doQuickSearch}"/>

      So here's the problem: This button is located on a Facelets template inherited by all the pages, some of which are in a pageflow and some of which are not.  Therefore, the action for the button depends on which kind of page it is.

      Could you provide insight into how I can have the button do the right thing regardless of which kind of page it's on?