Expand my Community achievements bar.

Populate XML data in static form

Avatar

Former Community Member

Trying to determine if LiveCycle Designer ES can be used as a Print Form Generator for us.  Setting up a Sales Quote form which contains data fields that are not always populated, such as a customer's second address line.  I'd like this field to be invisible and collapse when the XML file contains a blank value for it.  Is there a property that will do this?  I've seen this attribute on other products, but have not found it on any of the pallettes.  Thank you in advance for any help.  It is very much appreciated.

4 Replies

Avatar

Former Community Member

If I understand you correctly  if a field has no data you do not want it to show on the page?

If so are you going to leave a blank space where the field was or do you want the form to reflow so that it looks like it was not even part of the form?

Just so you know it is doable but it will involve code ...it is not just a matter of setting a property.

Paul

Avatar

Former Community Member

Yes Paul, you understood my issue correctly.  Sounds like a better route to take would be to create my XML file a little differently.  Maybe I can combine my non-blank data fields into one element and simply place the single element on the form instead of each individual element.  I am new to creating XML files.  Do you know how I would create an element that contains line breaks?  I tried using the CDATA designator and <br /> tags to separate my data, but that simply displayed the <br /> tags as text in my form.

Example:

<companyAddress>

     <![CDATA[company name<br /> 
     address line1 <br />

     address line 2 ]]>

</companyAddress>

Thank you for your response.  I appreciate your help.

Barb

Avatar

Former Community Member

Simply put a carriage return in the data stream and it shodul be interpretted by the product.

<Address>This is line 1

This is line2

I may have line 3</Addres>

Paul

Avatar

Former Community Member

I believe I have resolved my issue.  I have defined a variable named newline

using <cfset newLine=Chr(10) />.

Then the XML data includes this variable:

<SoldToAddress>#so.soldTo.address1# #newline# #so.soldTo.address2#</SoldToAddress>

I will fine tune the assignment so that the newlines are only added when the optional data is non-blank.

Thank you very much for your help.  Have a good day!

Barb