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 7024867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:53:55+00:00 2026-05-27T23:53:55+00:00

I am using the Primefaces wizard component. On one tab I am dynamically creating

  • 0

I am using the Primefaces wizard component. On one tab I am dynamically creating input boxes based on previous tabs input(user type). The inputbox text labels are derived from a list. In my backing bean, I have a map that contains input labels as keys and inputbox inputs as values.

Clicking on next, I would like the map(values) to be updated with the user input (corresponding to the key)

<c:forEach items="#{gdsiGeodataBean.actionCommand.fields}" var="reqs">
  <h:outputLabel for="#{reqs.name}" value="#{reqs.name}:* " />  
  <pou:inputText value="#{gdsiGeodataBean.actionCommand.values['reqs.name']}"  required="true" requiredMessage="Input is required."/> 
</c:forEach>

My backing bean :

private List<RequiredParam> fields; // +getter (no setter required)
private Map<String, String> values; // +getter (no setter required)

public CommandAction(String actionName, String actionParams, String context) {
    this.actionName = actionName;
    this.actionParams = actionParams;
    this.contextName = context;

    //Set up parameters
    getRequiredParams();
    getOptionalParams();
    fields = getFields();
    values = new HashMap<String, String>();
}

Essentially what I would like is for the map values to be updated with user inputs from the textinput boxes.

  • 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-27T23:53:56+00:00Added an answer on May 27, 2026 at 11:53 pm

    Your approach to bind the input value to a map is not entirely correct.

    <pou:inputText value="#{gdsiGeodataBean.actionCommand.values['reqs.name']}"  required="true" requiredMessage="Input is required."/> 
    

    You’re specifying a fixed map key instead of a dynamic map key based on the currently iterated #{reqs}. This way all submitted values will end up in one and same fixed map key "reqs.name", whereby each one overrides each other so that you only get the value of the last field in the map.

    You need to remove those singlequotes to make it a really dynamic key.

    <pou:inputText value="#{gdsiGeodataBean.actionCommand.values[reqs.name]}"  required="true" requiredMessage="Input is required."/> 
    

    Unrelated to the concrete question, even though this approach will work when used as-is in your question, the <c:forEach> will fail in certain circumstances. E.g. when used inside a composite component or an iterating JSF component. Rather use <ui:repeat> instead. See also JSTL in JSF2 Facelets… makes sense?

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

Sidebar

Related Questions

I have a p:wizard with some tabs. In the first tab, the user selects
I am using primefaces with JSF. I need a input component that allows users
Using PrimeFaces, I want to update/refresh a pages central layout unit based on user
I'm using primefaces' accordion panel. Inside the tabs i have forms which are created
I am trying to implement a Select All checkbox using primefaces component p:selectBooleanCheckbox and
I am using Primefaces google map component. I have some markers and info windows
We are using Primefaces 3M4 and one of our pages has a p:dataTable which
I am using primefaces wizard. During wizard flow all parameters saved correctly . However
I'm using primefaces tabview . <p:tabView> <p:tab id=basic title=Login> </p:tab> <p:tab id=personal title=Personal> </p:tab>
I have a problem with using primeface's wizard component and the core selectOneRadio. My

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.