Hi Andrew,
You can use a decorator on the column and add the column name as a parameter to
the link. For example:
final ActionLink link = new ActionLink("link");
Column column = new Column("action");
column.setDecorator(new Decorator() {
public String render(Object object, Context context) {
link.setParameter("COLUMN", "XYZ");
return link.toString();
}
});
table.addColumn(column);
Then when the link is clicked, you can retrieve the "COLUMN" parameter which contains the name of
the link that was clicked.
Hope this helps.
Kind regards
Bob
On 2011/11/04 04:02 AM, Andrew Schoener wrote:
Newbie here, taking click for a spin.
I have:
* a page extending BorderPage
* I have on the page a Table object
* I am populating the table object with a JDBC helper class that returns a
List of the required data
* I am therefore using table.setRowList(list);
* In my table, I also have an ActionLink added as a column. The ActionLink is
called "View
Detail" on the page
What I want to do is to click the View Detail link in the page and call a SQL
statement to populate
a child Table object
However, to do so, I need to know one of the column names from the parent table
/ row to build the
dynamic SQL.
And while I am at it, none of my parent table columns are called ID.
For the life of me, I cannot figure out how to connect the dots so that my
ActionLink method (eg
"onLinkClick") can look into the columns on the row for which the View Detail
link was clicked.
Thanks
Andy