i m using inside the backing bean an
private ArrayList<String> myList;
init(){
myList = new ArrayList<String>();
myList.add("XYZ");
}
public ArrayList<String> getMyList(){
return myList;
}
public setMyList(ArrayList<String> l){
myList = l;
}
insde the xhtml
i show the elements by doing:
<h:outputText value="Item: " />
<p:inputText required="true" label="Item"
value="#{mybean.myList[0]}" />
when i show the page i see the value:
XYZ
in the page.
So my question is:
If I do NOT set "XYZ" inside the ArrayList and the user writes inside p:inputText
the value "HKJ", will I find on server-side inside myList
at position 0 the expected "HKJ"?
Can I use ArrayList
for display and set values or do i have to use String[]
?
you can find here similar question:
http://www.velocityreviews.com/forums/t303520-jsf-using-arrays-arraylist-in-the-backing-bean.html