Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Trouble with Exit event script

Avatar

Level 10

Actually I'm not sure if I'm having trouble with the Exit event or if there's something wrong with my script syntax...On the exit event of a field I'm checking to see if the field is empty or not and checking a flag I have set up.

The first If statement works - If I enter a value in the field everything goes according to plan. If I then delete the value in the field nothing happens.

//if field has a value hide subSection04

if (!(this.rawValue == null || this.rawValue.length == 0))

{

     subSections.subSection04.presence = "hidden";

}

//if field is empty and flag equals true show subSection04

else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == true))

{

     subSections.subSection04.presence = "visible";

}

//if field is empty and flag equals false hide subSection04

else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == false))

{

     subSections.subSection04.presence = "hidden";

}

There are a couple radio button groups that also control this behaviour, they all inter-relate. So I also tried firing the Click event of a radiobutton group (that looks at the value of this field) on exiting this field but that didn't seem to work.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Jono,

Your expression subFlags.Commercial.rawValue == true is comparing a String datatype with a boolean datatype.

Modify the expression as  subFlags.Commercial.rawValue == "true"

I hope this should work for you.

You code should look like

//if field has a value hide subSection04
if (!(this.rawValue == null || this.rawValue.length == 0))
{
     subSections.subSection04.presence = "hidden";
}

//if field is empty and flag equals true show subSection04
else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == "true"))
{
     subSections.subSection04.presence = "visible";
}

//if field is empty and flag equals false hide subSection04
else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == "false"))
{
     subSections.subSection04.presence = "hidden";
}

Nith

View solution in original post

27 Replies

Avatar

Level 8

Thanks a lot Bruce... I am always learning from your sample PDF forms and code ....

Just wondering if you saw this issue here:

Using multiple fragments causes Adobe LC workbench/designer to crash

The problem is slowing down development work to a great extent.... I suspect it is because of using many nested fragments...

Tarek

Avatar

Level 10

Hi Tarek,

I glad I've been able to help, but not sure I can help with your problem of crashes.  I have had periods of forms crashing but has usually been one particular form, which we re-built.  Have you tried Adobe Experience Manager - Forms ... the new Designer?

Bruce

Avatar

Level 8

The new AEM Designer?! Are you referring to this one?

1469214_pastedImage_0.png

I will give it a try, but I am concerned it will cause issues to existing forms ... I need to set it up on a sandbox environment to test it before using in the actual environment.

So you think the new designer will solve the problem?

Tarek

Avatar

Level 10

Hi Tarek,

I wouldn't too much, as AEM Forms looks just the same as LC Designer, but at least that means there doesn't seem to be any compatibility problems.  I guess you have tried editing the form on other machines?

Bruce

Avatar

Level 8

Thank you BR001​ for you reply.

The conditions that will more likely cause the errors to trigger have been identified and acknowledged b....

It is clearly a fault in the product, and I am wondering if this is acknowledged by Adobe.

Tarek

Avatar

Level 10

Hi Tarek,

I don't have any contact with Adobe product teams, so don't know if it is a known problem.

There is the Feature Request/Bug Report Form , but LiveCycle is no longer an option.

I do have a form with 120 fragments, with about 10 of them nested, and never had any problems.

Bruce

Avatar

Level 8

Hi Bruce,

Good to know that you are not facing the same problems I reported.

I am using this version of Adobe LiveCycle Designer, which version you are using? Did you follow the same steps I mentioned to reproduce the problem?

1472555_pastedImage_0.png

Tarek