I have xhtml page with simple form. This page is using for several data tables. To specify data table (and so on), I use GET request parameters. xhtml page receive it through
<f:metadata>
<f:viewParam id="page" name="page" value="#{itemsBean.page}"/>
</f:metadata>
and pass again by the navigation rules like
<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 inputs in the xhtml file like this
<h:inputText id="itemName" value="#{itemsBean.name}"
required="true" requiredMessage="Value for this field required!"/>
I cannot restore view param after trying to accepting form with no text in input. I tried to use hidden input for passing parameters
<h:inputHidden id="page" value="#{itemsBean.page}" />
, but seems like validation runs before and itemsBean.page is still empty. itemsBean is RequestScoped. What things I do wrong? How can I pass the param?
Thank you for wasting your time.