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

Hidding table row - presence = "hidden" not working

Avatar

Avatar
Validate 1
Level 1
robson1976
Level 1

Like

1 like

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
robson1976
Level 1

Like

1 like

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
robson1976
Level 1

19-03-2021

Hi all,

 

I need to hide a row from the table based on a condition and all the suggestions I found says to use .presence = "hidden", but unfortunately only the line content is being hidden and not the entire row.

This is the JavaScript I'm using:

data.#pageSet[0].Page1.BasicData::initialize - (JavaScript, client)

if ( $record.V_FLAG.value != "X" ) {
this.resolveNode("Page1.BasicData.Table1.Line2").presence = "hidden";
}

 

I also tried the following alternatives:

 

if ( $record.V_FLAG.value != "X" ) {
this.resolveNode("Page1.BasicData.Table1.Line2.Cel1").presence = "hidden";
}

if ( $record.V_FLAG.value != "X" ) {
this.Table1.Line2.presence = "hidden";
}

if ( $record.V_FLAG.value != "X" ) {
this.Table1.Line2.Cel1.presence = "hidden";
}

 

I appreciate any help.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

149 likes

Total Posts

340 posts

Correct Reply

96 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

149 likes

Total Posts

340 posts

Correct Reply

96 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Kosta_Prokopiu1
Employee

22-03-2021

@Magus069fair enough but from the description and the word "table" you cannot pinpoint things as everyone uses terms in their way.

If this is a XFA table it should be totally easy:

Kosta_Prokopiu1_0-1616396295303.pngKosta_Prokopiu1_1-1616396329566.png

You don't even need all that flowed context stuff as long as the table stands on its own, has nothing following it which needs to move and does not exceed the page boundaries.

 

If that does not work for you then I can only guess what the problem may be:

  • Something different in the structure of your XFA table compared to mine.
  • Is this a dynamic table, meaning Line2 is repeated vs. fixed row design?
  • Your logic is somehow not correct or not correctly placed
  • Your data is not what you expect.
  • Ideally you should place the hiding logic in the Line2 table subform if possible. Saves you the resolveNode.
    if ( $record.V_FLAG.value != "X" ) {
      this.presence = "hidden";
    }

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 1
robson1976
Level 1

Like

1 like

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
robson1976
Level 1

Like

1 like

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
robson1976
Level 1

22-03-2021

@Kosta_Prokopiu1

 

I tried to follow your example, but it didn't work for me. The element is not collapsing.

 

robson1976_0-1616412779949.png

 

Before this.presence = "hidden"

robson1976_2-1616413408101.png

 

After

robson1976_3-1616413518779.png

 

Avatar

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

149 likes

Total Posts

340 posts

Correct Reply

96 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

149 likes

Total Posts

340 posts

Correct Reply

96 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Kosta_Prokopiu1
Employee

19-03-2021

my guess: you have not placed your table in a flowed top-to-bottom context. In that case hidden would hide things but they cannot flow/collapse.

Kosta_Prokopiu1_0-1616174826157.png

I created a table and make Line1 hidden on initialize

Kosta_Prokopiu1_3-1616175229959.png

When Table1 is not Flowed then the wrong result:

Kosta_Prokopiu1_4-1616175279384.png

 

Result with Table1 Flowed:

Kosta_Prokopiu1_5-1616175319257.png

 

 

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

19-03-2021

Hi there,

 

it is hard to say why it behaves this way, and without the hierarchy it would be hard to explain and understand... have you tried hiding Table1?

I am not sure exactly what you mean by: hiding Line1 is hiding the content only and not the row.