This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes  Problem in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark " Problem in JSF" Watch " Problem in JSF" New topic
Author

Problem in JSF

Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844

HI,

I am facing problem with f:selectItems tag. the following is the code
i am using to display the values.

<h:selectOneMenu id="dgt_ispn"
value="#{digitManipulation.dgtIspn}">
<f:selectItems id="dgt_ispn_list"
value="#{digitManipulation.dgtIspnList}"/>
</h:selectOneMenu>

Each value is displayes two times. Please help me.

I am setting the values in the bean like this :

public void setDgtIspnList(ArrayList list){
this.dgtIspnList = list;
}
public ArrayList getDgtIspnList(){
dgtIspnList.add(new SelectItem("YES"));
dgtIspnList.add(new SelectItem("NO"));
return this.dgtIspnList;
}


Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Where did you define dgtIspnList?

Looking add your code I get the idea that by every call the the method
getDgtIspnList() the selectItems are added to the dgtIspnList?


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in JSF