Importing XML & then displaying it within a multi-row table

292 views
Skip to first unread message

rxa

unread,
Nov 26, 2013, 10:44:41 AM11/26/13
to live...@googlegroups.com
Hello

I have managed to import an XML file to populate the first row of the table - using xfa.host.importData() on a button.
(I need the user to click, rather than it automatically populate).

Now, I need to do loads of other things based on the imported data.

For example, to check to see if there is content in a particular cell and add another row with data included.

[pseudo code]
if (table.row1.id != ""){
    //add another row
}

My question is "Where do I put this code?" 

I tried putting it in 'change' but that only seems to work when I click on the actual box itself.

Any help would be very much appreciated.

Thanks




siteData.xml
siteSummary.pdf

Bastian Landherr

unread,
Nov 26, 2013, 1:37:59 PM11/26/13
to live...@googlegroups.com

Hi,

Can't you use a data binding on the row? You Do not need to do it your self.

Greetings

rxa

unread,
Nov 28, 2013, 4:35:06 AM11/28/13
to live...@googlegroups.com
Hi,
Thank you for replying. Does data binding allow me to do things like add new pages based on the amount of rows? The first page that I am building is a summary sheet and there will be information added from the xml on all of the other pages.
Thanks

Renjith

unread,
Nov 28, 2013, 5:36:51 AM11/28/13
to live...@googlegroups.com
Of course yes it will allow you to add new pages. Provided the layout should be "flowed".
Regards 
Renjith

Thanks and regards
Renjith Vijayan
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To post to this group, send email to live...@googlegroups.com.
Visit this group at http://groups.google.com/group/livecycle.
For more options, visit https://groups.google.com/groups/opt_out.

rxa

unread,
Nov 28, 2013, 6:12:46 AM11/28/13
to live...@googlegroups.com
Hi,
Thank you.
So, where do I put the code to count the rows? (i.e. if xml.childnodes = 4, add 4 pages from master 2 after current page and put data on them from the xml).? (My first page is a summary sheet).
Sorry for a stupid question - i understand the basics of programming from action script, but can't work out in Livecycle where to put the code! I tried putting it after the import data code on the button, but nothing works after that line. 

Renjith

unread,
Nov 28, 2013, 10:26:39 AM11/28/13
to live...@googlegroups.com
Can you post the file so that I can take a look at it.


Thanks and regards
Renjith Vijayan

rxa

unread,
Dec 3, 2013, 6:37:20 AM12/3/13
to live...@googlegroups.com
Hi
I have attached some files to the first post. Please can you have a look at those.
Thanks for this

renjith vijayan

unread,
Dec 3, 2013, 9:36:58 PM12/3/13
to live...@googlegroups.com
Hi Ross,
 
You dont have to write a code for adding new pages and populate the data in the XML. In Adobe LiveCycle we do the following steps to attain this:
 
steps:
1) Create a table.
2) Create the rows with required columns.
3) Map the fields to get data to the field.
 
In case of repeating rows(Your case) ie: XML having repeating nodes.
3.1) Map your row to the first node of the repeating node of xml.
eg:
Consider the following : xml 
 
<Sample>
<Row >
 <ID>1</ID>
 <Site>London</Site>
 <BldNo>123</BldNo>
 <BldName>Library</BldName>
</Row>
<Row>
 <ID>1</ID>
 <Site>London</Site>
 <BldNo>123</BldNo>
 <BldName>Library</BldName>
</Row> 
</Sample>
 
Map to the Row Level: Binding will be...
 
Binding : $.data.Sample.Row
 
Select "Repeat for each data item " check box under object panel>Binding(this is where you do binding).
select the subform ("Row" in your sample ). Select Object panel> Subform tab>Content. Change content value to Flow.
 
You can search for Adobe LC samples forms with repeating rows.
 
Hope this helps...
 
 
regards
Renjith
 
 
 
 
 
Renjith Vijayan 

rxa

unread,
Dec 10, 2013, 6:38:44 AM12/10/13
to live...@googlegroups.com
Excellent - thanks so much for this - it helped massively!
Reply all
Reply to author
Forward
0 new messages