Drop-down List in Managed Code

How Can We Help?

< Back

Use Case:

  • You need to change the list values in a drop-down box on refresh.
  • The list of values in a drop-down are different, based on the current user.

Solution:

The following code should be placed in the code editor for the control being changed.

 

 

Please note the following:

  1. Grp[“NS10Dropdown”][0,true], The quoted value is the name of the control.
  2. Grp[“NS10Dropdown”][0, true], the 0 is the index within the control, relevant normally when you have a table with multiple rows.
  3. Grp[“NS10Dropdown”][0, true], the true means that we are updating the list for the drop-down. If the value is false, then we are updating the selected value for the drop-down.

Code Recommendations:

  • When setting the drop-down list, you should trim each value of whitespaces otherwise the control value might not be set properly in code.
  • The drop-down list is not passed from one activity to another but the value is. Trying to retrieve the list will result in a null reference exception.
  • Setting the drop-down value to a value that doesn’t match 1:1 with the value in the drop-down will result in the value being blank.
Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X