Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Using initial page to populate different layouts

Avatar

Level 1

Hello All,

I am trying to create a form where the filler enters information on one page and then selects a specific layout, probably a radio button.  When the "Next" button is clicked the selected layout is displayed and the fields are populated with the information entered on the first page.

1) What kind of scripting do I need to accomplish this?

2) Should the pages containing the different layouts be master pages?

Thanks in advance for all your help!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Yes you can do this.

If your form layout is "Positioned", then you would just reference all of the pages in the script that you want to make visible/hidden.

If you have a "Flowed" layout, then as you add more objects to the Sales page, LC Designer will create additional instances of this page. In the script when you reference that the Sales page is to be visible, it will make all instances (overflow) of it visible.

You can't use the get method (core/AcroForm javascript). However it is still fairly easy to get data from different pages.

For example, javascript in the calculate event of an object on the Sales page:

this.rawValue = adminPage.customerName.rawValue;

You just need to reference the object fully.

There is a handy trick for inserting references to objects.

  1. Select the object that you want to input script into.
  2. Then scroll to the object that you want to reference. DON't select it.
  3. Click into the Script Editor (at the top you will see that you are in the object that you selected in step 1.
  4. Then press Control and hover over the object that you want to reference. The mouse will change into a "V".
  5. Still holding Control (mouse pointer is a "V"), click the object you want to reference.
  6. LC Designer will insert the correct reference and will have the reference as long as is necessary.
  7. If you see, xfa.resolveNode in the reference, it could mean that you have not named a page or subform or that you have multiple objects with the same name. It is better to go back and correct this and then go through the steps above again to get a clean reference.

If you also want the information to be synced between all three pages, then you could name the object the same on all three pages and in the Object > Binding palette set the binding to Global. This way no matter what is typed into the field on any of the three pages, will be automatically the same on the other pages.

Hope that helps,

Niall

View solution in original post

4 Replies

Avatar

Level 10

Hi,

This example looks at changing the page based on the selected item in a dropdown: http://assure.ly/gcgTEc

You will want something similar, eg looking at the value of the radio button and then changing the presence of the pages. Take a look at the pagination settings for each page.

I would keep the number of Master Pages down to a minimum. You would only need additional Master Pages, if you are changing the layout or page size (eg landscape, portrait, letter, A4, etc.) OR if you are displaying difference content (eg logos, standard text, etc.(.

Hope that helps,

Niall

Assure Dynamics

Avatar

Level 1

Yes that is what I am trying to do, but I have another question.  Using the example you sent me, would it be possible to have multiple pages appear?  For example the sales page would be 3 pages and the accounts page would be 2 pages, but the administration page would always be a single page.

Also say on the administration page I had a 2 text fields and a date/time field.  On the sales and accounts pages I have the exact same fields but they are in different locations for each set of pages.  I want to only put in values in the administraion page and have those values carry over to the sales or accounts page.  Can I use the get method to extract the information from the administration page and fill in the fields on either the sales or accounts page?

I hope this makes sense and thanks for your help so far.

Avatar

Correct answer by
Level 10

Hi,

Yes you can do this.

If your form layout is "Positioned", then you would just reference all of the pages in the script that you want to make visible/hidden.

If you have a "Flowed" layout, then as you add more objects to the Sales page, LC Designer will create additional instances of this page. In the script when you reference that the Sales page is to be visible, it will make all instances (overflow) of it visible.

You can't use the get method (core/AcroForm javascript). However it is still fairly easy to get data from different pages.

For example, javascript in the calculate event of an object on the Sales page:

this.rawValue = adminPage.customerName.rawValue;

You just need to reference the object fully.

There is a handy trick for inserting references to objects.

  1. Select the object that you want to input script into.
  2. Then scroll to the object that you want to reference. DON't select it.
  3. Click into the Script Editor (at the top you will see that you are in the object that you selected in step 1.
  4. Then press Control and hover over the object that you want to reference. The mouse will change into a "V".
  5. Still holding Control (mouse pointer is a "V"), click the object you want to reference.
  6. LC Designer will insert the correct reference and will have the reference as long as is necessary.
  7. If you see, xfa.resolveNode in the reference, it could mean that you have not named a page or subform or that you have multiple objects with the same name. It is better to go back and correct this and then go through the steps above again to get a clean reference.

If you also want the information to be synced between all three pages, then you could name the object the same on all three pages and in the Object > Binding palette set the binding to Global. This way no matter what is typed into the field on any of the three pages, will be automatically the same on the other pages.

Hope that helps,

Niall

Avatar

Level 1

Niall,

Thanks for all your help.

Dan