-
1. Re: f:param in h:commandLink in h:column
vk101 Feb 9, 2007 11:19 AM (in response to vk101)Could somebody please describe whether the behavior I'm expecting is the behavior that should be happening (because maybe I'm totally wrong about this to begin with)?
Also, is there anything you can think of related to the use of Seam that might be causing this...or do you think it's totally a JSF issue?
Any direction would be highly appreciated. -
2. Re: f:param in h:commandLink in h:column
gavin.king Feb 9, 2007 11:22 AM (in response to vk101)Nothing to do with Seam.
-
3. Re: f:param in h:commandLink in h:column
vk101 Feb 12, 2007 5:37 PM (in response to vk101)Apparently I should be using outputLink instead of commandLink to get the parameters to show up...
So here's the issue I foresee now...each row in the dataTable has a link to a remove method which contains that row's entity id as a request parameter.
How would I use pages.xml to get the parameter to the method? If I put the pages.xml param element on the page that contains the dataTable, then many links on that page contain a "paramName=0" the first time the page is loaded
I could use @RequestParameter, but I'd like to use the pages.xml way of doing it -
4. Re: f:param in h:commandLink in h:column
dilator Feb 12, 2007 7:31 PM (in response to vk101)Why not use the Seam EL extensions, and a @DataModel. Then you can do:
<h:dataTable var="entity" values="#{myDataModel}"> .... <h:commandLink action="#{myComponent.delete(entity)}" value="..." /> .... </h:dataTable>
That should be easier! -
5. Re: f:param in h:commandLink in h:column
vk101 Feb 14, 2007 1:30 PM (in response to vk101)I can't get the request parameter to work from pages.xml. My dataTable is as follows. What should be in my myBean.myAction method - anything? Right now it's empty, like it was when I was using DataModel/DataModelSelection...
<h:dataTable id="table" value="#{myList}" var="a"> <h:column> <s:link value="#{a.text}" action="#{myBean.myAction}" > <f:param name="theId" value="#{a.id}" /> </s:link> </h:column> </h:dataTable>
My pages.xml looks like the following. Should the param element be in the navigation element of the initiating page, the page element of the resulting page, or either? What's the difference? (Right now I've got it commented out in the latter.) The resultPage.xhtml displays information relating to contextualBean...<page view-id="/listpage.xhtml"> <navigation from-action="#{myBean.myAction}"> <begin-conversation /> <redirect view-id="/resultPage.xhtml"> <param name="theId" value="#{contextualBean.id}" /> </redirect> </navigation> </page> <page view-id="/resultPage.xhtml"> <!-- <param name="theId" value="#{contextualBean.id}" /> --> </page>
-
6. Re: f:param in h:commandLink in h:column
gavin.king Feb 14, 2007 2:49 PM (in response to vk101)The page parameter goes *directly* beneath the element for the view id you want to link or redirect to (ie. the page that needs the parameter as an input).
-
7. Re: f:param in h:commandLink in h:column
vk101 Feb 14, 2007 3:21 PM (in response to vk101)In that case the parameter doesn't show up in the address bar at all. To test whether it's working, I entered a parameter with a value of an entity id that I know exists, but still the appropriate data doesn't show up.
When I set "contextualBean.id" from the param element, does the entire contextualBean get refreshed from the database? Or does it just create an empty component and insert the id value?
I feel like I am missing some code (either in my "myBean.myAction" method or elsewhere to get that data). Is that the case? -
8. Re: f:param in h:commandLink in h:column
gavin.king Feb 14, 2007 4:35 PM (in response to vk101)Look at the examples. contactlist is a good one to start with. Also seam-gen uses this stuff.