Expand my Community achievements bar.

how to call xml records based on drop-down list

Avatar

Level 2

i newbie to javascript. I bound xml records to a drop-down list.

Iam getting values in print preview mode.

I want to call corresponding records in xml file into other text boxes whenever user selects a item in drop- down box .

please help me

13 Replies

Avatar

Level 9

Hi Prasad,

Stefan has very good article on Dynamic properties which may help you.

Thanks,

Bibhu.

Avatar

Level 2

Iam facing the following problems.

1) I saw stepan's article .still little bit confusing me. here project drop-down list items are populating from xml file as i bound it as shown. but if user chooses an item corresponding item in PGSL_X0029_Project_x0020_code  has to enter in Ref.no. text field.

2) Here in drop-down-initialize event iam confusing to enter data fields.

    Dataconnection is as per my data it is "dataconnecion" or "FILE_CODE2"

hidden value column of the dropdown is it name of the drop down?

display text ?xml_problem.JPG

Avatar

Level 9

Hi Prasad,

I am a bit confused here. What's your requirement? Do you want that when a user selects something in the dropdown(which is binded to an xml source) the selected value would be displayed in the Textbox ?

Thanks,

Bibhu.

Avatar

Level 2

Hi naik,

Not the selected value ,  when a user selects something in the dropdown(which is binded to an xml source) i want to display another  tag value with the same index of selected in the drop-down list  in the same xml group.

with regards

prasad

Avatar

Level 9

Hi Prasad,

Here is a link to a sample form. https://acrobat.com/#d=sq8eTsCagvHtel0w849-4g . It contains preloaded xml. You can extract the xml by exporting the form data first without doing any earlier form operations.

I have used 3 fields ItemNumber is a dropdown based upon which item price and Item Title are updated. I have also use two hidden dropdowns to facilitate the selections as well as updation. You can see the how the bindings are used in both the hidden and visible field. You can also see the change event of the hidden fields are called in the visible fields.

Thanks,

Bibhu.

Avatar

Level 2

1)I downloaded and opened the pdf in livecycle designer . it is showing test.xml file is not loaded. .i couldn't find any extract method here...

secondly

2)  i opened in adobe acrobat pro and then exported  form data  to xml . is that you are saying. i did the same . but no result

iam dumb in this matter . please help me.

Avatar

Level 9

Hi Prasad,

I was saying to export the value in the Acrobat just to look at the XML file. After Clicking the export data save the xml as Text.xml. As the file is not present in your system it will show error when you open the file in the Designer. Create a folder and place the form and the XML file in the same folder. In order to see this in preview mode do the follwing.

Open the form in designer. Click on : File -> Form Properties -> Preview -> You can see a box named at Data File. Next to the box there is a browe icon. Click on the that and specify the XML file that you have saved.

If still these things do not work for you. Click on the dataview. Right Click on DataConnection -> Delete DataConnection -> UnCheck the checkbox which says Delete binding for the dataconnection. Then Click on delete.

After that create a fresh dataconnection. Mention it as Sample XML and specify the XML that you have said.

I hope I am clear on this.

Thanks,

Bibhu.

Avatar

Level 2

Hi Naik,

This is the one iam looking for. I did it in javascript but not working. please check

I have a Dropdownlist  named Senders_Name .I binded this one to Senders_name html tag I wan to get  the Designation  from xml records into Designation textbox

dataroot.Transmittal_pdf.Table6.Row1.Senders_Name::change - (JavaScript, client)

Designation

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

DropDownList1.execEvent("change");

xfa.host.messageBox(Designation.rawValue);

senders_name dropdown1 binding optins

Binding items = $record.Senders_List[*].Senders_Name

Item text = Senders_Name

item value= Designation

hidden Dropdown1

dataroot.Transmittal_pdf.DropDownList1::change - (JavaScript, client)

Designation

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

Hidden dropdown1 binding optins

Binding items = $record.Senders_List[*].Senders_Name

Item text = $

item value= Designation

Avatar

Level 9

Hi Prasad,

It's difficult to tell without seeing the form. Please share your form through acrobat.com.

Thanks,

Bibhu.

Avatar

Level 2

please check this link https://acrobat.com/#w=ynZ8bq45ya7FjmM5qEU*Rg .

If i choose senders_name  i want to update Designation  text field.I am newbie started learning javascript and usage of livecycle designer

Avatar

Level 9

Hi Prasad,

I am not able to download the form. Have you published the form? If not see the options to publish it.

Thanks,

Bibhu.

Avatar

Level 2

check thease links. i published it .

http://https://acrobat.com/#d=PRcdfmrHG3d9oYzU2wQ1mA  tds file link

https://acrobat.com/#d=VEQ*ZeuzWlGmp0Dmxdk4Ag xml file link

i have another doubts

. I mapped my xml file to a excel file. If i add new records is it automatically updates my xml file

. Is it need to supply my xml+excel files to distribute the users.

Avatar

Level 2

i got the solution for my previous problem

instead of

Designation.rawVal

ue

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

i changed the line like this it worked for me

dataroot.Transmittal_pdf.Table6.Row2.Designation.rawValue

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

This is ok.

I have other problem.

I have project_type and contract_type drop down boxes . values in the drop_down boxes added manually in the boxes not by data binding ie;  two fixed values.But if  user selects from thease two boxes i want to populate values from xml data FILE_CODE group corresponding project title into the project drop down box.how to get the data if user selection drop down lists not  bound to the data.