tags:

views:

503

answers:

3

I have a List of strings in my object, and I was hoping to be able to edit them with an a4j:repeat.

Below is my code:

<a4j:repeat value="#{Controller.object.stringList}"  var="item" >
<h:panelGrid columns="2">
<h:outputLabel value="ID:" />
<h:inputText  value="#{item}" />
</h:panelGrid>
</a4j:repeat>

My problem is that the values of the items never get changed when I submit my form. I've had a look at the livedemo but even after adding the UpdateBean, it still didn't work.

Any ideas?

A: 

The objects in your repeat need to follow the bean standard if you want to write back to them. I'm guessing that they are just Strings in your example?

Try this:

public class StringBean {
  private String value;

  public void setValue(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }
}

along with:

<h:inputText value=#{item.value} />
Naganalf
A: 

Is it inside the same form as the button is? Is the same datamodel behind the a4j:repeat value preserved in the form submit request? I.e. it returns the same datamodel as it was during the display request?

BalusC
A: 

HI ! i need this...

 </a4j:repeat >

but the second not itering ..

i need help !

mario
go ask a new question and include more details there
Bozho