I don't understand what you're trying to do, but this is one way you can
obtain the current row of a table. Although, this is more useful during
the decode and rendering phases. That is, when the table is iterating
over data, it will tell you which row it is on.
| // Get current table row.
//
// Note: To obtain a RowKey for the current table row, the use the same
// sourceVar property given to the TableRowGroup component. For
example, if
// sourceVar="name", use "#{name.tableRow}" as the expression string.
private RowKey getTableRow() {
FacesContext context = FacesContext.getCurrentInstance();
ValueBinding vb = context.getApplication().createValueBinding(
"#{name.tableRow}");
return (RowKey) vb.getValue(context);
}
|If you're trying to obtain data from a specific row, access your
DataProvider class directly. (You should have this object available in
your backing bean.) Basically, you set the current row by defining a
RowKey object and use FieldKey objects to access the data. If you
prefer, you can obtain all RowKey objects and iterate over the DataProvider.
Have you looked through the TLD docs for table, tableRowGroup, and
tableCoulmn? You can find the above code in the table TLD, specifically
under the "Select.java" utility class section. If nothing else, the TLD
docs will provide examples for how to manipulate DataProvider objects.
http://webdev2.sun.com/woodstock-tlddocs/
The DataProvider javadoc is below.
http://developers.sun.com/docs/jscreator/apis/dataprovider/index.html
Dan
Necromancer wrote:
> i has table on my page and button on all rows
> when i click button javascript fires:
> DynaFaces.fireAjaxTransaction(this,{execute: 'form1:a1,a1', render:
> 'customerid'}); return false;
> all good, but HOW obtain table record?
> FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("row")
> return TableRowDataProvider but row not set correctly.
>