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

SOLVED

unhide/hide a field (table) using a button.

Missile64
Level 2
Level 2

‌I have a table set to hidden and want to unhide it using a button and to hide it using the same button. If the table is left visible I don't want it to be able to be printe. Any suggestions?

thanks

1 Accepted Solution
Magus069
Correct answer by
Level 10
Level 10

Alright, seems like it does not keep the flow of the form...

Another work around you can use that will work for sure would be the following:

1. Keep this code in the button click event

2. In your hierarchy, click on the table you want to hide when printing, go in the prePrint event and put this line (prePrint is before printing)

3. Now in the postPrint event you can put the following line to put back the table visible (postPrint is after printing)

Keep in mind that if the Table is hidden when printing, the table will appear in the postPrint.

So if you want to avoid this, you can have a hidden text field that keeps in memory how you should display the table after printing.

If you do this, you can change the value "visible" for TextField1.rawValue

You can put the text field's value using the button click event, when changing the presence value of the table change the text field's value as well

Hope this will help!

View solution in original post

6 Replies
Magus069
Level 10
Level 10

Hi there,

in the button click's event you would have have something written like the following :

Make sure to put this in a JavaScript event

Hope this Help!

Missile64
Level 2
Level 2

‌Works great except when I print it leaves a gap where the table was. I have the table default as hidden (exclude from layout).

thanks for your assistance so far.

Magus069
Level 10
Level 10

Make sure your content's parents are all flowable

Missile64
Level 2
Level 2

‌Every thing is flowed, all fields except the table are in flow able sub forms, and everything is enclosed in 1 flowable sub form.

am I able to send you a copy of the form?

Magus069
Correct answer by
Level 10
Level 10

Alright, seems like it does not keep the flow of the form...

Another work around you can use that will work for sure would be the following:

1. Keep this code in the button click event

2. In your hierarchy, click on the table you want to hide when printing, go in the prePrint event and put this line (prePrint is before printing)

3. Now in the postPrint event you can put the following line to put back the table visible (postPrint is after printing)

Keep in mind that if the Table is hidden when printing, the table will appear in the postPrint.

So if you want to avoid this, you can have a hidden text field that keeps in memory how you should display the table after printing.

If you do this, you can change the value "visible" for TextField1.rawValue

You can put the text field's value using the button click event, when changing the presence value of the table change the text field's value as well

Hope this will help!

View solution in original post

Missile64
Level 2
Level 2

Brilliant, works perfectly, thanks very much for the help

Pete