Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

PRESENCE = "hidden" is not working!

Avatar

Level 8

Hello

I am developing a interactive form and the back end is SAP ERP software (where in the INITIAL screen will be developed) and the data bse is Oracle, fine.

The my_form has 4 pages.

The first 2 pages (1&2) are meant for to enter the family head details.

And the last 2 pages(3&4) are meant for children details.

As soon as user opened the application,User will get the 3 radio buttons as below,

  • Would you like fill whole family details (all the 4 pages) [in this case my applicatuion should render all the 4 pages to user]
  • Would you like fill ONLY family HEAD details (1st & 2nd page) [in this case my applicatuion should render first 2 pages to user]
  • Would you like fill ONLY children details (3rd & 4th page) [in this case my applicatuion should render LAST 2 pages to user]


{code}
So, i kept the below code in my_form.docReady event,

if( allFamily == "X"){;
// do nothing
}

if( Head == "X"){;
xfa.resolveNode("MY_FORM.Page3").presence = "hidden"
xfa.resolveNode("MY_FORM.Page4").presence = "hidden"
}


if(  Children == "X"){;
xfa.resolveNode("MY_FORM.Page1").presence = "hidden"
xfa.resolveNode("MY_FORM.Page2").presence = "hidden"
}
{code}

Its not working,

1 - Pls. let me know whts is missing, why its not working?

2 - How can get it done of my requirement, any code snippet and event pls.?

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Srinivas,

  As I understand from your post that the radio buttons are not part of the PDF.. In this case, the only way PDF form will know which radio button was selected by passing the data as part of the rendering.

Currently you know which radio button was selected by being on a screen which is not a PDF form. You should pass this value to the PDF by rendering the form with the data.

   I am not sure how the SAP is passing the data to the PDF, but if you are using a Workbench process / Adobe Forms Server APIs to render the PDF, you can pass the datafile with the data.

  If you are doing the above, then Initialize/ DocReady/ FormReady event should work. Because the radio button was selected prior to the PDF was rendered. So the value will be available during any of the above events.

   During my earlier post, I was assuming you were selecting the Radio button on the PDF itself. But that is not the case.

Thanks

Srini

View solution in original post

6 Replies

Avatar

Level 10

Looking at the code posted few thoughts..

1. First you need to place the code in either click/ change event of the radio button.

2. You need to have the semicolon (;) at the end of each statement. But you have placed the simicolon at the end of If condition line.

3. If you have it done the above 2 steps correctly, the only thing that can be considered is the proper path of the field. For example, Page3 should be part of MY_FORM.

Thanks

Srini

Avatar

Level 8

Thank you Srini.

Sorry Srini that.........as i mentioned in my original posting, the INITIAL screen (where in the RADIO BUTTONS are places) is part of SAP ERP back end software, its nothing doing with our my_form....maening, my_form has NO CONNECTION with initial screen/radio buttons.

But, in the data source there is filed, which denotes the selected radio button number, either 1 or 2 or 3

pls. let me know that, whether i can hide a page TOTALLY? is it possible basically on the interactive forms?

if so, which is the good/correct EVENT to place my code/hide logic? right now, i kept in docReady event

Thank you    

Avatar

Level 10

Place the code in the Click event of the radio buttons instead of DocReady event.

You can hide the entire page by setting the root subform's presence property to "hidden".

For example

     if(CONDITION == "Value")

          Page1.presence = "hidden";

Thanks

Srini

Avatar

Level 8

Thank you Srini.

1) As i mentioned, the radio buttons contaning screen is not part of inetractive screen, so, there is no link btwn radio button screen and interactive form, but, i can CAPTURE that, which (either 1st or 2nd or 3rd) radio button has been selected by user, so in the case, Java Script

if (userSelectedRadioButtonNumber == "2") ====> denotes family HEAD

  Page3.presence = "hidden"; ==> here i dont need to specify my_form? like my_form.Page3.presence?

  Page4.presence = "hidden"; ==> here i dont need to specify my_form? like my_form.Page4.presence?

Purposfully, you avoided my_form in the path?

2) Pls. let me know in Which EVENT i should keep the ABOVE JavaScript? is it INITIALIZATION of page3/page4? or INITIALIZATION of my_form level?

or

is it docReady of page3/4? or docReady of my_form level? ==> right now its docReady at my_form in application, but, not working!

Thank you

Avatar

Correct answer by
Level 10

Srinivas,

  As I understand from your post that the radio buttons are not part of the PDF.. In this case, the only way PDF form will know which radio button was selected by passing the data as part of the rendering.

Currently you know which radio button was selected by being on a screen which is not a PDF form. You should pass this value to the PDF by rendering the form with the data.

   I am not sure how the SAP is passing the data to the PDF, but if you are using a Workbench process / Adobe Forms Server APIs to render the PDF, you can pass the datafile with the data.

  If you are doing the above, then Initialize/ DocReady/ FormReady event should work. Because the radio button was selected prior to the PDF was rendered. So the value will be available during any of the above events.

   During my earlier post, I was assuming you were selecting the Radio button on the PDF itself. But that is not the case.

Thanks

Srini

Avatar

Level 8

Thank you for answer indetails,

Srinivas