Hi,
I have a grid based on a RecordType, and I have coded a multi-selection mecanism inside the selectionSaveInto portion code.
When I select a line, some tests are made, but Appian takes 2 seconds to accept the selection (even if I do nothing, just click on a row).
Then I can select or deselect another line.... etc...
All works fine as, I let Appian finishing the work (progression bar is displayed at the top of the screen).
The problem goes when I click quickly on many lines: this creates some bugs.
How may I rid of this issue? is there any way to toggle enable/disable selection after having selected a row (while Appian is working)?
or is there any way to deactivate the mouse cursor during the Appian progression bar (as we could do with any other language like Java)?
Regards
Discussion posts and replies are publicly visible
Can you paste the SAIL code you have? There is an easy way in SAIL to only allow single row selection. Some reasons why the section might be slow:
1. Your record type is referencing a database view or large table
2. Your grid is querying extra columns from the database
Thank you Danny but I do not need to allow single row selection.I have to deal with muli-selection, but each time I select row, I have to wait 2 seconds.
Without posting a sample of your SAIL code like Danny mentioned, we can't really help you without just guessing.
Yes, you're right, here is my sample code:In my example, you can select some lines while total value of rows is less or equal to 50.So, if you select the "make4" row, you can not select another row (unless you unselect this row).But, if you click very quickly and successively on these 3 rows : "make4", "make3", "make2", you will obtain the selection like the picture below : "make3" and "make4" rows are wrongly selected and the total is 70, so it should not be possible.In reference of what Danny said, you can easier testing this using a database view or large table, with a lot more grid columns.
a!localVariables( local!saveSelectedVehicles: null, local!selection: ri!selectedVehicleIds, local!valMaxAuto: 50, a!sectionLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!cardLayout( contents: { a!gridField( label: "Read-only Grid", labelPosition: "ABOVE", data: ri!vehicles, columns: { a!gridColumn( label: "Make", value: fv!row.make ), a!gridColumn( label: "Model", value: fv!row.model ), a!gridColumn( label: "Value", value: fv!row.value ), }, selectable: true, selectionStyle: "ROW_HIGHLIGHT", selectionValue: local!selection, selectionSaveInto: { local!selection, a!save( ri!selectedVehicles, append( ri!selectedVehicles, cast( 'type!{urn:com:appian:types:cjt2}CJT2_Vehicles?list', fv!selectedRows ) ) ), a!save( ri!selectedVehicles, difference( ri!selectedVehicles, cast( 'type!{urn:com:appian:types:cjt2}CJT2_Vehicles?list', fv!deselectedRows ) ) ), /* Manage selection acceptance */ a!localVariables( local!maxValueAccepted: if (not(isnull(ri!selectedVehicles)), sum( a!forEach( items: ri!selectedVehicles, expression: fv!item.value ) ), 0 ), if (local!maxValueAccepted > local!valMaxAuto, { a!save(local!selection, remove(local!selection, length(local!selection))), a!save(ri!selectedVehicles, remove(ri!selectedVehicles, length(ri!selectedVehicles))), }, null ) ), a!save(ri!selectedVehicleIds, local!selection) }, validations: {} ) }, height: "AUTO", style: "NONE", marginBelow: "STANDARD" ), } ), a!columnLayout( contents: {} ) } ), a!paragraphField( label:"ri!selectedVehicle", value: ri!selectedVehicles ) }, showWhen: true ) )
One potential issue here is that in your grid selection saveInto, you're doing maybe 5 or 6 consecutive operations for every single click, when you could probably accomplish the same thing in 1 or 2 operations.