• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

dataTable question

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
We don't have time to be charming! Quick, read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic