• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to display list using jsf  RSS feed

 
lalith kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,

i dont no how to display list. by retrieving values from database and should be displayed in list format using datatable tag in jsp.
pls help me.
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the similar problem when I was just starting with JSF which makes me double excited to help you.


Create a property in your managed bean as shown below:





Import JSF tags in your JSP



Decide in your JSP which properties of the bean you want to display using the datatable and column tags



Hope this helps.
 
lalith kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am not getting these two lines



whether i have to create separate class as MoveClip or not.

retrieved from DB means i have to write the query or only values.

thank you.
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to create a MovieClip class. That was just an example. You can provide your own class there. I hope you are already familiar with Generics in Java.

You also need to provide the List you retrieved from the database in the <retrieved from DB> section. Well it does not have to really come from a database but that's what normally what you would want to do.

Let me know if you require further assistance in other parts of the code.
 
lalith kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot.......

I am getting list. But one more problem i.e. whenever i will refresh the list page one more record has been inserting.... In struts i solved it by redirecting the page to some other page shall i do the same.
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post a sample of how you are adding entries to the list? Yes you can also apply the PRG pattern which is widely used in struts to JSF using the <redirect /> element which you can add to the navigation rules.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!