Hi,
this is a bit complex to explain in a post, but I’ll try it… I will base what I say on the sample “wm_coreproviderstest/WebContent/view/Table/Selection.view”.
I suppose you have:
- an array of items (in the sample this is a SampleItem).
- a content provider based on that array (Selection Provider)
- the content provider has its property “Row Id Expression” to a unique identifier inside the row java type (in the sample, “id”). Without this property (Row Id Binding) correctly configured, it will not work
- a table (generated via drag and drop of the content provider) or async table
- in the table you have added a “Select Row Checkbox” or “Select Row on Click” controls.
Since you want to access, on the server side, the selected rows, you will need some action that takes the rows selected on the browser to the “server”. In the sample this is done by the “Get Selected Rows” button, bound to the “processSelection” action.
In that method, you can do something like:
List<Object> selectedRows = getSelectionProvider().getSelectedRows();
SampleItem testItem = null;
for (Object object : selectedRows) {
testItem = (SampleItem) object;
System.out.println("+++ item: " + testItem.getId());
}
That should make it…
hope this helps,
Javier
#MWS-CAF-Task-Engine#webMethods#webMethods-BPMS