In a cascading drop down list scenario the second DDL does not load the value from the SharePoint list

  • 20 March 2017
  • 0 replies
  • 0 views

Userlevel 4
Badge +14


 

Symptoms


In a cascading drop down list scenario the second DDL does not load the value from the SharePoint list
 

Diagnoses


It all comes down to the Sequence of events when the form is populated with the list data.

1- When the form is initialized there is a rule that Gets the list item by ID and maps to the various controls to populate them with data. At this point the Primary and secondary cascading drop downs will be populated with the data from the list.
2- There is a On item change event rule on the Primary DDL, this when the above rule fires and sets the value for the Primary DDL this rule is triggered which is expected and this rule then in turn populates the Secondary DDL with data based on filter and choice selected in the Primary DDL. This will blank the value of the secondary after it was set in point 1 above.

With this said the form was behaving exactly as it should.
 

Resolution

With the diagnosis in mind, we changed the design.
1- Removed the Secondary DDL to be populated by the Init rule as we know this will be overwritten when the Primary DDL get a value and the ON Change event fires.
2- With in the Primary DDL rules (On Change) the Secondary is populated with data based on filtered value from Primary DDL. This means the control is reinitialized and will loge previous set value. Inside this rule block after the Secondary DDL was populated with data we got the value using the Execute Smartobject method (GetListItemByID) and set it there.

This puts the sequence of events in order to set the control after it is populated with data.




 

0 replies

Be the first to reply!

Reply