Skip to content

Commit

Permalink
improve rows selection
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelperezcolom committed Oct 9, 2024
1 parent 3f2a5ba commit aa7aa0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ private Object[] injectParameters(
}
if (listing.getRowClass().equals(m.getGenericParameterTypes()[i])) {
List<Map<String, Object>> rowsData = (List<Map<String, Object>>) data.get("_selectedRows");
Map<String, Object> selectedRow = new HashMap<>();
if (!rowsData.isEmpty()) {
selectedRow = rowsData.get(0);
Map<String, Object> selectedRow = rowsData.get(0);
values.add(
reflectionHelper.newInstance(listing.getRowClass(), selectedRow));
} else {
values.add(null);
}
values.add(
reflectionHelper.newInstance(listing.getRowClass(), selectedRow));
continue;
}
if (m.getName().equals("onRowSelected")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ public Object actionOnSelectedRow(Row row) throws Throwable {
return new Message(ResultType.Success, "row received", "" + row, 5000);
}

@Action
public Object selectionNotRequired(Row row) throws Throwable {
return new Message(ResultType.Success, "row received", "" + row, 5000);
}

}

0 comments on commit aa7aa0e

Please sign in to comment.