cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a Subform

Former Member
0 Kudos

Hi Experts,

I have a check box.If i click it,i want a subform to be hidden.

i wrote the script on click event:

if (this.rawValue == 0)

{     

subform.presence = "visible";

}

else 

{     

subform.presence = "hidden";

}

But this code is not working.I tried Formcalc as well.

Please help me to solve this issue.

Regards,

Arun.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI
In the FORM-CALC / initialization/Client

==> write this code at the SUBFORM and not at the CB

if($record.<CHECKBOX NAME> == "X" )

then

$.presence = "visible"

else

$.presence = "hidden"

endif

Former Member
0 Kudos

Hi Nitin,

I need to code in "Click" event.In initialize event this code is working fine.The scenario is like if i click on a button one should be hidden.

Please help me to solve this issue.

Regards,

Arun.

konchada_saikrishna
Active Participant
0 Kudos

Hi Arun,

Do you need a toggling functionality?

if so...

Since the click event triggers immediately as and when the checkbox is clicked and the value of the checkbox is updated after the event is completed you cannot go setting the subform visibility based on checkbox value.

you can put the code in 2 events which is mandatory.

1) on document or subform ready : reason being to to set the current visibility status to subform when a saved form is opened.

2) on the checkbox click event: to set the subform visibility at runtime or form edit.

1) subform ready / document ready event:

note: script is in java not form calc, you write respective formcalc script if you know.

<subform absolute path>.presense = (<checkbox absolute path>.rawvalue == "1") ? "visible" : "hidden";

2) on checkbox click event:

<subform absolute path>.presense = (<subform absolute path>.presense == "visible") ? "hidden" : "visible";


Hope this gives you clear picture of reason having script in 2 areas and solves your issue, let me know if you need more info.

Cheers,

Sai

Former Member
0 Kudos

Hi Sai,

Thanks a lot for your valuable time and help.

Regards,

Arun.

konchada_saikrishna
Active Participant
0 Kudos

Any time mate...

Answers (1)

Answers (1)

rakesh_m2
Contributor
0 Kudos

Try writing in change event

Rakesh