As I debug my seam application, it dawns on me that I don't really understand how parameter passing works. The following terminology really has me confused. So I am asking this very general question in the hopes of getting a good explanation of what works with what and what certain things are for.
First of all, to get from one page to the next you can use h:commandButton or s:button. I understand that s:button does not submit a form, but that doesn't help me understand the difference. If you are not submitting a form by going from one page to the next, then what are you doing?
My app involves entering information in a form, hitting a button and then going to a new page that displays results after running a query. It seems I have seen this activity take place with s:button, so how is that if it's not "submitting a form"? I feel I'm missing something fundamental here.
As for the parameters themselves...from what I have seen you can pass parameters using one of 3 methods:
- f:param. This seems to occur more often in combo with s:button than h:commandbutton. Why is that?
- Also, you can "pass" (or something) parameters using your page.xml file. The parameter seems to have to appear in both the source page.xml and the target page.xml to make it show up in the URL.
- Last of all, there is the option of adding @RequestParameter annotation to your backing bean. I gather that is also used when you set f:param in your view. Does that mean the one in page.xml gets overlooked? I notice in the registration example of the seam distribution, the user bean gets populated without any parameters being passed via page.xml for f:param. How is that possible?
I'm sure this question reveals a great deal of ignorance.
Hopefully one of you eloquent people will "get" what I'm asking and give me an explanation of this process.
Thanks in advance.
TDR