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

I confirm that if the submodule is moved to the master page the code works correctly.

Thanks everyone for the suggestions

Sandra_Rossi
Active Contributor

Just reading answer by you and answer by Andreas, it's confusing as Andreas says it should work if moved to the design page, and YOU say it works if moved to the master page. Please clarify.

It works if it is moved out of the master page.

Sandra_Rossi
Active Contributor
0 Kudos

Thanks for confirming 😉