2 answers
- 210
Hi,
I used that solution already, but I thought there would be a more convenient way to do it.
What i did: (keys and dataList) are variables fed by the system when clicking on a Datalist Bean Shell action.
Keys are the primary keys of the selected items
datalist is the whole datalist (of selected AND unselected items)
public void completeSubculture(String[] keys, DataList dataList) { DataListService dataListService = (DataListService) AppUtil.getApplicationContext().getBean("dataListService"); String sql = ""; Connection con = null; DataListCollection rows = dataList.getRows(); for (String key : keys) { String activityName = ""; for (int i = 0; i < rows.size(); i++) { if (key.equals(dataListService.evaluateColumnValueFromRow(rows.get(i),"id"))){ activityName = dataListService.evaluateColumnValueFromRow(rows.get(i),"activityName"); System.out.println(activityName); } } } }
What i find fastidious is that the only way of retrieving a row is by comparing primary keys.
But it works so... great!
Cheers
Baptiste
Add your comment... - 10-1
Hi, with the primary keys you should be able to query for the relevant rows, perhaps similar to I am generating a plugin for implementing a web service that displays all the data rows for a particular application in a database. I have a query regarding how to get table data in to a formrowset
Add your comment...
Hi,
I'm coding a Bean Shell action for a datalist
I'm trying to differentiate the action based on the value of column "Activité".
I understand that the Bean Shell action is fed with "rowKeys" which are the primary Keys of the selected rows. How do I get the "Activité" value of the selected rows?
Thanks a lot
Baptiste