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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:10:28+00:00 2026-06-04T20:10:28+00:00

Here is the scenario (simplified): There is a bean (call it mrBean ) with

  • 0

Here is the scenario (simplified):

There is a bean (call it mrBean) with a member and the appropriate getters/setters:

private List<String> rootContext;

public void addContextItem() {
    rootContext.add("");
}

The JSF code:

<h:form id="a_form">
            <ui:repeat value="#{mrBean.stringList}" var="stringItem">
                    <h:inputText value="#{stringItem}" />
            </ui:repeat>
            <h:commandButton value="Add" action="#{mrBean.addContextItem}">
                <f:ajax render="@form" execute="@form"></f:ajax>
            </h:commandButton>
</h:form>

The problem is, when clicking the “Add” button, the values that were entered in the <h:inputText/> that represent the Strings in the stringList aren’t executed.

Actually, the mrBean.stringList setter (setStringList(List<String> stringList)) is never called.

Any idea why?

Some info –
I’m using MyFaces JSF 2.0 on Tomcat 6.

  • 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-04T20:10:30+00:00Added an answer on June 4, 2026 at 8:10 pm

    The String class is immutable and doesn’t have a setter for the value. The getter is basically the Object#toString() method.

    You need to get/set the value directly on the List instead. You can do that by the list index which is available by <ui:repeat varStatus>.

    <ui:repeat value="#{mrBean.stringList}" varStatus="loop">
        <h:inputText value="#{mrBean.stringList[loop.index]}" />
    </ui:repeat>
    

    You don’t need a setter for the stringList either. EL will get the item by List#get(index) and set the item by List#add(index,item).

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

Sidebar

Related Questions

Here's the simplified scenario: I have a page with two sections: a search section,
Here's my simplified scenario. I can adjust my inner rectangle width using the mouse.
Here is my (simplified for this case scenario) XML: <?xml version=1.0 encoding=UTF-8?> <?xml-stylesheet href=test_1.xsl
I'm running rails 3.0, rspec 2.0 and factory_girl. Here is the simplified scenario I'm
I have the following (simplified) scenario. There is a WCF service (MyService), which exposes
I know how to write tab host,but here the scenario is little bit different
Here's my scenario. As part of my app when someone is sent a message
Here is the scenario: I clone the staging branch of my codebase: git clone
Here's the scenario: small closed-source project that needs to share a certain model across
Here is the scenario. When the screen goes blank or if returning to an

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.