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.
SOLVED

"oActionSubform is null..." JavaScript Console Error

Avatar

Level 9

I have the following script on a custom button to dynamically create table rows.

MeetingMinutes.LogoControls.ActionSubformA.ActionItemAddSubform.AddActionRowButton1::click - (JavaScript, client)

var oActionSubformA = MeetingMinutes.LogoControls.resolveNode("ActionSubformA[" + this.parent.parent.index + "]");
  this.resolveNode('ActionSubformA.Table1._Row2').addInstance(1);
     oActionSubformA.Table1.HeaderA.presence = "visible";
      
     if (xfa.host.version < 8) {
      xfa.form.recalculate(1);
     }

I am getting the following JavaScript console error:

oActionSubform is null
3:XFA:MeetingMinutes[0]:LogoControls[0]:ActionSubformA[0]:Table1[0]:Row2[1]:DeleteActionItem[0]:initialize

Any idea what is causing the error?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Maybe a typo.

Everywhere you use the name ActionSubformA but in this script only ActionSubform.

View solution in original post

4 Replies

Avatar

Level 10

Hi,

the error message has nothing to do with the script in the click event of AddActionRowButton1.

There must be another script in the initialize event of the DeleteActionItem button.

Avatar

Level 9

Hi radzmar,

This is the script in the DeleteActionItem initialize event:

MeetingMinutes.LogoControls.ActionSubformA.Table1.Row2.DeleteActionItem::initialize - (JavaScript, client)

var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.parent.index + "]");

if(this.parent.instanceManager.count>0){

      oActionSubform.TopicGroupA.Table1.HeaderA.presence = "visible";

}

Avatar

Correct answer by
Level 10

Maybe a typo.

Everywhere you use the name ActionSubformA but in this script only ActionSubform.

Avatar

Level 9

radzmar,

Thanks for your help. It was a typo. Can't belive I didn't see that. Thanks again!

-Don