cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the context variables in adobe forms

Former Member
0 Kudos

Hi Guys,

             I need a simple advice, Here is my scenario, I have a variable GV_XYZ part of my context in adobe forms. And in Page1-SUBFORM1 (Path)

i am trying to access it without binding it to any element.

So I am using the following javascript.

if ($.gv_xyz.rawValue == "X")

{

this.presence = "hidden";

}

end of the day the purpose is to hide the subform, which works perfectly if i dont have the if statement. It is a simple problem but can not figure out what is that i am doing wrong here?

also tried this.

var gv_abc;

gv_abc = xfa.record.gv_xyz.rawValue;

if(gv_abc == "X ")

{

this.presence = "hidden";

}

still no luck.

Appreciate any help.

Best Regards,

Tapo.

0 Kudos

Hi Tapo,

I am also facing same issue.

Could you please let me know, if your issue is resolved.

Thanks & Regards,

Sagar.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Tapo,

Check out my blog on this topic:

Best,

Juergen

former_member531036
Participant
0 Kudos

Hi Tapo,

When you're referencing a variable that is not bound you need to use the prefix of: $record. If you're still having issues, you could try:

if($record.gv_subj.isNull)

{

this.presence = "visible"

}

instead.

Julie

Former Member
0 Kudos

Hi Julie,

           Thanks for your quick response on this, I have tried the approach, Still no luck.

Now the variable is a global variable and I have checked it has a value of X. It is directly under context and available in the data view.

if(($record.gv_subj.isNull)

{

this.presence = "visible";

}

else

{

this.presence = "hidden";

}

Best Regards,

Tapo.

former_member531036
Participant
0 Kudos

Hi Tapo,

What event are you putting this code in?

Julie

Former Member
0 Kudos

Hi Julie,

           I am using Initialize event, which should work. And works if I just remove the if statements. I even tried hidden in both the conditions.

so the below doesn't work.

if($record.gv_subj.rawValue != null)

{

this.presence = "hidden";

//"visible";

}

else

{

this.presence = "hidden";

}

but this works,

//if($record.gv_subj.rawValue != null)

//{

this.presence = "hidden";

//"visible";

//}

//else

//{

//this.presence = "hidden";

//}

same event. Other lines are commented, so definitely something wrong with the if construct, but why it is not able to read the condition is beyond my understanding.

Best Regards,

Tapo.

0 Kudos

Hi,

I have the same problem, any solution yet?

regards