• Post Reply Bookmark Topic Watch Topic
  • New Topic

Indexed properties in JSF

 
Dan Waters
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The managed bean is described as below:

class MyBean {

private ArrayList brandNames;
public List getBrandNames() {..};
public void setBrandNames(..) {..};
}

How do I show it in the JSF page in the JSP?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you wanting to show?
 
Dan Waters
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to show a list of brandNames like this..

<input type="text" name="brandNames" value=""><br>
<input type="text" name="brandNames" value=""><br>
<input type="text" name="brandNames" value=""><br>
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the h:selectOneMenu component and it's associated selectItem and selectItems. This is fairly common. You might want to check out a good book like JSF In Action and/or Core JSF. They might save you from waiting around for us slow pokes to getting around to answer your questions about such things.

In the mean time, you can check out this thraed which isn't the same as your question, but does contain the code you are looking for.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!