|Define rows selection in a TableField at server side. [message #1294086]
||Sun, 13 April 2014 06:00
| Jeremie Bresson
Registered: October 2011
In the application I am working on, I need to control the selection in a TableField from the Scout Server.
I am wondering where I should put this information.
1/ Variable on the form (rowId as int ?)
[Problem] it is not coupled with the table Field (I need to make the field aware that it need to store the selection information in this variable)
[Problem] In the TableFieldData the rows are ordered, but after an import in the TableField, I am not sure that this order is preserved.
2/ Table Status
The current statuses are:
I could try to add additional status to mark which row is selected.
I don't think that it is a good idea, because those status are used internally by the table.
With Bean based TableData, it is possible to add a custom value on the row.
The Idea is to add a custom value to mark it as selected.
To retrieve this customValue information, I need to extend the current "TableRowMapper".
I cannot set the selected values on the table before they are imported in the table. Otherwise I will get an Exception (A).
The problem is that the mapper isn't notified when the mapping is over. Even if I manage to retrieve the "Selected" value for each rowData in TableRowDataMapper.importTableRowData(ITableRow, AbstractTableRowData). I will not be able to use this information to select the corresponding rows when the rows are imported.
4/ Boolean column
I could add an undisplayable boolean Column (SelectedColumn) in the table.
I could intercept importFormFieldData on the tableField and add some code to select the rows according to the content of the SelectedColumn
(A) Execption Stack trace
When you try to import a ITableRow that is not in the table:
Caused by: java.lang.IllegalArgumentException: only accept InternalTableRow, not class org.eclipse.scout.rt.client.ui.basic.table.TableRow
Powered by FUDForum
. Page generated in 0.02304 seconds