03-09-2018 08:47 AM - edited 03-09-2018 07:53 PM
I am using GMSC v16.02. I want get the list of IDs of the selected features.
I tried the following but it didnt work.
<FormField name="SelectedElements" label="Selected elems" type="textfield" datatype="string" persisted="false" defaultvalue="SCRIPT[IG.getSelectedElements()]" />
How can I get the IDs of all selected features? Is there any other method? Please suggest.
03-10-2018 02:10 AM
I think this thread is relevant to you:
The idea is that in order to store a list of selected objects you need an array, so a formtable.
03-10-2018 05:07 AM
Thanks a lot. Actually my client wants to select the multiple features in a layer and delete them together.
Now I achieved it. I created a formfield with persisted="false" and store the IDs of selected features by running a custom scrip on the form:ready event.
var selFeaturesID = IG.getSelectedElements(); form.getItemById('SelectedFeatures').setValue(selFeaturesID);
Then I used a SQL trigger to delete those records from the table which are in selected IDs.