Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Populate Listbox Dynamically from Multiple Instance Text Fields

Avatar

Avatar
Validate 1
Level 1
BGreggs4
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
BGreggs4
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile
BGreggs4
Level 1

01-08-2017

COLLAPSED:

Collasped.png

EXPANDED:

Screenshot.png

Currently in the "Borrower Names" List Box I have my code as (in the ENTER event):

this.clearItems();  

this.rawValue = null;  

 

var nCount = Section2.Table1.instanceManager.count;  

var nCount2 = Section2.Table1.instanceManager.count; 

for (var i=0; i<=nCount; i++) 

     var vFld = xfa.resolveNode("Section2.Table1[" + i + "]"); 

     var vObj = vFld.Guarantor.Row1.GaurantorFirstName.rawValue;  

     this.addItem(vObj);  

}

for (var i=0; i<=nCount2; i++) 

     var vFld2 = xfa.resolveNode("Section2.Table1[" + i + "]"); 

     var vObj2 = vFld2.NonGuarantor.Row1.NonGaurantorFirstName.rawValue;  

     this.addItem(vObj2);  

}

When a new instance is added, the user can either choose Guarantor or Non Guarantor. Both sections have a "First Name" text field. These names need to be added to the listbox under "Borrower Names" under Section 3. Need help correcting the code to make it work. Please let me know if you have any questions! Thanks!! I am only getting "Bob" to show up instead of both "Bob" and "Jane" (referring to example above)

FORM LINK Dropbox - Loan Submission Form.pdf

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

01-08-2017

Hi there,

First, you shouldn't be doing 2 loops for the same table.

Second, the fact that you do not verify guarantor and not guarantor may cause errors because if one of them is hidden and filled, it will still add the names to the list box.

Third, when adding a value into a list box always ensure to verify if the value is different than null, this way if a name is missing it will not cause an error and still add all the items as requested.

here how it should look :

Hope this will help you for other times.

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
BGreggs4
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
BGreggs4
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
View profile
BGreggs4
Level 1

02-08-2017

THANK YOU!!! I appreciate your help! That worked