Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:37:27+00:00 2026-06-11T15:37:27+00:00

I have xhtml page with simple form. This page is using for several data

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:37:28+00:00Added an answer on June 11, 2026 at 3:37 pm

    You need to keep passing request parameters to the subsequent request. In “plain vanilla” HTML you’d indeed have used <input type="hidden"> for this, but the JSF <h:inputHidden> unfortunately doesn’t work that way. In case of a general validation failure, caused by another input field, the model value associated with <h:inputHidden> won’t be updated at all.

    You should be using a <f:param> in the UICommand component instead to retain request parameters for the subsequent request. E.g.

    <h:commandButton ...>
        <f:param name="page" value="#{param.page}" />
    </h:commandButton>
    

    Alternatively, you can use the <o:form> of the OmniFaces JSF utility library, it basically extends the <h:form> with an additional attribute includeViewParams which enables you to retain the view parameters for the subsequent request in the form action URL.

    <o:form includeViewParams="true">
        ...
    </o:form>
    

    This may end up to be easier if you have multiple command buttons/links and ajax actions, and this would be the only way in case you’d like to retain the same URL during non-ajax postbacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use JSTL but have the following problem: Index.xhtml page: <?xml version=1.0 encoding=UTF-8?>
I have calender datetimepicker jquery. when I am calling this in simple aspx page
I have a simple page (below) with a form. The form will submit if
I'm forced to work with IE8 (8.0.7601.17514) and I have this simple page: <!DOCTYPE
please consider this scenario: we have two web page. a simple page that contains
OK, Im really stumped and hoping this is something simple. I have a form
I have this simple code in facelets numbers.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have a simple form method... <form method=POST action=j_security_check> <table> <tr> <td>Name:</td> <td><input type=text
I have a well formed XHTML page. I want to find the destination URL
In my xhtml page I have the following tag included: <f:view locale=#{languageBean.locale}> ... </f:view>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.