cancel
Showing results for 
Search instead for 
Did you mean: 

Elements visibility according to data from the context

Former Member
0 Kudos

Hi experts,

I need to hide/show some forms/elements of Interactive form (WebDynpro for Java) appropriate to value of some attribute of the root node (value=="NO" > hide elements).

This is the code:

 
------------- ProformaData.BodyPage::docReady - (FormCalc, server ) --------------------
var val = xfa.record.theField.rowValue;
if (val=="NO")
{
 // hide elements code that works
}

Elements that showld be hidden are displayed at run-time.

I think that something wrong in line

 var val = xfa.record.theField.rowValue; 

or may be this script is in wrong place: docReady event of BodyPage with FormCalc lenguage at server.....

Please help me!

Ola

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Try to get the value from the Field name like.


var val = data.<PAGE>.<FIELD>.rawValue
//or
var val = $record.<FieldName>

//You can check the value is assigned to the variable using message box.

xfa.host.messageBox(val);

Kind Regards

Mukesh

Former Member
0 Kudos

Doesn't work....

Former Member
0 Kudos

Hi

Is the message box display the value or not?

Is the event triggered?

Kind Regards

Mukesh

Former Member
0 Kudos

Event triggerd after changing to JavaScript and the message box is empty...

The field doesn't binded to some text field it just attribute of the root node (Data view).

Former Member
0 Kudos

Hi

Try this


var val = $record.<FIELD>.DATA[*].FIELD

Kind Regards

Mukesh

Former Member
0 Kudos

Data View looks like:

ProformaDataNode

myAttribute

I can't understant how to access myAttribute value...

Former Member
0 Kudos

var val = $record.<myAttribute>.DATA[*].FIELD

Kind Regards

Mukesh

chintan_virani
Active Contributor
0 Kudos

Please post the complete Node Hierarchy of your form.

Chintan

Former Member
0 Kudos

This code is working:

 xfa.resolveNode("xfa.record.myAttribute").value 

Thanks for your answers