Highlighted

Trouble changing visibility of a subform...

Avatar

Guest

09-01-2009

I'm having trouble toggling the visibility of a subform.



Here's the code I stuck on a button for testing (on click):



ImageField1.presence = "invisible";

subForm1.presence = "invisible";



The Image field becomes invisible, but the subform does not...



What am I doing wrong?



Thanks in advance!

Replies

Highlighted

pguerett

12-01-2009

lok at the hierarchy view and path your way to the subform. For example:



form1.Page1.subform1.presence = "invisible"
Highlighted

Thomas_McConnac

12-01-2009

Have the subform visible in your design view, but have the cursor in the code you are typing.



Hold down the "Ctrl" key and click on the subform (or a field in the subform you want to change, can just delete the name of the field afterwards). This will give you its relative address to where you are in the code.



Tom
Highlighted

Avatar

Guest

12-01-2009

still not working...



I created a new file and here's the hierarchy:



form1

(Master Pages)

Page1

(untitled content area)

livePage

Button1

subform

(Referenced Objects)



Here's my code on the click event for Button1:



form1.livePage.subform.presence = "invisible";



I'm sure it's something simple I'm doing wrong...



Any thoughts?



oh and BTW, when I do Tom's trick and click on the subform, here's what I get:

xfa.resolveNode("form1.livePage.subform")
Highlighted

Avatar

Guest

12-01-2009

>Generating PDF Document...

>Font Service: Default font typeface is Myriad Pro.

>PDF generated successfully.



>0 warnings/errors reported.



I can toggle an image field in the same place, so to speak, but the subforms do nothing.
Highlighted

pguerett

12-01-2009

Are you running Acrobat? If so when the form is rendered you can hit the Ctrl -J to see a javascript console. When you click the button if there are any errors they will appear in the console. If you do not have Acrobat, send the form to livecycle8@gmail.com and I will have a look.
Highlighted

Avatar

Guest

12-01-2009

I am having a similar problem. I had it working in one form. I duplicated the same way in another form and it doesn't work! I have stared at it till I was ready to fall asleep to see if I could spot the problem! No luck!