Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

An Error when try using image field

Avatar

Level 2

Hii all

i tried to use image field in form and set the url of this image field but i have the following error dose any one face such a problem....???

script failed (language is formcalc; context is xfa[0].form[0].ReportData[0].#subform[5].imageField[0])
script=this .value.image.href=xfa.resolveNode(this.value.image.href).value;
Error:An attempt was made to reference property 'Value' of non-object in SOM expression
xfa.resolveNode("
http://amercet:51500/webdynpro/resource/xccre.cic.com/contract_print/Components/com.cic.xccre.enquir...

2 Replies

Avatar

Former Community Member

There are two big issues:

1. There are errors in your script and that is why you are getting the message.

2. Even if you fix the errors it still will not work. Acrobat/Reader security will stop you from dynamically setting an image field. You will have to have the user select the image if you want to change the image on the fly.

Paul

Avatar

Level 2

thank you very much

but the issue is when I try to  test it on sample form it worked fine but with forms with complex content and many controls it return that error

I found a temporary solution by change the code wrote in the script but  also the same it work for sample and doesn't for the complex form

P.S : complex form mean =form with many object such design and fields ....

I was use this Code in initialize event for the image field
this.value.image.href = xfa.resolveNode(this.value.image.href).value; 

So i replace it with this

this.value.image.href = xfa.record.Images.URL; 

and for the security issue

i set the ready event to read only

this.access = "readOnly

I hope you get the problem Clearly.....