Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Image Field - Runtime href Setting issue

Avatar

Level 10

I am trying this simple code to set a href of an Image/ImageField object which is not working.

Image1.value.image.href = "http://www.adobe.com/ubi/globalnav/include/adobe-lq.png";

Am I missing something??

Nith

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The only way you will get th ephotos to update after the form has been rendered is by delivering the photo contents in a web service call. You can have the image contents base64 encoded and put into a string in the WS call (as output). Then you can bind that output string to th eimage field and it will work. You cannot have Acrobat/Reader retrieve images once the form has been rendered. This has been disabled for security reasons starting in version 8 I believe.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

On which event are you exececuting that code? For security reasons once the form has been rendered you cannot change the image URL.

Paul

Avatar

Level 10

Hi Paul,

I tried this logic on exit event of a drop-down list.

My requirement is to have a dynamic table on which each column will have an employee drop-down & a photo (image field).

On choosing the employee name, the photo must appear on the image field. The form will then be saved and send to a manager for approval.

The photos of the employees are already saved in a file location.

Is this possible?

Thanks,

Nith

Avatar

Correct answer by
Former Community Member

The only way you will get th ephotos to update after the form has been rendered is by delivering the photo contents in a web service call. You can have the image contents base64 encoded and put into a string in the WS call (as output). Then you can bind that output string to th eimage field and it will work. You cannot have Acrobat/Reader retrieve images once the form has been rendered. This has been disabled for security reasons starting in version 8 I believe.

Paul

Avatar

Level 10

You are great Mr.Paul.

Many more thanks for this idea!

Nith

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----