cancel
Showing results for 
Search instead for 
Did you mean: 

this.presence = "hidden"; doesn't work in adobe form

Hi,

I'm working with adobe form in transaction SFP.

In the next page I have a variable (W_NAME4) and i want to insert a check that if its empty then the next variable must scroll up.

The subform is flowed.

I have inserted this java script code:

data.#pageSet[0].NEXT_PAGE.SUBMOD_INDI.W_NAME4::initialize - (JavaScript, client)

if ( this.resolveNode("W_NAME4").rawValue == "" || this.resolveNode("W_NAME4").rawValue == null ) {

this.presence = "hidden";

}

To be able to test if the "IF" is executed in the upper field I have inserted the following logic:

data.#pageSet[0].NEXT_PAGE.SUBMOD_INDI.W_NAME3::initialize - (JavaScript, client) if ( this.resolveNode("W_NAME3").rawValue == "" || this.resolveNode("W_NAME3").rawValue == null ) {
this.rawValue = "Write Fixed Text "; }the current result is the following: the field, even if empty, is not hidden.

It seems that this problem only happens on the next page, because I have the same code in the main page and the field is hidden correctly.

Any ideas?

Tomas_Buryanek
Active Contributor

This is really strange because this should work:

this.presence = "hidden";

based on what you wrote here and tested.

But I would like to ask, why do you check it like this:

if ( this.resolveNode("W_NAME3").rawValue == "" || this.resolveNode("W_NAME3").rawValue == null ) ...

Instead of simple check?

if (this.rawValue == null) ...

Before the script was in a subform, that's why I used that logic. Anyway the result is the same even writing

if (this.rawValue == null) ...

Sandra_Rossi
Active Contributor
0 Kudos

You have said that "hidden" doesn't work, but I would think first that the IF doesn't work. Did you check first by removing the IF to make sure that it's really "hidden" which doesn't work?

To verify that the if was resolved I had inserted the fixed text on the w_name3 variable. However I modified the script leaving only this.presence = "hidden"; but the result does not change.

View Entire Topic
SURYA_ABAP
Participant
0 Kudos

Hi,

Pre-requisite for this is - All Parent blocks have flowed type.

hope this will work.

0 Kudos

This is not true. The subform containing the fields must be "flowed", but it can be contained in a subform "positioned". In this specific case we have only one subform and is "flowed".

SURYA_ABAP
Participant
0 Kudos

Try this.

this.presence="hidden" (Without spaces).

0 Kudos

Even so, it doesn't work.

I think the problem depends on the next page. In fact, the same code placed in the main works correctly, while the same variables placed in the next don't work correctly.