Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

subform presence hidden until event triggers

Avatar

Former Community Member

On my main form I have a field users must select from a droplist.  Depending on what they select I have different subforms with questions that become present.  The main form triggers the event from a "On Exit" so my problem comes into play once the user has completed and saved this form and they reopen it the completed subform is not visible.  I understand its because no "exit" took place upon opening the saved form, but how should I handle?

9 Replies

Avatar

Level 8

Put your code in the initialize or docReady event of your object.

Kyle

Avatar

Former Community Member

But when I do that my subform is not visible when I select from the item from droplist that should make my subform visible.

Avatar

Level 8

Is the code in the Exit and docReady events?

Kyle

Avatar

Level 8

Are you using the Action Builder? How did you get it to work on Exit before?

Kyle

Avatar

Former Community Member

I am using javascript (below) which works perfectly until the form is saved with data and reopened not displaying those data fields because I am not “re-triggering” because there is no exist taking place upon just opening a completed form

Button1.Parent.STPA.Note_Type::exit - (JavaScript, client)

if (this.rawValue=="Tax Anticipation")

Sub_PropertyTax.presence="visible"

else

Sub_PropertyTax.presence="invisible";

if (this.rawValue=="Tax Anticipation")

Tax_Set_Aside.presence="visible"

else

Tax_Set_Aside.presence="invisible";

if (this.rawValue=="Revenue Anticipation")

Sub_Revenue.presence="visible"

else

Sub_Revenue.presence="invisible";

Avatar

Level 8

Hmm, I'd have to see the form. If that code is in the exit AND docReady event of Button1.Parent.STPA.Note_Type and it works on exit then it should work on form startup.

If you want, you can post it here so I can have a look.

Kyle

Avatar

Former Community Member

I have it in the exit AND docReady event of Button1.Parent.STPA.Note_Type however when the completed form gets opened the subform remains set to invisible

Avatar

Former Community Member

My mistake, I had my Note_Type field set to invisible. Everything is working now and I couldn’t have done it without your help thank you.