On 7/19/05, Aleksei Valikov <[EMAIL PROTECTED]> wrote: > Hi. > > >>What would be the easiest way to implement this with standard EL, > >>without JS? > > > > Let's assume... > > [skip] > > Thank you, your answer is the most complete of all I've seen in the > thread. I only miss one fragment: > > > When the commandLink is clicked for a particular row in the table, the > > current row is established in the table data model prior to action > > event delivery. > > Is it possible to set the current row and invoke an action with one command?
For the standard Data Table component, it works like this: The current row is established by using the "var" attribute on the <h:dataTable> component, to specify the name of a request scoped attribute that will represent the content of that row (precise implementation is up to the DataModel being used). Before your commandLink's action method is called, this request scoped attribute will have already been set by the component -- all you need to do is use the information in that request scoped attribute to identify the current row. As a concrete example, if you are using ResultSetDataModel, the request scoped attribute being exposed will be a Map of all the column values, keyed by column name. Thus, as long as you include the appropriate primary key columns in the query that the RSDM wraps, you can easily get back to the right data (whether or not you actually displayed those primary keys in the Data Table component). > > Bye. > /lexi Craig

