I am sending values to my view from my bean and from my view to my bean, everything is fine if I work with event such as “acitonListener” but now I want to send the user to other page (with a navigation rule, it works perfect) when I click on a button, but before of that I want to set in my bean one value, how can I do this?
I am doing something like this
<p:commandButton value="Send" id="sendButton" action="#{myBean.myMethod}"
update=":form:growTop" >
</p:commandButton>
Before of that there is only a table with <h:outputText/> with values from my bean, any way to do this?
Thanks
The above method expression will send
myParameterto themyMethodfunction in your backing bean:You can also send the user to the next page by returning a valid navigation outcome from your action method:
In your concrete case if there is a backing bean value which is printed out:
the following action
will pass
myParameterto your action method.In order to get the expected behavior with primefaces datatable use at least
@ViewScopedbacking bean behind your table values.