cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically changing the presence of UI elements using Adobe

Former Member
0 Kudos

Hi,

I am generating PDF at run time based on the values coming from EJBs through web Services.

I used fomrCalc Script and at initialize event, checked for the values. Here is the sample:

The hierarchy is:

Subform1

Subform11.

NumericField5.

...

...

if ( Subform11.NumericField5.value = -1 ) then

Subform11.NumericField5.presence="hidden"

Subform11.presence="hidden"

else

Subform11.NumericField5.presence="visible"

Subform11.presence="visible"

endif

Subform1 is position content, while Subform11 is flowContent.

But am not getting the expected output.

1. Is it the proper way to check the values ? (what is the difference between rawValue and Value ? )

2. Which event should i check for the values before the PDF is renedered, but values are bound to the context. ( docsReady or initialize event ? )

Let me know at the earliest. I am using Adobe Designer 6.0

Thanks in advance

Apeksha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Apeksha,

if ( Subform11.NumericField5.value ==

"-1"

) then
Subform11.NumericField5.presence = "hidden"
Subform11.presence = "hidden"
else
Subform11.NumericField5.presence = "visible"
Subform11.presence = "visible"
endif[/code]

Intialization event should work.

rawValue contains before formated value.

Scenario 1

: Depending on a specific value a field has to be hidden.

a) Select the field you want to hide depending on a condition. (On the layout designer)

b) Choose ‘FormCalc’ as language and ‘Form:Ready’ as event. (On the script editor)

c) Scripting:

if ( $.rawValue == ) then

$.presence = “hidden”

endif

Scenario 2:

Depending on a specific value of a field, its ‘direct’ parent or ancestor in the layout hierarchy (è one level higher) has to be hidden.

a) Select the field used in the condition.

b) Choose ‘FormCalc’ as language and ‘Form:Ready’ as event.

c) Scripting:

if ( $.rawValue == ) then

$.parent.presence = “hidden”

endif

Scenario 3:

Depending on a specific value of a field, one or more different objects of the form have to be hidden.

a) Select the field used in the condition.

b) Choose ‘FormCalc’ as language and ‘Form:Ready’ as event.

c) Scripting:

if ( $.rawValue == .presence = “hidden”

endif

Scenario 4:

In this case we want to use the value of a field in another object for the making of conditions. (This scenario is more general than the others)

a) Select the object on which you want to write your script. This can be any object that offers the possibility to use the “Form:ready” event.

b) Choose ‘FormCalc’ as language and ‘Form:Ready’ as event.

c) Scripting:

var myField = .presence = “hidden”

endif

->A condition can depend on one or more fields. For this issue, you only have to use logical expressions with AND or OR. As example use the scenario 4. Just follow the same steps of that scenario and have a look at the following scripts for how to use “AND” or “OR”.

Scripting for “AND”:

var myField1 = .presence = “hidden”

endif


Scripting for “OR”:

var myField1 = .presence = “hidden”

endif

Thanks and Regards,

Pavan Meda

Former Member
0 Kudos

Hi Pavan,

Thanks for the reply. I followed the steps given by you. i could make the fields hidden, however, it is still occupying the blank sapce. I want the next fields to fill up the gap, thus giving the continuity to the form.

As per given example, though Subform11 is in flow content and i make that hidden based on the values of NumericField5. Subform1 which encloses Subform11 alongwith other elements is in position content.

How can i achieve this ?

Thanks

Apeksha

Former Member
0 Kudos

Hi,

Subform1 should be in flow content.Wrap the remaining elements in another subform.The subform1 contains Subform11 and new subform.As the subform 1 is in flow based on the condition subfrm11 will be hide,the new subform will be moved .

Can you let me know, where you are writing the above logic in master page or body page.

Pavan Meda

Answers (0)