Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Multiple field population bound to xml

Avatar

Level 1

Does anyone know how to populate multiple fields from data binding, most of all of these forms and how to only populate one field of data i am losing the connection when it comes to connecting the second, third, etc fields to the data of the xml? 

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi,

Could you please share the form along with the XML in a separate file @ bibhu69@gmail.com? I guess you have to loop through the nodes. Unless and until I see the form and XMl it's difficult for me to say anything.

Thanks,

Bibhu.

View solution in original post

7 Replies

Avatar

Level 9

Hi,

I guess you are probably doing a sample XML data connection. You can not have more than one DataConnection of XMLs. It can only be the Database connection. How ever if your structure of the XML remains same (data can vary of course) you can do a bit of javascript coding, loop through the nodes and populate the node values depending selections made in the other nodes.

Thanks,

Bibhu.

Avatar

Level 1

Well that is just it, i have only one Data Connection it loaded a 6 column xml, basically when you choose the EMPLOYEEID on change event i need it to populate the 5 other fields

EMPLOYEENAME

JOBTITLE

DEPARTMENTNAME

DEPARTMENTNUMBER

DATEOFEMPLOYMENT

with the script i have i can only make it populate the EMPLOYEENAME and i am guessing because my script on carries to one bound item, i need help knowing how to tell it to change the other 5 too.!!! i have googled and tried a 100+ scripts all only work for the first field.

This is what i have for the one field.

in EMPLOYEEID field on change i have

 

EMPLOYEENAME.rawValue = this.boundItem(xfa.event.newText);   which of course i only binding one field how can i bind all the fields, or i have tried this one which is all manual data fill in, how do i tell the things in ""'s to look at the data connection???? my xml, what am i missing as far as connecting the fields to change on employeeid. 

var EMPLOYEEID = xfa.event.newText;

if (EMPLOYEEID == "0029904");

{

EMPLOYEENAME.rawValue = "ADDILIA ROBBINS";

DEPARTMENTNAME.rawValue = "Department Of Public Safety";

DEPARTMENTNUMBER.rawValue = "130";

JOBTITLE.rawValue = "POLICE RECORDS TECH I";

DATEOFEMPLOYMENT.rawValue = "2013-04-29";

}

The fields are bound to the right columns in the xml but i cant get them to change when i select the primary employeeid.???

HELP PLEASE.

Avatar

Level 1

i dont know how to write that looping through nodes code, yet.

Avatar

Correct answer by
Level 9

Hi,

Could you please share the form along with the XML in a separate file @ bibhu69@gmail.com? I guess you have to loop through the nodes. Unless and until I see the form and XMl it's difficult for me to say anything.

Thanks,

Bibhu.

Avatar

Level 1

here is a snippet, i am trying to figure out where to post it so i can show ou the whole file but basically it goes on like this for 33k lines

here is the form. http://portal.cobbcountyga.gov/images/documents/finance/untitled1.pdf

Basically when you select EMPLOYEEID i need all of the other fields to fill in with the respective info from that employeeid.

I could not load the xml anywhere but here is a snippet, the complete file runs 33k lines.

Avatar

Level 1

Thank you so much for your help, it is invaluable.  The script will work perfectly.  never would have figured that out.  Thanks again.

Avatar

Level 4

I’m struggling with this same situation.  I’m using a snippet from an example I found to explain.  A dropdown list is dynamically populated using the title data node.  There are 4 textfields called Category, Title, Actor and Showtime. Once a title selection is made from the dropdown, I want all 4 fields to populate.  Can someone please provide a script.  I'm using Sample XML Data for a Data Connection and Adobe LC ES4. Thanks!

  - <theatre>

       - <movie>

             <category>Comedy</category>

             <title>Hoodwinked</title>

             <actor>Anne Hathaway</actor>

             <showTime>15:00</showTime>

           </movie>

       - <movie>

                <category>Comedy</category>

                <title>RV</title>

                <actor>Robin Williams</actor>

                <showTime>13:30</showTime>

         </movie>

       - <movie>

                <category>Comedy</category>

                <title>Aladin</title>

                <actor>Robin Williams</actor>

                <showTime>14:05</showTime>

         </movie>

  - </theatre>