Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Save textfield information added to section of form that can be hidden

Avatar

Level 9

I have a table wrapped in a subform that can be hidden by unchecking a check box. Each of the table cells have a textfield added with no caption and have the Rich Text option turned on. I want the end user to be able to add text into these table textfields, hide the table, and save the form without losing the text they added to the table textfields. Currently hiding the table clears everything that was added. This is the script that the actions I added created.

//+ GENERATED - DO NOT EDIT (ID:A1B267A9-DA1B-4024-9C78-A7F93B3AE7D6 CRC:3540598859)

//+ Type: Action

//+ Result1: RemoveInstance("$Node2","currentindex","")

//+ Node2: FRM-ENG-06Rev[0].Subform2_MiddleSection[0].GDT-Listbox[0]

//+ Node1: FRM-ENG-06Rev[0].Subform2_MiddleSection[0].Checkbox[0].CheckBox3[0]

//+ Condition1: CheckBox("$Node1","unchecked")

//+ ActionName: CheckBox3.change

if

(this.rawValue == "0") {

this.resolveNode('Subform2_MiddleSection._GDT-Listbox').removeInstance(this.parent.index);

if (xfa.host.version < 8) {

xfa.form.recalculate(1);

}

}

//-

//+ GENERATED - DO NOT EDIT (ID:9174C15E-EB9E-4ABA-AF9A-937900C5C071 CRC:3118237327)

//+ Type: Action

//+ Result1: AddInstance("$Node2")

//+ Or: 1

//+ Node2: FRM-ENG-06Rev[0].Subform2_MiddleSection[0].GDT-Listbox[0]

//+ Node1: FRM-ENG-06Rev[0].Subform2_MiddleSection[0].Checkbox[0].CheckBox3[0]

//+ Condition1: CheckBox("$Node1","checked")

//+ ActionName: CheckBox3.change

if

(this.rawValue == "1") {

this.resolveNode('Subform2_MiddleSection._GDT-Listbox').addInstance(1);

if (xfa.host.version < 8) {

xfa.form.recalculate(1);

}

}

//-

1 Accepted Solution

Avatar

Correct answer by
Level 9

That worked. Thank you so much for your help with this!

-Don

View solution in original post

4 Replies

Avatar

Level 10

Hi,

I would delete that Result and create a new Result in the Action Builder. At the bottom of the list is an option to Show/Hide objects:

Parallels Desktop1.png

That would be better/safer than editting the auto-generated script.

Hope that helps,

Niall

Avatar

Level 9

Okay - I see what you mean. I will try that.

Thanks,

-Don

Avatar

Level 10

hi Don,

The action your originally selected was for add/remove instance. This was deleting the original row, not hiding it.

Good luck,

Niall

Avatar

Correct answer by
Level 9

That worked. Thank you so much for your help with this!

-Don