Make a value of a dropdown selected

  • 8 December 2015
  • 6 replies
  • 6 views

Badge +1

Hi guys,

 

I'm a bit stuck here. I have a view with a dropdown control called OPERATINGUNIT. This dropdown gets populated from a smartobject when the view initializes.

 

Now, I have another form that calls this view. But when this view gets called I want the OPERATINGUNIT dropdown to select a specific value automatically as the view initializes during the call. When I call the view, however, I get the error message that says "The following field are required to List: - OPERATINGUNIT"

 

This works well when with dropdowns based on staic values but not in the case of a dropdown populated from a smart object.

 

Could you please help.

 

error attached

 

Thanks.

Capas.

 

 

 

 

 

 

 


13147i488AC15D54D44AC3.png
15659i9D4DD2B5E21FFC05.png

6 replies

Userlevel 3
Badge +8

Dear , 

 

If i got u right , u r trying to set specific value to a drop down-list , well Drop down-lists in general always has "Value" and "Display"

it doesnt make any difference its its populated from static data , or populated from a smartObject ,

and about how to set a specific value , first off u will need to check that ur drop down-list populates data properly from the smartObject Source 

Then go check which is the "Value" of ur SmartObject data , ("probably using the "ID" Field")

for example , ur table has 2 columns only  , 1-ID , 2-Name

if ur drop down-list populated all names in proper way with no errors , try using Transfer Data Rule in the Form Initialize Rule , Transfer  a value to the drop down list , Value which i mean is the "ID" from my scenario , and it will set the Name by that way .

 

again i remind u , please make sure ur list populates in proper way and u get all records , and make sure the transfer rule comes after the populate rule

because it has to be populated before u transfer value to set .

 

Hope that helps 

Best regards.

Badge +2
Hello Dear,

Seems like the rule specified to set the specific value is executed even before the drop down is populated hence u get the error. If you want to set the same value better go for the default value for drop down control

Thank you
Lubna
Badge +7
Hi Capas,

As per your text seems like you have a drop down list connecting to different data source through smart objects, however when you run the view or the form which has the view with drop down control connecting to Smartobject, you are receiving the error, if this is your scenario?

Then I'm definitely sure your Smartobject list method binds to drop down control expects input field value, to confirm that I would ask you to run the Smartobject get list method from the Smartobject tester and see if it gets you all records, if it ask for specifying the input field value, then either you need to pass that input parameter as filter on the drop down list control as well else you may have to tweak your Smartobject to not to expect input field mappings for get list method!

Hope it helps!
Cheers,
Prajwal Shambhu.
Badge +1

Hi guys,

 

I think my problem is that I'm setting the value of the dropdown before the values are populated. The thing is, the dropdown in question loads the values during the initialize rule of the view. After the view has finished loading and the dropdown is populated with values, I want to have a specific value selected. The value to be selected is passed from a different form that calls the dropdown view.

 

So my question rephrased: How can I set a value for the dropdown on the called view after the view has loaded? The value to be selected on the view is passed from the calling form.

 

Thanks.

Capas

 

 

 

 

Badge +1

Hi guys,

 

My problem is diagnosed correctly by Lubna. See her reply below in italic:  Lubna, what do you mean by going for the default value of the dropdown control? Can I set a rule that sets the default value of the dropdown based on the value that I transfer from the calling form?

 

Hello Dear,

Seems like the rule specified to set the specific value is executed even before the drop down is populated hence u get the error. If you want to set the same value better go for the default value for drop down control

Thank you
Lubna

 

 

Userlevel 3
Badge +8

Dear ,

If u r passing a value from Previous Form to the current form , and this value is used to set the value of the drop down list .

oh well , do u receive the value as a parameters in the current form ? if so , then go to the vew , create a hidden text box on the view for sake of example name it "txtPopulate" , , then go to Form initialize method , Use "transfer data" rule , make it last rule , because u will need the view with the drop down list to execute his initialize first and populate the drop down list , so make transfer data as last rule in the form initialize rule .

after that , go to the view , add a new rule , the event is "when a control executes an event , the event is "changed"

inside that rule , u transfer the "txtPopulate" Control to the drop down list .

in this way u will have ur drop down list populated first for sure , and after that u set the needed value .

 

hope it helps ,

best regards.

Reply