Search Support
-
TodorJuly 6, 2017 at 9:33 am #4473
It seems the table control cannot be initialised using .clear(). It still keeps the selected row indeces and when boundary event tries to sync the SPARK object with the BPM object and error is thrown:
Caused by: java.lang.ArrayIndexOutOfBoundsException: CWLLG0892E: The -1 index cannot be selected by using a negative value.
at com.lombardisoftware.core.TWObject.listAddSelected(TWObject.java:1140)
at com.lombardisoftware.component.coachng.worker.CoachNGDataJSONHelper.JSONArrayToTWObject(CoachNGDataJSONHelper.java:409)You can replicate the issue when binding the table to a list of complex objects. Select one or many of the rows and invoke table.clear(). Before you invoke a boundary event, invoke table.getSelectedRecordCount() – it will return 1 or more depending on the previous selection. GetSelctedIndex() and other getSelected* methods returns -1 or undefined as expected.
TodorJuly 6, 2017 at 9:43 am #4474Some workaround is to use table. removeRecord(). This however does not clears the “selectAll” checkbox for tables in selection mode of “Multiple”.
SPARK SupportJuly 6, 2017 at 3:01 pm #4476Hi Todor,
I have reproduced this issue in our test environment. A bug has been logged for both the issue with clear() causing the error on Boundary event and getSelectedRecordCount() returning 1 after having cleared the table. As you noted, getSelectedIndex() is returning -1, which getSelectedRecordCount() is counting as a selected index. A fix for each issue will be implemented in the next release.
As for the issue with the Table clear() method, to work around this issue, also call table.setAllRecordsSelected(false); along with table.clear() in your code. This has the added benefit of clearing the Multi-selection Select All checkbox.
Regards,
Stephen P.
TodorJuly 7, 2017 at 8:14 am #4477Thanks Stephen,
My workaround is always to map the table to Data. Then I just reset the Data.setData(…)
table.clear() + table.setAllRecordsSelected(false) did not work for me yesterday.
Thanks,
Todor
SPARK SupportJuly 7, 2017 at 9:38 am #4478Hi Todor,
Just to be clear, my work-around worked for me by calling setAllRecordsSelected(false) before calling clear().
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.