I'm using JSF and Primefaces and my question is:
I have a page (page1.jsf) that recive a view param with a list of strings (space delimited):
<f:metadata>
<f:viewParam name="list" value="#{bean1.list}" converter="listConverter"/>
</f:metadata>
The listConverter convert the string into a list of individual words. If I access the page through url (eg: page1.jsf?list=word1 word2 word3") everything works just fine!
But now I'm trying to use another page (page2.jsf) to create that list of terms. I'm using a Primeface DataTable, following this example: http://www.primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf
I want tomake possible to the user to select multiple rows (checkbox Primeface example) and then press a button that will redirect to page1.jsf and also passes the list of selected items as parameter (eg. using the Primeface showcase example, pass a list of the selected car models).
I'm trying to do this:
<p:commandButton action="page1?faces-redirect=true&includeViewParams=true" >
<f:attribute name="list" value="#{bean2.convertSelectedItemsToString()}" />
</p:commandButton>
or this:
<p:commandButton action="page1?faces-redirect=true&includeViewParams=true" >
<f:param name="list" value="#{bean2.convertSelectedItemsToString()}" />
</p:commandButton>
where bean2 has a selectedItems[] with the objects selected.
Needless to say... It's not working.
Any help? Thanks in advance.