cancel
Showing results for 
Search instead for 
Did you mean: 

Populate drop down list in Interactive Adobe form

Former Member
0 Kudos

I'm trying to create a offline interactive Adobe form scenario for customer orders.

In this form, I need to provide a drop-down list field where the user can select the customer. Based on the customer selected, I need to populate customer address data e.g. name, address, phone no etc in this form.

I'm using pure ABAP only to generate this form.

I've following questions:

1. How do I populate the drop down list for customer field?

2. How do I set the name and address fields with values when user selects a customer from the drop down list?

I'm not very familiar with Java script so you will have to give me the code that I can add to the form to make this happen.

Thanks in advance for your help.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Could you please provide me the entire code on how to get the dropdown list.I pls request you to provide me the solution at the earliest.I need to deliver ISR form please.

amolgupta
Active Contributor
0 Kudos

hi,

to populate the dropdown list you can do it...

1). manually or

2). by code

1). <b>manually</b> go to interactive form->edit

go to Object tab->field tab ->

you must see something like

List Items :

Text + x

click on the green + sign...

it promps you to type. type in the value press enter... and so on...

2) <b>by Code...</b>

//set up contents of a drop down list dynamically...

IWDAttributeInfo countryInfo = wdContext.nodeTravelData().getNodeInfo().

getAttributeInfo().getAttribute("DestinationCountry");

ISimpleTypeModifiable countryType =

countryInfo.getModifiableSimpleType();

IModifiableSimpleValueSet countryValueSet =

countryType.getSVServices().getModifiableSimpleValueSet();

countryValueSet.put("1","Germany");

countryValueSet.put("2","UK");

This will work....

regards,

-amol gupta

Former Member
0 Kudos

Thanks a lot amol.

I am yet to try this code.But i have no idea where i need to write this code.Supposing I need a dropdownlist of company code what should be the code.I which event do i need to write the code.There are number of events in the editor.Should i use any badi apart from this to get the dropdown list

amolgupta
Active Contributor
0 Kudos

hi Chakram,

i work in Dynpro(Java).

this code is written in wdDoInit() method.

PLUS you have to create simple types for it.

regards.

-amol

Former Member
0 Kudos

can you please tell me how did you resolve your first issue of getting the customer numbers in the drop down list in ISR

Former Member
0 Kudos

I was able to resolve the issue#1.

But, I'm not yet able to resolve issue#2 which is as follows:

When I select a customer no in the dropdown list, I would like to set the value for the following fields: Name, street, phone no, city, state, and Zip.

I used the following JavaScript in the "Change" event of the "Customer" dropdown field but it is not working:

var lKey1= this.rawValue;

ZZ_NAME1.clearItems();

var loNodes = xfa.record.CUSTOMERS.nodes;

var loNodesRow;

lLength = loNodes.length;

for (var i = 0; i < lLength; i++) {

loNodesRow=loNodes.item(i).DATA.nodes;

if (loNodesRow.item(0).value==lKey1)

ZZ_NAME1.rawValue=loNodesRow.item(1).value;

}

Former Member
0 Kudos

I've resolved all issues.

Former Member
0 Kudos

please do update, how you were able to resolve the second issue.

Former Member
0 Kudos

When I selected a new value from the "customer no" drop down list, I wanted to automatically change the value of the "Name1" field.

I did this by triggering the "Initialize" event of the "Name1" field from the "Change" event of the "Customer no" field. In the "Initialize" event of the "Name1" field I wrote a script that would take the value from the customer no field and do a look up for Name1 in the internal table that I passed to the form.

Please assign points if you find this tip useful.

Former Member
0 Kudos

Please detail how you resolved the issue 1 :).

- anto.

Former Member
0 Kudos

Hi Atul,

Could you please explain us how did you achieve this in detail (on How did you populate in dropdown list).

Former Member
0 Kudos

Here is how I did it.....

1. You need to pass the list of values to be displayed in drop-down in a internal table.

2. Now you write a javascript code in the "Initialize" event of the field to loop at the internal table values and use the following command to populate the drop down list:

this.addItem(<data from internal table>).

Please assign point if you find this useful.

Former Member
0 Kudos

Hi Atul,

Please explain on the approach you made.

Does the internal table have the key-text pair values?

Please specify exactly the script you wrote.

If the internal table contain only a text. where you able to fetch the selected value for further processing.

for getting points, you may post the answer to the other posted by me regarding the drop downs. As this is a thread opened by you, we wont be able to grant the points :(.

Thanks and Regards,

Anto.

Former Member
0 Kudos

Dear Mr Antony,

I am getting a script error upon launching the form in the portal.Could you suggest me the cause for the problem.

Message was edited by:

chakram govindarajan

amolgupta
Active Contributor
0 Kudos

hi chakram,

the problem you are quoting, i also faced the same(lloks like...)

TRY THIS:-

check...

interactive form->properties->mode

now here mode should be = updateDataInPdf*

<b>when u want to generate the form u use mode="updateDataInPdf*"

(i.e. u create the pdf online using interactive form UI element)

when u upload pdf and navigate to the page containing Interactive for UI element

u use mode="usePdf"</b>

hope this helps.

regards,

-amol gupta

Former Member
0 Kudos

Hi Chakram,

Check if you are getting any script error on clicking the pdf preview button, if yes try to resolve them and then check in portal.

If you are getting the erros in the portal side only, please mention what is the error that you are getting.

- anto.

Former Member
0 Kudos

Hi,

In WebDynpro I could able to populate values in Dropdown list. Thanks for your tips.

Can you please guide me how to populate values in the interactive adobe form dropdown list.And also is it possible If i select any value from the list,and populate other fields based on this value in interactive form?.

thanks,

John.

Former Member
0 Kudos

I'm using the following code to pupulate the drop down list in the form.

But, in the report pallet I get the error message "Invalid node type: tags".

Any idea what is wrong with this code?

When I generate the form, it says "message limit exceeded".

becasue there are too many errors of the above type.

var loNodes = xfa.record.CUSTOMERS.nodes;

var loNodesRow;

lLength = loNodes.length;

this.clearItems();

for (var i = 0; i < lLength; i++) {

loNodesRow=loNodes.item(i).DATA.nodes;

this.addItem(loNodesRow.item(0).value);

}