Expand my Community achievements bar.

SOLVED

Making field visible only works in initial row, not added rows

Avatar

Former Community Member

I have a dynamic form to which I can add rows. It is 3 columns, with the first being a DDL which populates the second column DDL. The 3rd column is a hidden field that shows once a choice in the second DDL has been made. It works fine in the initial row, but it will not become visible in any added rows.

This is my code for the second DDL:

if

(this.rawValue != 1)

{

form1.Page1.OrderSection.OrderItems.Condition.presence

= "visible";

}

else

{

form1.Page1.OrderSection.OrderItems.Condition.presence

= "hidden";

}

Does it need to be set up as some kind of loop maybe? I am sure it has something to do with my path being a dynamic path name. Not really sure at this point what to look at to make it work. I'm not sure how or if I can attach my file here. If someone can tell me how to attach it, or I can e-mail it to someone for help.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Each object must have a unique name. To accomplish the repeating subform gets an occurance number so assuming the OrderItems is the repeating subform the expression to get at the object will be OrderItems[occuranceNumber].Condition

So you need to modify your code to get to the right instance:

"visible";

xfa.resolveNode("form1.Page1.OrderSection.OrderItems[" + this.parent.index + "]").Condition.presence =

Assuming that you are executing this code on an object inside of the subform. The this.parent.index will give you the index number of the subform that you are on.

Hope that helps

Paul

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Each object must have a unique name. To accomplish the repeating subform gets an occurance number so assuming the OrderItems is the repeating subform the expression to get at the object will be OrderItems[occuranceNumber].Condition

So you need to modify your code to get to the right instance:

"visible";

xfa.resolveNode("form1.Page1.OrderSection.OrderItems[" + this.parent.index + "]").Condition.presence =

Assuming that you are executing this code on an object inside of the subform. The this.parent.index will give you the index number of the subform that you are on.

Hope that helps

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----