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.

Change Floating Field value without layout:ready

Avatar

Level 2

I am attempting to change the rawValue of a Floating Field (ForPartnershipsTXT1) based on a click event of radio buttons (PartnershipRADIO). I originally had a layout:ready event for the Floating Field which would check the status of the radio buttons, which worked. See below:

OA_PG2.TnC.ForPartnershipsTXT1::ready:layout - (JavaScript, client)

if (INTERNAL_ONLY.PartnershipRADIO == 1){

    this.rawValue = "";

    }else{

    this.rawValue = "for Partnerships";

    }

I have moved the if/then statment to the radio button script to avoid the layout:ready event which slowed down my form. Unfortunatly nothing happens. See below:

INTERNAL_ONLY.PartnershipRADIO::click - (JavaScript, client)

if (PartnershipRADIO.rawValue == 1){

     OA_PG2.TnC.ForPartnershipsTXT1.rawValue = "";

     } else {

     OA_PG2.TnC.ForPartnershipsTXT1.rawValue = "for Partnerships";

     }

What am I doing wrong?

2 Replies

Avatar

Level 10

You need to add the line: xfa.layout.relayout();

to your script to force the floating field to update.

Message was edited by: Jono Moore - forgot the brackets in the script.

Avatar

Level 2

Thank you. I implemented the recommended line. No luck. Turns out there was some syntax issues that seemed to resolve itself while I was adding the xfa code.

The code worked both with and without the xfa.layout.relayout;