Expand my Community achievements bar.

button to show hidden subform does not work

Avatar

Former Community Member
Hi,



I changed the display property of a subform to
hidden then put in the click event of a button the following code to show the hidden subform:




testSubform.presence = "visible";



Unfortunately, it never works. Weirdly, if I put the same code in the change-event of a dropdown-field, it works.

Also, if I set the subform to
invisible instead of
hidden, the button works as intended, showing the hidden subform.



Here's an example pdf:


button_show_hidden_subform.pdf



Is there a bug with buttons not handling hidden-subforms? Or am I the only one to experience that problem?



Regards,

Steve
6 Replies

Avatar

Former Community Member
Woah, weird, that shouldn't be the case. My best guess would be that it's a bug. If you have a support contract I'd suggest opening a case for this.



I'll try to investigate and post an answer here, but I can't guarantee a speedy response since I don't have an answer off the top of my head.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Hi Chris,



So you were able to reproduce the problem?



Steve

Avatar

Former Community Member
Thank you very much, Chris!



I investigated a pretty strange workaround. The following code put in the click event of a button does NOT work to show a subform, whose
presence-property is set to
hidden:




mySubform.presence = "visible";



('mySubform' refers to the subform's correct SOM-expression)



In order to get the above code-fragment work, simply change it slightly into:




mySubform.presence = "visible";

this.caption.font.fill.color.value = this.caption.font.fill.color.value;



Which is rather silly indeed :-), but it works perfectly well.

 *sigh



Regards,

Steve

Avatar

Former Community Member
Well, the workaround looks like it even works with any property. Like:




mySubform.presence = "visible";

this.presence = this.presence;



So you may use your favorite property...



Steve

Avatar

Former Community Member
Lol, well at least you found a usable workaround :P



Undoubtably this is a refresh bug. By changing a visibility property after changing the presence of the subform you're forcing a refresh. I'll get this logged as a bug in the system once I have a chance. Thanks for bring this to our attention.



Chris

Adobe Enterprise Developer Support

Avatar

Level 4
I experinced something like you and solved it by refreshing the layout.. like this:



sub_extraInfo.presence = "visible";

xfa.layout.relayout();



I used a lot of time on this.. hope you don't

/Thomas