-
1. Re: Understanding s:button h:commandButton and @RequestParameter
niox.nikospara.yahoo.com Oct 22, 2009 3:18 PM (in response to daxxy)Hi,
This code:
<s:button view="/OfficeView.xhtml" value="Find Office" > <f:param name="officeViewOfficeId" value="#{officeViewHome.officeViewOfficeId}"/> </s:button>
Will issue a request using a parameter named
officeViewOfficeId
, whose value is the value of #{officeViewHome.officeViewOfficeId} when the page was rendered! If this value was null, you simply get the null back.The <s:button> does not submit the form, so any changes made at the client are discarded! I believe <s:button> is useful exactly for that, calling a server side action, triggering JSF navigation and propagating the conversation without submitting the form.
-
2. Re: Understanding s:button h:commandButton and @RequestParameter
daxxy Oct 22, 2009 3:25 PM (in response to daxxy)I was just thinking about this some more and the light bulb was about to go off when I got your reply Nikos. And that cinched it!
I think I finally understand what it means that s:button does not submit the form.
You cannot use s:button to take information being entered into an input on that page and transfer it to another page. You can only use it to transfer to another page information that already exists on the page when it is rendered. As in the ubiquitous example of a datatable with an Action column populated with links to Edit or Delete.
Whether the information being transferred is newly entered on the page or exists already at page rendering is the difference between propagation and form submission.
Thanks and I hope this posting helps other newbies.
TDR
-
3. Re: Understanding s:button h:commandButton and @RequestParameter
niox.nikospara.yahoo.com Oct 22, 2009 5:29 PM (in response to daxxy)Yes!