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

how do I use a wild card with a repeating row?

Avatar

Avatar
Level 1
Nathan_Ford
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Nathan_Ford
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
Nathan_Ford
Level 1

15-03-2016

Hello, I have a form with a table that contains a repeating row.

The table is populated from an xml import.

I would like to hide one of the columns based on a dropdown, but the [*] Wildcard does not work

Please help me with the var i " + i + " code to acheive this

if ($.boundItem(xfa.event.newText) == "stephenw@babybunting.com.au") {

  this.resolveNode("Body.Table.HeaderRow.QLD").presence = "hidden";

  this.resolveNode("Body.Table.Row[*].QLD").presence = "hidden";

  this.resolveNode("Body.Table.FooterRow.TotalQLD").presence = "hidden";

  Subform1.Body.Table.columnWidths="15mm 30mm 55mm 15mm 15mm 15mm 15mm 15mm 15mm";

}

Thanks

Nathan

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 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,077 posts

Correct Reply

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

17-03-2016

Avatar

Avatar
Level 1
Nathan_Ford
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Nathan_Ford
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
Nathan_Ford
Level 1

16-03-2016

Thankyou both for the reply, that's exactly what I was looking for.

How do I put the for statement inside the if statement

trying this

var oRows = xfa.resolveNodes("Body.Table.Row[*]"); 

if ($.boundItem(xfa.event.newText) == "stephenw@babybunting.com.au") {

for (var i = 0; i < oRows.length; i += 1) { 

    oRows.item(i).QLD.presence = "hidden";

}

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

16-03-2016

You can also use the asterisk wildcard in JavaScript when you the resolveNodes method.


var oRows = xfa.resolveNodes("Body.Table.Row[*]");


for (var i = 0; i < oRows.length; i += 1) {


    oRows.item(i).QLD.presence = "hidden";


}


For more information about this mehtod read this post.

resolveNode vs. resolveNodes

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 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,077 posts

Correct Reply

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

16-03-2016

Hi there,

you could use FormCalc instead to use the [*], I think this could work...

if not, here is the loop you need

Hope this will help