[MultiSelect Mobile] Populate list outside of OnInitialize?

Forge Component
(4)
Published on 2017-11-30 by Atul Patel
4 votes
Published on 2017-11-30 by Atul Patel

Hello,

I'm trying to populate the multiselect list after I fetch the data from the database (on the On After Fetch action), and it appears that the data doesn't show up in the list, even though it's in the array.  The demo uses OnInitialize, are we not able to populate the list using anything other than that?

I can confirm the issue in the Demo app...if I change the Load function to execute on On Ready instead of On Initialize, it doesn't work!  Thoughts?

Regards,
Mike

Solution

Hi Mike,

This is easy to fix, what you have to do is put an if condition around the MultiSelect widget on the aggregate that is fetching the data. So for example you have GetEmployees aggregate to select multiple employees in the widget:


No need to do anything in OnInitalize or OnReady.

Regards,

Daniel

Solution

Thank you!  I should have thought of that.

Hi,

What happens is that the change of the value of the .IsDataFetched property will re-render that part of the DOM just after the data is available and not any sooner.

Regards,

Daniel