252
Views
5
Comments
[Multiple Selection Dropdown (ReactAndMob)] Using Multi Select Dropdown
Application Type
Reactive

I had install the MultiSelect_ReactAndMob and set it up show the grade group for user to select

As i had problem installing the demo i am not able to learn how to save the selected value to the entity attribute gradegrp. Does the value get save as "EXEC,GRADED,JREXEC" ?

Also if i manage to get it to save to the entity,  how do i get the data back to display to the user what had been selected when editing ?

Thank you in advance


2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Jerah,

Try installing (or referring to) the demo after downloading (using the Download asset and demo option) from the asset page.

 

However, I will try to help you with your queries.

1) How to save the selected value to the entity attribute gradegrp. Does the value get save as "EXEC,GRADED,JREXEC" ? 

  • The MultiSelect_ReactAndMob block does have an OnChange event which passes the SeletedItem List with IsSeelcted status value as per the selection
  • You will have to Filter the (OnChange event i/p parameter) SelectedItem list with IsSelected = True condition, to get all the selected options
  • If you want to store the selected value as a comma seperate value in the gradegrp attribute - reference the filtered selected options and use the String_Join server action from the Text module

2) Also if i manage to get it to save to the entity,  how do i get the data back to display to the user what had been selected when editing?

  • To display the selected options by default, you will have to explicitly set the IsSelected attribute value to True for all the saved option records, while appending the options to the DropdonwMenuList (mapped with MultiSelect_ReactAndMob block).

I hope this helps you!


Kind regards,

Benjith Sam

2021-06-13 07-48-30
Jerah

Thank you i will try out your suggestion

UserImage.jpg
Chris Stacey

Hi Jerah,

I know of one other person who had trouble installing the demo. They raised a ticket with OutSystems support who told them the OutSystems Environment needed updating. Not very satisfactory to me because I don't have enough information to ensure it doesn't happen to others.

I'd like to investigate this further with you - if you have time. I'll message you shortly.


With regard to your issue...

MultiSelect_ReactAndMob widget Crash Course

  • The widget accepts a list in the parameter "DropdownMenu"
    (of type struct "MultiSelect_ReactAndMob")
    When you set up this list, you can set the list items to appear as pre-selected and/or uneditable.

  • The widget returns a list (and the number of items selected), via the "OnChange" event.
    You must define an event handler (client action) for the widget's "OnChange" event.
    This is where you will use the returned list, however you like.
    This event will fire (will happen), and the event handler (the assigned client action) will run, every time the user makes a change to the selected item in the dropdown menu (the list).

    Another picture that my be useful (from my answer to an unrelated question): [Multiple Selection Dropdown Widget (Reactive And Mobile)] pass multiple selected value from dropdown in IN clause

  • The "Return_SelectedItemsOnly" parameter controls whether the widget returns the entire list, or only returns the items in the list (dropdown menu) that the user has selected (checked).


  • The attributes of the "DropdownMenu" List (the struct type "MultiSelect_ReactAndMob" )
    • "List_Item" is the label that appears, to the user in the webpage (UI), next to the checkbox in the dropdown list (dropdown menu)
    • "IsSelected" controls whether the checkbox for that list item appears selected (checked)
    • "IsEditable" controls whether the checkbox for that list item may the changed by the user (selected/unselected, checked/unchecked)
    • The "Meta..." attributes are just a convenient way to store information you want to use upon the return of the list, rather than having to look up the information again (using an Aggregate/SQL) when the list is returned.




Remembering which items were selected (ie. end user saving their progress)

The widget does not remember anything.
You must store the user selections in an entity yourself.
When you return to re-create the selections your user had previously selected (restore their saved progress), you just need to set the "IsSelected=True" attribute for each item in the list (dropdown menu) you want to be selected when the user first re-loads the page (returns to their saved state).


More Information

For more information, each parameter and attribute has its own description.
Access the descriptions by hovering over the parameter/attribute, and/or opening the "description" property (useful if the description is truncated in the hover popup).


Hope this helps,
happy to help further.

All the best of luck with your developing.

Kind Regards,
Chris

2021-06-13 07-48-30
Jerah

I will be going back to office for UAT and Meeting this afternoon. Not sure what is the time difference , Singapore time here is 11:58AM. I will be free only after 6pm will you be available 

UserImage.jpg
Chris Stacey

Hi Jerah, I sent you a message (here on the forum email service).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.