Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

dataTable question  RSS feed

 
DeAlton Jones
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I was wondering if there is anyway to access the components attributes from the backerbean and change them.

What i am trying to do is if a button is pressed I want to display all the records in a dataTable. It is easy to do for one table but I have multiple DataTables on my page as jsp includes. So I figure that there must be some way to access the components and change an attribute then refresh the page.

Still learning ...and learning...and learning
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah just map your dataTable to a List on the backing bean and populate the list when the button is pressed.
 
DeAlton Jones
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lynette Dawson:
yeah just map your dataTable to a List on the backing bean and populate the list when the button is pressed.


I am not sure I know what you mean by map dataTable to a list. Can you elaborate a little more. I am trying to make this a reuseable class and I want to be able to use this class regardless of how many dataTables are on the page (which are done with jsp:include).

I have been able to achieve this by assigning a variable to the rows attribute in the HTML and based upon a conditioning in the backerbean show some or all of the records. But I do this for each dataTable.

I am trying to keep a global view in mind and not individually code each page.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bind the datatable to the backing bean.

JSF

MyBean

Then you can access all attributes. Also see javax.faces.component.html.HtmlDataTable.
[ October 09, 2006: Message edited by: B L Scholtz ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!