I have an xhtml page with a simple form. This page is used for multiple data tables. To specify a data table (etc.), I use GET request parameters. xhtml page gets it through
<f:metadata> <f:viewParam id="page" name="page" value="#{itemsBean.page}"/> </f:metadata>
and again go to the navigation rules for example
<navigation-case> <description> Global rule for going to the items page from any page </description> <from-outcome>items</from-outcome> <to-view-id>/items.xhtml</to-view-id> <redirect> <view-param> <name>page</name> <value>#{itemsBean.page}</value> </view-param> </redirect> </navigation-case>
But if I use the inputs in the xhtml file, for example,
<h:inputText id="itemName" value="#{itemsBean.name}" required="true" requiredMessage="Value for this field required!"/>
I cannot restore the view parameter after trying to take the form without entering text. I tried using hidden input to pass parameters
<h:inputHidden id="page" value="#{itemsBean.page}" />
but it looks like the check is done before and itemsBean.page is still empty. itemsBean is requested. What am I doing wrong? How to pass a parameter?
Thanks for your time.
source share