cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a line based on Context data

Former Member
0 Kudos

In my form I am attempting to check my context data field for a value using Javascript and then I have a line in my form that I am trying to hide based on it.

The Javascript is in the readyForm event of the "Signature" Subform.

However, it is not working, Any ideas,

Accepted Solutions (1)

Accepted Solutions (1)

navip
Active Participant
0 Kudos

Drag and drop the LOGO(text field) from data view below the subform(signature subform) and above the line(lineER1).

then  write the below FormCalc in the "layout ready" event.

if ($.parent.LOGO == "Y" ) then

$.lineER1 = "hidden"

else

$.lineER1 = "visible"

endif

---

Naveen

Former Member
0 Kudos

Got this to work with some tweaks to the code above.

if ( $.LOGO.rawValue == "Y" ) then

$.LineER1.presence = "hidden"

else

$.LineER1.presence = "visible"

endif

Thanks Naveen

Answers (2)

Answers (2)

pavan_prabhu
Active Participant
0 Kudos

Hello Mike,

     You are not able to hide the line because you have written the Javascript code on the Ready Form Event. So remove the code from Ready Form event and put the code in the Initialize Event of Signature Sub form. It will work.

Former Member
0 Kudos

Moved to Initialize and still does not work. I wish SAP or Adobe had made it easy to be able to reference these variables without having to figure out through trial and error if you are referencing the correct one or not in Javascript.

0 Kudos

hi 

if(xfa.resolveNodes("xfa.record.LOGO[0]").item(0).value=="Y")

{

Line1.presence = "hidden";

}

hope it will help

Jitendra

Former Member
0 Kudos

That didnt work either. Its just a variable in the context and not part of any table data.

0 Kudos

hi Mike Andries

i know about it that this xfa.resolveNodes("xfa.record.LOGO[0]").item(0).value=="Y"

is used for fetching the data from table but it can also fetch data from variable also i

used this code on initialization it is working fine .