Hmmm. I think you're spot on with your comment about putting the functionality into the row object itself. That's what I was trying to do when I erroneously attempted to bind to the dataTable var. Each row object would be responsible for generating the appropriate components. But it sounds like the row object can only be accessed through its parent dataTable, which I suppose makes some sense.
It finally dawned on me that I need to deal with the dynamic generation at two points - the rendering of the HTML and when the values are posted back to the server. The latter I think I can deal with, but the former has me scratching my head. It seems like I'll need to generate the dynamic components at the same time I initialize the dataTable list (perhaps in a map), and then refer to those components in the column definitions. fastbob Simon Kitching-3 wrote: > > fastbob wrote: >> Is there a preferred JSF pattern for communicating user selection of a >> dataTable row back to the server? I've found a number of somewhat crufty >> methods (such as on BalusC), but unless I've missed something, none seem >> particularly attractive other than f:attribute. But perhaps that's just >> the >> nature of the beast. Any suggestions? > > Generally when processing a row the nicest solution is to build any > functionality needed onto the row object itself. Suppose the model is > normally a list of Person objects but some logic is needed to manipulate > a particular person then the model can be changed to a list of > PersonHandler objects each of which has a "person" property. In this > case, there is no "communication of the user selection" required; the > method is invoked *on* the selected object. > > An alternative is to set the "binding" attribute on the t:dataTable > object, then the callback method that is invoked can call the getRowData > method on the datatable to find the row "currently being operated on". > It's not so elegant but does work fine. > > I think that if you write the commandLink to invoke an ActionListener > rather than an action method then the event might also have the > appropriate row info but am not sure of the details here. > > Regards, > > > Simon > > -- View this message in context: http://www.nabble.com/Dynamic-panelGrid-within-dataTable-tf3218128.html#a8970885 Sent from the MyFaces - Users mailing list archive at Nabble.com.

