Skip navigation
corecomps
Currently Being Moderated

Repeatable subform elements and incoming XML with missing fields?

Jul 26, 2012 11:49 AM

I am by no means an expert but I have a condition where a form will bind to an xml repeatable element called transactions with elements under each transaction as seen below.

 

I'm having trouble with a situation where the including XML is missing an OPTIONAL element for one of the transctions.  While I would expect the form to show this:

 

7/27/2011Deposit5000
7/28/2011Check
7/29/2011Transfer1000

 

It's actually showing this:

7/27/2011Deposit5000
7/28/2011Check1000
7/29/2011Transfer

So it's basically bubbling up the Credit of 1000 to the 2nd repeatable element rather than leaving it blank and correctly adding it to the 3rd repeatable element.  I'm sure it's how I have the form setup or how I'm setting up the XML binding but can someone assist?  I get around this by forcing the user to always include a blank repeatable element but it's optional in the schema so it's not a good thing to force on my callers.

 

Thank you so much for the help!

 

 

- <Transactions>

- <Transaction>
<PostDate>2011-07-27</PostDate>
<Description>Deposit</Description>
<Credit>5000.00</Credit>

</Transaction>

- <Transaction>
<PostDate>2011-07-28</PostDate>
<Description>Check</Description>

</Transaction>

- <Transaction>

<PostDate>2011-07-29</PostDate>

<Description>Transfer</Description>

<Credit>1000.00</Credit>

</Transaction>

</Transactions>

 


 


 
Replies
  • Currently Being Moderated
    Jul 26, 2012 3:13 PM   in reply to corecomps

    Hi, Make sure you have have the row or repeating subform (whatever is the parent of the three fields) bound to the Transaction element, it should have a binding expression that looks like $.Transaction[*] then the three fields will have relative binding expression that look like $.PostDate and will keep them all grouped on the same row (or subform).  If the individual fields have binding expressions like $.Transaction[*].PostDate then you will get the problem you discribe. Regards. Bruce

    
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 28, 2012 2:03 PM   in reply to corecomps

    Hi, I haven't been able to think of one, your original binding expression might be useful in a script (with the resolveNode method) but probably not for direct binding. Regards Bruce

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points