Updating a Drop Down List Selected Item

Avatar

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
friendlyPerson
Level 1

17-02-2016

What I want:

The user selects an Item in a data drop down list (dataDropDownList1). A second data drop down (dataDropDownList2) list is populated with items from a wsdl service. One of the items in the second data drop down  (dataDropDownList2) is selected automatically after the population of items.

What is happening:

dataDropDownList2 does not updated its text unless the item in dataDropDownList1 is selected twice.

My code in the change event of dataDropDownList1

function findItemInDataDropDownList(dataDropDownList,itemSearchValue) { for(var i=0;i<=dataDropDownList.length;i++) { if(dataDropDownList.getSaveItem(i)==itemSearchValue) { dataDropDownList.selectedIndex = i; break; } } } xfa.connectionSet.DataConnection1.execute(false); findItemInDataDropDownList(dataDropDownList2,"UNKN");

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile
sixteenlabsinc
Level 2

17-02-2016

This is actually a fairly simple thing to do:

  • create a new subform on your form below all the other elements on your form.
  • drag and drop the soap service from your data view onto your form into the new subform.
  • in the subform you created for these elements, go to the initialize event and make it hidden (this.presence="hidden";)
  • the input variable for the soap can now be manipulated to send the data you'd like using its' .rawValue.

The .rawValue of your input variable will serve as the input to your service, even when cloned it still uses the form fields for the values. Even better, keep the subform visible and you'll be able to see the values being past to your service as well as being retrieved.

Answers (6)

Answers (6)

Avatar

Avatar
Validate 50
Level 4
nsvsrk
Level 4

Likes

21 likes

Total Posts

229 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 5
View profile

Avatar
Validate 50
Level 4
nsvsrk
Level 4

Likes

21 likes

Total Posts

229 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 5
View profile
nsvsrk
Level 4

30-03-2016

Hi,

I have been looking for a web services integration from AEM Forms 6.1 to populate a dropdown and posted a query in this Forum..

Got the solution for AEM 6.2.

Could you please help me with the procedure of achieving this using 6.1?

Any web service is fine with me.

Thanks,

Rama.

Avatar

Avatar
Give Back 25
Level 5
TundraSteve
Level 5

Likes

51 likes

Total Posts

442 posts

Correct reply

57 solutions
Top badges earned
Give Back 25
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Give Back 25
Level 5
TundraSteve
Level 5

Likes

51 likes

Total Posts

442 posts

Correct reply

57 solutions
Top badges earned
Give Back 25
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
TundraSteve
Level 5

17-02-2016

http://216.104.208.185/content/demo-listings/demo-listings.html

Third sample from the bottom and you can click the link at the top to get the package

Avatar

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
friendlyPerson
Level 1

17-02-2016

If the soap web service require a variable for example 

Content-Type: text/xml; charset=utf-8 SOAPAction: http://tempuri.org/IOnlineAccessioningService/GetCommodities <x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <x:Header/> <x:Body> <tem:GetCommodities> <tem:speciesBreedCode>insert a value here</tem:speciesBreedCode> </tem:GetCommodities> </x:Body> </x:Envelope>

How can I pass the speciesBreedCode to

service = xfa.connectionSet.findCurrentStatus.clone(true);

Avatar

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile
sixteenlabsinc
Level 2

17-02-2016

So, a couple of things about your code:

- Don't use the hard-coded xfa.connectionSet when calling web services. Use a clone of the service and replace the soapAddress with a variable that you can pass into your form data from your rendering process. This will let you move your form from one environment to another without having to change your WSDL.

service = xfa.connectionSet.findCurrentStatus.clone(true); service.soapAddress.value = controlPanel.findCurrentStatusWSDL.rawValue; var serviceCall = service.execute(0);

- The thing you need to know about the dropdown is that to get the current selected value you have to do a little more work. To get the current value you need to check the fa.event.newText then look up the bound value:

selectedValue     = this.boundItem(xfa.event.newText);

Avatar

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
friendlyPerson
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
friendlyPerson
Level 1

17-02-2016

I am using Adobe Experience Manager - Forms Version 6.1.0.20150517.1.919161 Designer.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

17-02-2016

What AEM version are you using. Are you using Touch UI or classic?