Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to populate dropdown in jsf thru database values?

 
Angellika desai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thr..

i m cmpltly new to jsf.. n its like terrible dream for me right now..

i want to know.. how to populate drop down in jsf from the valueds from database? please i want code...

thnaks in advance...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read UseRealWords and NotACodeMill.
and avoid making entire post in bold letters, because it wont look good. people may just ignore your post !

Coming to your question, jsf has <h:selectOneMenu/> tag for your need!

and Welcome to JavaRanch Angellika desai!
 
Angellika desai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i would take care.. thanks for informing..

and yes i know this tag but

problem is how to get data from database into the drop down?
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angellika desai wrote: problem is how to get data from database into the drop down?


You will need a list.

Create a method that will get the data from your database.

With this list, you will send the itens to your select one menu.

In this post, I show how to put your classes into a select menu. JSF: Converter and Bean AutoComplete
 
Angellika desai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all for your replies..i hope i get it worked soon..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic