This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes how to edit <h:SelectOneMenu> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to edit <h:SelectOneMenu>" Watch "how to edit <h:SelectOneMenu>" New topic
Author

how to edit <h:SelectOneMenu>

peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

Hello.
I have a <h:dataTable and i want to edit each row .
when i press on edit button row data appear blow the datagrid or dataTable.
one of the values that users can edit will fill into the <h:selectonemenu.
I want to Know how can i fill the <h:selectonemenu with own selected item at the top of the <h:selectonemenu>
I am sorry for bad english writing.
thank you.

<h:selectOneMenu value="#{course.selectedItem}" >
<f:selectItems value="#{course.comboItems}">
</h:selectOneMenu>


public String allCategory(){
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
CategoryManager categoryManager = (CategoryManager) ctx.getBean("categoryManager");
categoryList = categoryManager.getCategorys();
comboItems = new ArrayList<SelectItem>(categoryList.size());
for (Category categoryValue : categoryList) {
comboItems.add(new SelectItem(categoryValue.getId().toString(),categoryValue.getName()));
}
return "course_list";
}
[size=12]
[/size][color=black]
[/color]
 
 
subject: how to edit <h:SelectOneMenu>
 
Similar Threads
selected value through select items
Error binding a h:selectOneMenu to a LinkedList
Birth Date nightmare - passing variable between beans and java objects
List<SelectItem> sort
Is it possible to refresh the dropdown h:selectOneMenu