Expand my Community achievements bar.

AEM 6.5 Designer not displaying ImageField

Avatar

Level 2

Hi.  Here is my scenario.  I have a couple of ImageFields that point to different images that are watermarks and they both are bound to the same data binding element.  Now using JavaScript in designer....i would like to display one or the other, (possibly more) depending on value of the bound field.  ie:  If element is 'A' then use imageField1, or if 'B' use imageField2, etc.    When I add the binding, and JavaScript below.....it does not seem to work at all when I preview.

Any help is appreciated.

javascript:

Document_Instance.Page1.ImageField1::initialize - (JavaScript, client)
var watermark_name = ImageField1.rawValue;
if (watermark_name == 'draft') {
this.access="readOnly";
this.presence="visible";
}

0 Replies