Expand my Community achievements bar.

Setting Presence of Subform

Avatar

Former Community Member
How would I use a button on "click" to set the presence of a subform to "hidden"?



form1.pg1.subHeader.subCusInfo.presence("hidden")?
5 Replies

Avatar

Former Community Member
I think is:

form1.pg1.subHeader.subCusInfo.presence= "hidden";

or maybe is in just in Javascript.

Avatar

Former Community Member
Here you have a Java Script example which I hope it can help you.



b On Button Click-Event




// Getting the object's presence attribute


var presencia = xfa.resolveNode("Formulario1.page2").presence;


// Getting the button's text control


var val = xfa.resolveNode("this.caption.value.#text");






// If the page is hidden


if(presencia == "hidden"){


     val.value = "Hide Page";
// Changing the button text


     xfa.resolveNode("page2").presence =
"visible";

// Setting page to visible.


}else{


     val.value = "Show Page";
// Changing the button text


     xfa.resolveNode("page2").presence =
"hidden";

// Setting page to hidden.


}








Regards and good luck!



Dan

Avatar

Former Community Member

i tried to apply the same technique to my checkbox but it seems cannot works.

my code is

Avatar

Level 6

Use formcalc:

On Click event  of the check box:            

if ($.rawValue==1)then
form1.filteringform.chkOthersSubform.presence="visible"
else form1.filteringform.chkOthersSubform.presence="hidden"
endif