Expand my Community achievements bar.

instance value

Avatar

Level 1

I am trying to understand how to create an instance of a sub form.  That I am able to do the problem is that I need to click the approved denied drop down on page 1 that takes information from Reviewer value and put it in page 2 text area that is the top right box.  The first box is a date that is automatically entered when it is initiated.  If the engineering approved denied is click then I want to initiate the sub form and enter another set of items.  The problem I am having is figuring out how to get the instance array of data to enter each data from the list on the form.  If any one can help with code snips would be great this is what I have and what I want is to assign the [*] to be the next instance value because not every approved/denied will occur. 


if($.boundItem(xfa.event.newText) == "Denied") {

this.resolveNode('Page2._reviewDept').addInstance(1);

if (xfa.host.version < 8) {

  xfa.form.recalculate(1);

}

this.resolveNodes("form1.Page2.reviewDept[*].dept").rawValue = "Comm. Bld/Fire/Mech/Cab Departments";

this.resolveNodes("form1.Page2.reviewDept[*].enterdDate").rawValue = month+"/"+day+"/"+year+"    "+hours+":"+minutes;

this.resolveNodes("form1.Page2.reviewDept[*].planReviewer").rawValue = this.resolveNode("comBldReviewer").rawValue;

form1.Page1.Table1.Row3.comBldDateApp.rawValue=month+"/"+day+"/"+year+"    "+hours+":"+minutes;

  xfa.host.currentPage =1;

}

else if($.boundItem(xfa.event.newText) == "Approved"){

form1.Page1.Table1.Row3.comBldDateApp.rawValue=month+"/"+day+"/"+year+"    "+hours+":"+minutes;

this.resolveNode("form1.Page2.reviewDept[*].deptComments").rawValue = "No Comments.";

2014-05-23 Form.png

2014-05-23reviewblock.png

3 Replies

Avatar

Level 10

Hi,

the resolveNodes() method returns a nodeList that don't has a property rawValue.

To understand the difference to resoveNode() you should read this article first.

resolveNode vs. resolveNodes

Avatar

Level 1

radzmar,

thanks for the response.  I figured out that the resolve Node method is needed, what I am trying to figure out is the [*] to be assigned a value every time a new instance is created, so that the comments form can be created in any arrangement.  I can change the * to 0, 1, 2, 3, 4, 5 for each instance and as long as I start with the first one Zoning and go down the list it will create the list.  It is when the list is not created in order when I get errors.  This has been driving me crazy for the past 3 days.  example:

this.resolveNode("form1.Page2.reviewDept[0].dept").rawValue

this.resolveNodes("form1.Page2.reviewDept[1].dept").rawValue

this.resolveNodes("form1.Page2.reviewDept[2].dept").rawValue


I am guessing that I need a variable for each of the instance and somehow count the instances created and put into this variable and replace each number.  I just cannot figure it out.  I am new to Javascript.