[jboss-user] [JBoss Seam] - Override page action with commandButton action?

jmarston do-not-reply at jboss.com
Wed Jan 16 16:08:37 EST 2008


I want an action method to be run when my page is accessed by a redirect or GET, but if an action is performed by the user on the page through a commandLink or commandButton, I want that action method to run. I thought I could do that by creating a page action like this:
<page view-id="/peopleSearch.xhtml" action="#{peopleSearch.findAllPeople}">
  |     	<navigation>
  |     		<rule if-outcome="viewPerson">
  |     			<redirect view-id="/person.faces"/>
  |     		</rule>
  |     	</navigation>
  |     </page>

And a command link on the page like this:
...
  | <a4j:commandButton value="Search" action="#{peopleSearch.findPeople}" reRender="results"/>
  | ...

But instead of getting the expected result - peopleSearch.findAllPeople being run on initial load, and peopleSearch.findPeople being run when the button is clicked - the method defined in the page action is run every time the page is accessed along with the action from the command button.

Is there something wrong here, or is this how it is supposed to work? If this is working as designed, how do I achieve my desired functionality?

Thanks,
Jonathan

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120642#4120642

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120642



More information about the jboss-user mailing list