These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Populating an image field

rnavarro
Registered: Oct 4 2007
Posts: 2

In Designer, How can i get a image field to populate with a certain image based on a value picked in a dropdown list field?

My Product Information:
LiveCycle Designer, Windows
sconforms
Expert
Registered: Jul 10 2007
Posts: 92
In version of Acrobat/Reader prior to 8.1 (possibly prior to 8.0), you could've built a form with a drop down list that had a Change event where you would get the URL associated with the selected item and set it on an image field and the image field would automatically load the new image. This is no longer the case with Acrobat/Reader 8.1, likely due to security reasons. The only way to load an image into an image field is to click on it in Acrobat/Reader and select a file or specify a URL.

Because of this, you really only have one workaround which is to create a series of image fields or static images (the "image" object in the Object Library palette) and hide them all. Then, in the drop down list's Change event, check the value of the new selected item using the xfa.event.newText property and, depending on the item that was picked, make the correct image visible by setting its presence property to "visible".

If your drop down list has item text and value data, xfa.event.newText will contain the item text data for the item that was selected. You can get the associated item value data by using the drop down list's boundItem method:

this.boundItem(xfa.event.newText)

This will return the item value data pertaining to the item text data.

Stefan Cameron obtained his bachelor's degree with Honors in Computer Science at the University of Ottawa and is a Computer Scientist working on Adobe's LiveCycle server products, in particular on LiveCycle Designer ES for the past 5 years.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Thanks Stefan. I was afraid that this was the answer. But it's good to know.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script