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

  • SEARCH
  • Home
  • 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 7083697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:12:36+00:00 2026-05-28T07:12:36+00:00

I have a strange problem which I have been trying to fix for some

  • 0

I have a strange problem which I have been trying to fix for some time but am stuck in one place and don’t quite understand what’s going on here.

My index page looks like this:

<h:selectOneMenu id="selectMenu" value="#{indexBean.model.selected_id}" styleClass="indexItems">
    <f:selectItems value="#{indexBean.myModelValues}" />    
    <a4j:support event="onchange" reRender="peek" />        
</h:selectOneMenu> 
<br>
<h:outputText id="peek" value ="#{indexBean.model.selected_id}"/>
<br>
<a4j:commandButton value="Go to Form" action="form" styleClass="indexItems">
    <f:param name="selected" value="#{indexBean.model.selected_id}" />                                       
</a4j:commandButton>

The commandButton sends the user to a next page when I want to get the selected position from the selectOneMenu. The problem is that nothing is sent. When I select some value from the Menu the ‘peek’ outputText is rerendered properly and I can see the correct selection. However it is not sent to the next page and Bean. Surprisingly when I change the value of the parameter to a fixed String it works!!! So i.e. this:

<f:param name="selected" value="someValue1" />

Is read correctly in the next Bean!!! All of the beans are requested scoped with RichFaces @KeepAlive annotation (I tried without the annotation and it’s the same). Ihave treied:
-changing a4j:commandButton to h:commandLink or h:outputLink
-changing indexBean.model.selected_id to indexBean.selected_id
-finally changing the input source from h:selectOneMenu to h:inputText

Nothing helps – it is still the same – a hardcoded String is passed correctly to the next page, but when I try to use the expresion the parameter is always empty.

Here I post a snippet of the faces-config.xml:

<managed-bean>
    <managed-bean-name>indexBean</managed-bean-name>
    <managed-bean-class>id.webapp.beans.IndexBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
    <managed-bean-name>model</managed-bean-name>
    <managed-bean-class>id.webapp.beans.Model</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
    <managed-bean-name>formBean</managed-bean-name>
    <managed-bean-class>id.webapp.beans.FormBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
        <property-name>selectedValue</property-name>
        <value>#{param.selected}</value>
    </managed-property>
</managed-bean> 

Does any one have an idea why this doesn’t work? I have used the managed-properties parameters like that in the past and it worked (meaning using some dynamically changed values not a static String).

  • 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-05-28T07:12:37+00:00Added an answer on May 28, 2026 at 7:12 am

    The <f:param> is evaluated during the initial request (when the form is to be displayed), not during the form submit request. So it still remains the initial value, not the changed value.

    Give the <a4j:commandButton> an id and refer it in the reRender as well so that its <f:param> get re-evaluated before you press the button.

    <h:selectOneMenu id="selectMenu" value="#{indexBean.model.selected_id}" styleClass="indexItems">
        <f:selectItems value="#{indexBean.myModelValues}" />    
        <a4j:support event="onchange" reRender="peek,button" />        
    </h:selectOneMenu> 
    <br>
    <h:outputText id="peek" value ="#{indexBean.model.selected_id}"/>
    <br>
    <a4j:commandButton id="button" value="Go to Form" action="form" styleClass="indexItems">
        <f:param name="selected" value="#{indexBean.model.selected_id}" />                                       
    </a4j:commandButton>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem which I can't fix: A field: private boolean[][][] gaps;
I have got a strange problem about in_array recently which I cannot understand. e.g.
We have very strange problem, one of our applications is continually querying server by
I have a strange problem with some documents on my webpage. My data is
I have a strange problem in my rich client application. Here is some background:
I have a strange problem with sqlite which is driving me crazy. I have
We have a very strange problem which we have yet to be able to
This is a bit of a strange one, but I've been struggling for a
I have been experiencing strange behavior with the header drawing the first time. Here
I have been trying to track down a problem with a query I have.

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.