Search code examples
iosactionscript-3dialogair-native-extensiondistriqt

Distriqt Dialog ANE - MultiSelectBuilder error


Hello I am building an app and I am using Dialog ANE.

I need to display a MultiSelect dialog for iOS with 5 different options and initial values for those options. I copied the example that comes with the ANE to show this dialog. When I display the MultiSelect dialog, values array passed displays correct, however selectedItems does not work correctly, it doesn't mattar values inside. I tried also without any initial values and the dialog displays that one element is selected.

I am using this ANE also for other dialogs and it works correctly. Is there anything I am missing?

Here it's my code:

if (Dialog.isSupported)
    {
        _dialogType = multipleSelectVO.type;
        _dialogData = multipleSelectVO.data;
        var values:Array = multipleSelectVO.options[0];
        var selectedItems:Array = multipleSelectVO.options[1];
        // values and selectedItems length is the same.
        var multiSelect:DialogView = Dialog.service.create(
                new MultiSelectBuilder()
                        .setTitle( multipleSelectVO.tittle )
                        .setAcceptLabel( "OK" )
                        .setCancelLabel( "Cancel" )
                        .setValues( values/*, selectedItems */) //I tried with both and just values.
                                                                // Dialog is not display correctly
                        .build()
        );


        multiSelect.addEventListener( DialogViewEvent.CLOSED, multiSelect_closedHandler );
        multiSelect.addEventListener( DialogViewEvent.CANCELLED, multiSelect_cancelHandler );
        multiSelect.addEventListener( DialogViewEvent.CHANGED, multiSelect_changedHandler );
        multiSelect.show();
    }

Thank you very much in advance


Solution

  • This was an issue with the ANE, in particular the multi-select wasn't correctly converting the array of values into the selected row indexes.

    We have corrected the issue now and an update will be available shortly. Check github for the update.