SMO load once populate several dropdowns in views

  • 5 February 2015
  • 6 replies
  • 0 views

Badge +2

Is it possibe to load a SMO once in a Form initialize rule and then populate other dropdowns in views within the same form? rather than loading the same SMO for every single view? If yes, how (with specifics please)

 

Thanks so much

Steve


6 replies

Badge +8

Hello,

 

Are you using a SmartObject as your Data Source when you are creating the view?

 

Regards,

 

Matt

Badge +2

Matt,

 

Yes I am

 

Steve

Badge +8

Hello Steve,

 

I am attaching an image to this post. Essentially you would just map out all of the rules in the Initialize method. So in the example I have attached I am executing the 'GetList' method and then populating the applicable DropDown control with that data upon initialization. Is this what you were looking to do?

 

Regards,

 

Matt


16939i4EBCCABC0F62E6C0.png
Badge +2

OK I see what you mean - load the List once and then populate all the dropdowns? I'm assuming we can populate all dropdowns in multiple views that are attached to a single form?

 

Thanks so much

Steve

Badge +8

If you were going to apply the same logic with mutiple views you would apply that logic at the form level. You can do it at the view level as well, but applying the logic at the form level if mutiple views are involved could be a little easier from an administrative standpoint..

 

Please let me know if you have anymore questions!

 

Thanks!

 

Regards,

 

Matt

Userlevel 4
Badge +13

Hi Hsiungst,


 


So as I understand:


You have one form with multiple views, for arguments sake let’s say you have one Form containing three Views where each view contains 1 dropdown list.


You have already bound your SmartObject to View 1 and is calling its GetList method on the Forms initialize rule.


Now you want to populate all Dropdown Controls in each of the Views with values coming from the same SmartObject as the one bound to View 1 without having to load the SmartObject for View 2 and 3 as well?


 


If my understand is correct then yes this is possible by Form Level, please try the following:



  1. Create View 1, add a drop down list, bind the dropdown list to the required SmartObject, remove the dropdown list's populate rule which will be auto-generated.
  2. Create View 2, add a drop down list, bind the dropdown list to the required SmartObject, remove the dropdown list's populate rule which will be auto-generated.
  3. Create View 3, add a drop down list, bind the dropdown list to the required SmartObject, remove the dropdown list's populate rule which will be auto-generated.
  4. Generate a Form from View 1, Edit the Form and add View 2 and 3 to the Form.
  5. Ensure that none of the views have any rule that populates the dropdowns at this point.
  6. On the Form add an initialize rule which will contain the following rule set:




  • When the Form is Initializing





  • then complete the following in a batch




    • also on Form Main smo SmartObject, execute its Get List method

       (configure)




    • also on View 1 View, populate Drop-Down List (View 1) with data

       (configure)




    • also on View 2 View, populate Drop-Down List (View 2) with data

       (configure)




    • also on View 3 View, populate Drop-Down List (View 3) with data

       (configure)






  1. Save the Form and Finish.

When running your form all the drop downs form each view will be populated and you only had to load the SmartObject once.


 


Do note that every time you make changes to one of the dropdowns then you have to re-ensure that the dropdown population rule is not automatically added to the views initialize rule (this is Step 5 again).


 


If the above is not what you are referring to but instead you are referring to, if it is possible to bind SmartObjects to dropdowns during runtime by using rules - then the answer is No it is not possible as a dropdown has to have a data source in order to function.


 


Kind Regards,


Raymond

Reply