Unable to unhide subform in Adobe Form

Greg_SAP_Adobe

24-02-2015

Hello All,

Something that should be simple has turned into a bit of a trial. I have an Adobe form with three tables with different columns. Based on a variable passed to the form say, "number_of_tests" one of the tables should be visible.

This works fine when the subforms are set to "invisible" by default and then made "visible". However, it does not work when the default value is "hidden". Why does this matter? Well, the "invisible" element still affects the layout of the form so I need it "hidden" (exclude from layout). Any clue would be greatly appreciated.

Here is my sophomoric code and location.

data.#pageSet[0].Page1.NUMBER_OF_TESTS::initialize - (JavaScript, server)

if (this.resolveNode("$").rawValue == "03") {

  this.resolveNode("Page2.ItemDataHdrSubForm3").presence = "visible";

  this.resolveNode("hdrs.ItemDataHdrSubForm3").presence = "visible";

  this.resolveNode("itms.ItemDataSubForm3").presence = "visible";

}

if (this.resolveNode("$").rawValue == "04") {

  this.resolveNode("Page2.ItemDataHdrSubForm4").presence = "visible";

  this.resolveNode("hdrs.ItemDataHdrSubForm4").presence = "visible";

  this.resolveNode("itms.ItemDataSubForm4").presence = "visible";

}

Here is the structure of my elements.

MainSubForm is Flowed default to Visible.

SubHeaderSubForm is positioned default to Visible.

ItemDataHdrSubForm3 is flowed default hidden. (doesn't work, but does when default is "invisible")

ItemDataSubForm3 is flowed default hidden. (doesn't work, but does when default is "invisible")

ItemDataHdrSubForm4 is flowed default hidden. (doesn't work, but does when default is "invisible")

ItemDataSubForm4 is flowed default hidden. (doesn't work, but does when default is "invisible")

Again, thanks for any assistance.

Greg

Accepted Solutions (0)

Answers (2)

Answers (2)

radzmar

MVP

25-02-2015

Hi,

look into the XFA specs to learn the difference of visible, invisible, hidden and inactive: http://partners.adobe.com/public/developer/en/xml/xfa_spec_3_3.pdf#page=68

Ok, so why do you use the initialize event for your script?

And the script you provided does not fit the structure form your screen shot.

It should look this way:


if (this.rawValue == "03") {


  xfa.resolveNode("MainSubform.ItemDataHdrSubForm3").presence = "visible";


  xfa.resolveNode("MainSubform.ItemDataSubForm3").presence = "visible";


}


if (this.rawValue == "04") {


  xfa.resolveNode("MainSubform.ItemDataHdrSubForm4").presence = "visible";


  xfa.resolveNode("MainSubform.ItemDataSubForm4").presence = "visible";


}


Greg_SAP_Adobe

25-02-2015

Thanks Radzmar...good eye for detail. I was jostling about the subforms in an attempt to structure them differently and pasted in the wrong code in the discussion.

I have tried the form.ready, layout.ready and initialize....they all had the same effect. I'm able to make visible invisible elements but am not able to make visible hidden elements. Seems the code should be the same for both of them. I made sure to try your code, and it had the same effect. Do hidden elements require something in addition to invisible elements?

I will take a look at your link to the developer specs, I appreciate that link. As you can tell, I'm pretty new with adobe forms.