• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding out the components in a row of aDataTable  RSS feed

 
ved gunjan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,
I'm using DataTable for displaying a dynamic list of objects.
In the rows, i have different number of components,like for example first row might be having input field and slectOneMenu second row might be having two input fields and check boxes.

My query is how do a i get in my java code the different components of a row.

Hope im able to explain my problem. Please throw light on this , as im in dire straits.
Thanks
Ved
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2 possibilities:

1) Bind h:column to the backing bean as HtmlColumn and dynamically add components depending on current row (HtmlDataTable.getRowData()).

2) Put the type of component in the DTO, add all components into the column and use the rendered attribute to display or hide them.
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too am struggling with this as it is obviously not an often-asked question - I've been googling for two days and cannot find a good piece of example code that clearly demonstrates this.

I've found one on this thread that demonstrates how to access the row data through an action...but I have a different use-case where I need to access a piece of data on each row as it's created and have the ability to manipulate it.

Is there a way to "hook into" each row as it is created and manipulate the row data w/o having to click a button or post the form?

Thanks!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!