Expand my Community achievements bar.

optional fields

Avatar

Former Community Member
Hi



I am using different xml files to populate pdf documents (using xsd). Does anyone know how I can (if possible) hide a standard field if there is no xml value for it? E.g. not show "Name" in the pdf if there is no name in the xml file?



Thankful for any help

Thomas
5 Replies

Avatar

Former Community Member
Hi thomas ,



Its possible using the property hidden . When u initialize the form object , just check if the value is null and set its property to hidden. If U had set the form content to "Flowed" then all the contents gets align accordingly.



Thanks,

SrPrabhu

Avatar

Former Community Member
node.presence = "hidden"



Its in javascript.



this is for ur reference.



Thanks

SRPrabhu

Avatar

Former Community Member
Thanks for your answer



When I choose hidden object, the value is not shown on the pdf - allthough the xml file has a proper element value

Avatar

Former Community Member
Hi Thomas,



I cudn't get exactly your problem. Anyway hav u checked if the form object's rawvalue is null ? I mean , only if the value is null U hav to set its property to hidden. Follow the sample code..



if(this.rawValue == null){

this.presence = "hidden"

}



Write this code in the initialize event of that form object.



Thanks ,

SrPrabhu

Avatar

Former Community Member
Hi



If i write this code the object (which is a reference number) gets the value "hidden" on the pdf. Instead the whole object should be hidden. If the reference object has an xml value of e.g. 12345 than the reference object should be shown on the pdf with this value. Hope this clarifies.



Thomas