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.

Accepted Solutions (1)

Accepted Solutions (1)

BEKOStan
Active Participant

Hi,

If I see this correctly from the screenshots, you want to set the presence of a textfield object on a masterpage to hidden.

I had a similar issue with a form used by SAP Business ByDesign. My conclusion was the following: Textfield objects on masterpages do NOT have the same behaviour as one expects from Design pages.

In my case the only solution that worked was to modify the form in a way that the problematic field was located in design page and not a masterpage - I don't have a super explanation for this upt to now...Maybe give this a try if it is applicable for you.

BR

Andreas

Tomas_Buryanek
Active Contributor

Wow, I tried it and it really makes difference on what page the content is. Thanks stanbeko ! I learned something new today 🙂

Answers (3)

Answers (3)

SURYA_ABAP
Participant

Hi a.l.e.x.8.0.,

as per stanbeko view, I feel it is right. hidden will work in design page, not in master page.

Happy to correct my self if any.

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 😉

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.