Expand my Community achievements bar.

navigation buttons and page numbers not working properly

Avatar

Level 1

Hi

I have had previous very useful help in setting up buttons to link to various pages in my dynamic form using hidden numeric fields on the destination pages. I think my script is correct but my buttons are navigating to the wrong page. They are all going to the very first page in the form. I have attached a scaled down version of my form and would be grateful for any help on where i have gone wrong. i should say i am very new to livecycle.

another problem i have is that i have included a page number field on my master page but this is also not working and gives every page as 0. I don't really want my page numbering to start until the General Information page. can i remove it from the previous pages? or create a new master page and specify which pages to use it on (rather than first, last or rest of)?

One other thing - tho this one is not particularly important. i have used the launch URL command on the two images at the top corners of the page but these are also not working? any ideas?

R

4 Replies

Avatar

Former Community Member

You should be using the command:

xfa.host.setFocus("Name of Field")

To make the form move the cursor to an appropriate page.

Paul

Avatar

Level 10

Hi Reggie,

There are a few things happening in your form, which I would recommend you have a look at first:

  1. The reason the buttons arn't working is that each of the hidden fields are giving "0" as the page number.
  2. The layout: ready event is not firing. In LC status bar (at the bottom of the screen or if not visible select in the Windows menu) there are 23 pages, but only 11 containing pages in the hierarchy view. This can happen when your objects on one page extend beyond that page's container. In designer it forces another occurance of the page. Your form is static, e.g. you are not flowing content from one page to another during runtime. Therefore if you want a 15 page form in Acrobat, you should have 15 pages in the hierarchy view in LC Designer. I changed one of the scripts from layout: ready to initialise and it work, but was giving "-1"  as the page number, which indicates that the form pages are mixed up.
  3. I would go through each page in turn and get the content back within the container. Even if you have to reduce each object in the short term. As you progress you will see the page number in the status bar reducing. You will know you have arrived when the status bars says you have 11 pages, which will match the hierarchy view.
  4. Below is a screen shot where the textfield in the contents page was split over two occurances of the same page. I got the number of pages down to 22 by selectign the textfield and shortening it in the Layout Tab (Y dimension).

I think that when you solve the number of pages, your form will work. Becuase some pages do not have fields, the index solution will still work.

I would recommend you look at some of the syntax in your script:

xfa.host.getURL ("http://www.niwater.com/watermainsproject.asp");

There is a "page of" object in the custom object library

There appeared to be a number of events where the script was referencing objects that did not exist. (name  /  ManFrameLegislation).

if (event.target.value =1) {  // I am not sure what you are testing, but when testing for equality use double ==. I suspect that you are testing the current value of the checkbox, so it would look something like this:

if (this.rawValue == 1) {

Hope that helps,

Niall

Avatar

Level 1

Niall,

My form needs to be dynamic and extend over pages where necessary. Should i use the setFocus command then to get the buttons to navigate to the correct pages or will the same problem still exist?

R

Avatar

Level 10

Hi Reggie,

setFocus will work well if you have a field at the top of each page and that the field is one that you want the user to complete. In your case I think there are some target pages without any fields and others where the first field is at the bottom of the page. setForus script will take the user directly to that field, where ever it is on the form at runtime. The advantage currentPage method is that it lands the user at the top of the target page every time, where you have instructions.

I see you have set up the required pages to flowed, so that additional pages will be generated if the fields extend beyond the existing page.  However I would strongly recommend that you detete the extra occurrences of the same page in LC Designer. I think they you intend to have content on 13 pages, which can flow and expand onto additional pages if the user inputs more data into textFields. However the form has "21" pages in LC Designer. The additional pages are extra occurrences of the same page because the content has extended beyond the page.

For example, in LC Designer if you select the textfield on page 4 (contents page) you will see it extends onto the next page (blank). In the Layout tab the height of the textfield is 24.366cm (higher than an A4 page). If you reduce this to 21cm, it brings the field back into page 4 and LC removes the additional occurrence of page 4. The number of pages in LC drops to 20.

Once you have balanced the page numbers I think your form will work OK. The user will see the correct initial number of pages when they open the form (without blank pages) and the form will flow when textfields grow. Lastly xfa.layout.page(this) script will also work.

Good luck,

Niall