Spawning pages with page numbers "page 1 of 1"

I'm using a calculation script to define "page 1 of 2" in a form. The script is as follows.
//set the page number to number 1
this.pageNum = 1;
//use the page of page format
event.value = "Page " + (event.target.page+1)+" of " + (this.numPages);
This works fine, however, when I start spawning pages the numbers get mixed up. For example, if I spawn one page, the "page 1 of 1" on page one changes to "page 1 of 2." On page two, it reads "page 0 of two." I just can't seem to get the "page n of n" to work with spawned pages. Any suggestions would help.
Thank you

For each page's field number page you need to go to that page in the calculation script. You could also turn off calculations during the spawning of the pages and then turn it back on and recalculate the form.
// code to spawn template;
// turn off automatic calculation;
this.calculate = false;
var t = this.templates;
var T = t[0];
T.spawn(this.numPages, true);
// trun automatic calculation back on;
this.calculate = true;
// force recalculation;
this.calculateNow();
// end spawn template;
// custom calculation script for numbering pages;
var cField = event.target.name;
var aField = cField.split(".");
if(aField.length > 1) {
// get page number for form field from field name & go to that page;
this.pageNum = aField[0].substr(1,1);
// update field's value;
event.value = (this.pageNum + 1) + " of " + this.numPages;
// update field's default value;
event.defaultValue = event.value;
// end custom calculation for numbering pages;

Similar Messages

  • Replace the standard page with the customised page.

    how to Replace the standard page with the customised page.?

    Hi,
    I am not cleared with your requirement. However u can try this:
    Check if your standard page is attached with some function.
    You can then create a new custom function, attach that with the same responsibility as that of standard one. Thus u can access your custom page.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Import multiple Word docs to multiple pages with same master page?

    Hi, I should start by saying I have no scripting experience.  However, I am wondering if there is a simple script available for the following issue:
    I have set up a master page with three linked text boxes. Right now, I use Cmd+D to select a word file, and then Shift+click in the first box to place the text on the page. But I have 125 pages that are exactly the same layout, just different Word files to be imported. I could repeat this process 125 times, but I am wondering if there is a way to tell InDesign to create 125 pages using Master Page X and import one file for each?
    I am using InDesign CS5 v 7.0.4 on Mac OSX Snow Leopard v 10.6.7
    Thank in advance for any help you can offer,
    NW

    I was able to import the word documents as long as there was only one text frame on the master page. However, when I created multiple text frames (the text in the word document needs to flow from frame 1 to frame 2), it always imported into frame 2 and skipped frame 1. In case it is helpful to understand what I mean, I attach two screenshots. The first (sans text) is the master page, and the second is Page 1 after running the script. I added the labels Frame 1 and Frame 2 to Page 1, not the Master, because otherwise the text gets imported into the frame with the words "Frame 2". I suspect I have to label the frames in InDesign and then add something to the script that says insert into the Frame 1, but I'm not sure how to do that.
    It wasn't clear from your narrative in June that the text frames were linked, and that the text needed to flow between frames.
    The script, as implemented, only overrides one text frame, (textFrames[0],  which is the top-most text frame in the stacking order), and then places the text in it. Clearly that's not correct for your scenario.
    You mention 3 frames but only mention flowing between 2 frames.
    Anyhow, it sounds like you want the script to override all 3 text frames, and then to place in the first textframe.
    The first is easy, the question is really what should happen when there are more than 3 text frames -- should it override all text frames, or only some. You could specify which ones with a Script Label, or you could do something more clever. For the moment, let's just override all text frames.
    Then you have to specify which one to place into. You could just select the frame you want and Arrange > Bring To Front. Or we could specify frames[2], which should be the 3rd-from-the-top (after frames[0] and frames[1]). I'll do the latter, but feel free to keep the script the same and do the former:
    var
        d=app.activeDocument,
        p=d.pages,
        i, frames;
    for (i=0; i<p.length; i++) {
        frames = p[i].appliedMaster.textFrames.everyItem().override(p[i]);
        frames[2].place(new File("/path/to/page"+p[i].name+".doc"));

  • Need to restrict the form into one page with out second page in SAP Script

    Hello Friends,
    I have a query in SAP script form, I had created one form for confirmation request for FI, i had copied the standard form F130_CONFIRM_01 and made the changes as per the requirements and checked in f.17 which was perfect. I had removed all the lines except wherever the changes i had made in the form.
    Here iam getting one problem, when iam printing the confirmation request it should give me in one page but here iam getting two pages of which one page iam getting the complete information and the second page iam getting the empty page.
    It should not give the second page. i also checked by giving the condition if &page& eq 1  but no difference iam getting two pages.
    Pl. let me know how to solve this problem since this is very very emergency issue.

    Hi Mark,
                  If i am not wrong is this Tcode for customer/vendor balance confirmation? In the standard script that u mentioned, the first page id the letter, and the second page contains the balance sheet.You would not be able to restrict the blank pages from coming, coz there are in all three scripts configured for the TCode F.17, so the blank pages are bound to come, even if the conditions for pages are maintained. I have faced similar problems in my development too....
    Thanks & Regards
    Nayan
    SAP Consulatant.
    Reward with points if useful

  • Is there any way to to have the "Home" icon open a new tab instead of replacing the current page with the home page?

    I would prefer that the "Home" icon on the Navigation Toolbar open a new tab instead of replacing the current tab with the home page. Is there any way to accomplish this?
    Thank you.

    If you middle-click on the home icon it will open a new tab containing the home page.

  • Two Master pages with two design pages

    Hi All;
    I need a help in the below scenario;
    - I have two Master pages wid different header title and other information which I required for two different body pages.
    I need to assign the 1st master page with all content of first page data (both design pages will display table data).
    so the first page display should start with 1st master page  and 1st body and after finishing the content of first table..
    2nd master and body page starts with the content of 2nd table..
    The issue is I am getting one extra page when I am checking design pages
    Please let me know your valuable suggestion.. Helpful answer will be highly appreciated !!!
    Regards
    Devraj
    Edited by: Dev on Aug 20, 2010 4:36 PM

    HI Otto,
    I am also facing similar problem,
    I too hv 2 master pages and 2 body pages respectively.
    first master page assigned to first body page
    and second master page assigned to second body page.
    But still i am able to view one extra body page in my design view.
    Kindly help.

  • Printing blank page with every printed page

    I have a C7280 printer, and it has been working fine.  However, it now sends out one blank page for every printed page.  any ideas on why this is happening and how to fix it? 
    thanks.

    HI,
    You might try using this print diagnostic utility to see if it helps solve your problem.
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=mp-82717-1&lc=en&dlc=en&cc=us&...=
    There are several solutions within the utility that fixes several printer issues.
    Say Thanks by clicking the Kudos Star in the post that helped you. Please mark the post that solves your problem as Accepted Solution.
    I am employed by HP

  • I need help with the numbering pages in a book file

    I have a 53 chapter book that which each chapter is its own document. It used to work great. The page numbers of each document used to continue from the last page number of the previous document. That was until today when I opened it and all the page numbers now start at one. I don't know what to do. I have checked all of the options I knew to check. Each document still has the 'automatic page numbering' option selected. I truly don't want to have to go through and manully renumber every document. It will take time I do not have. If I can get somebody's help, it would be wonderful.

    Nor do I. It sounds like everything is set correctly. You might want to try creating a new Book file and add the individaul documents into it and see if that fixes things. Also, have you tried updating the numberingfrom the menu since this started?

  • I am trying to use the embed tag - to embed an html page with in a page embed src="page.html" /

    <pre><nowiki><!DOCTYPE HTML>
    <html>
    <body>
    <embed src="page.html" />
    </body>
    </html></nowiki></pre>

    The <embed> tag works in Windows IE 9, and Opera, Now! But not in Firefox yet. Whats up with that? I guess we will see who is going to be left behind.

  • "Errors on page" with simple JSF page

    Hi
    I wrote a very simple JSF page as shown below. It works as is with MyFaces. Now I tried to make it work with Sun RI as well.
    Here's the problem: The page appears perfectly fine (it shows two columns of links). Only one single link works, though: the first one in the left column.
    When I click on that first link, the action handler method ("userClick") is called and executed fine.
    But when I click on any other link, the method is not called at all. All I get is an "error on page" message in the browser status bar. No log message on the command line or log file.
    Am I doing something wrong? With MyFaces it works fine.
    ===============================
    Here's the page:
    ===============================
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
         <f:loadBundle basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" var="bundle" />
         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
         <html>
              <head>
                   <title><h:outputText value="#{bundle.menu_frame}" /></title>
                   <link rel="stylesheet" href="style.css">
              </head>     
              <body>
                   <h:panelGrid border="1" columns="2" columnClasses="td">
                        <h:dataTable value="#{MenuBackingBean.menuTabItems}" border="0" var="menuTabItem" >
                             <h:column>
                                  <h:form>
                                       <h:commandLink action="#{MenuBackingBean.userClick}" >
                                            <h:outputText value="#{menuTabItem.itemName}" />
                                            <f:param name="itemID" value="#{menuTabItem.itemID}" />
                                       </h:commandLink>
                                  </h:form>
                             </h:column>
                        </h:dataTable>
                        <h:dataTable value="#{MenuBackingBean.menuItems}" border="0" var="menuItem" >
                             <h:column>
                                  <h:form>
                                       <h:commandLink action="#{MenuBackingBean.userClick}" >
                                            <h:outputText value="#{menuItem.itemName}" />
                                            <f:param name="itemID" value="#{menuItem.itemID}" />
                                       </h:commandLink>
                                  </h:form>
                             </h:column>
                        </h:dataTable>
                   </h:panelGrid>
              </body>
         </html>
    </f:view>
    ==================================
    Here's the faces-config
    ==================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config >
         <application>
              <locale-config>
                   <default-locale>en</default-locale>
                   <supported-locale>en</supported-locale>
                   <supported-locale>de</supported-locale>
              </locale-config>
              <message-bundle>ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle</message-bundle>
         </application>
         <managed-bean>
              <managed-bean-name>DetailsBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.DetailsBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>MenuBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>ContentBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.ContentBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/menu.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showDetails</from-outcome>
                   <to-view-id>/details.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>menu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/details.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showMenu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>showContent</from-outcome>
                   <to-view-id>/content.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/content.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showMenu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    =======================================
    I don't think I need to show the backing bean with the userClick() method since the error is that this method is not even called (I added a system.out.println() to this method - which is never executed)
    So the problem must be before
    BTW I am using Sun RI 1.1.01 as shipped with the MyEclipseIDE extensions.
    Thanks a lot for your very much appreciated help
    scrut

    The problem is that you have two forms. Put a single form.

  • How change default hom page with my application page

    Default home page is open with link http://localhost:8080/apex/ .
    I need to type http://localhost for open open my application .
    Thanks,

    Another option since Oracle10g XE does not come with Apache, you can replace the License page (index.htm) with this HTML code to automatically route you from http://localhost to http://localhost/apex/
    <HTML>
    <HEAD><META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/apex/">
    </HEAD>
    <BODY>
    </BODY>
    </HTML>
    You do this by replacing the index.htm found in the base directory when you ftp to the XE database. Also, to change the port from port 8080 to port 80 run
    SQL> exec dbms_xdb.sethttpport(80);

  • None of my Pages, Keynote, or Numbers pages will open.

    I have the latest versions of Pages (5.2.2), Keynote (6.2.2), and Numbers (3.2.2).  I cannot open any of my documents.  I get the message:
    The file "whatever.document.pages" couldn't be opened.
    If I try to create a document, say, in Pages.  It lets me created it, but when I go to exit, it prompts me to save the document (which is weird), and when I name the document and hit save, it says
    The file "untitled.pages" couldn't be opened.
    Very frustrating.  I have these apps installed on my iPad Air, and they work fine between my iPad and iPhone (4s), it's just on my iMac that I can no longer use any of these apps!

    About the new iWork for Mac- Features and compatibility
    iWork for Mac- Importing and exporting iWork '09 documents

  • Blank page with multiple group page breaks

    Hi There,
    I have a report with 3 groups. I have a page break after the footers for groups 1 and 3. I use the "Not OnLastRecord" to prevent the report generating a blank page. This work absolutely fine if we are dealing with a single group, but as there are multiple groups it seems impossible to get rid of this superfluous blank page.
    Been struggling on this one for a couple of days so any help would be hugely appreciated.
    Best regards
    Stuart

    Ok I managed to fix this in the end.
    Solution: I suppressed much of the grouping functionality which was primarily used for aggregating totals, and instead used running total farmulai.
    This appears to have done the trick.
    Regards
    Stuart

  • How do I replace my index (Home) page with a new page?

    My iWeb site has a "Home" page as it's default index page. I renamed the page "Home4" and created a new "Home" page in hopes that the new page would become the default page. Nope, it still goes to "Home4".
    Next, I tried deleting Home4, now I just get an error message when trying to go to the site.
    I should mention that I deleted the Home4 page through the MobilMe website, not in iWeb. I see that there is an index.html file in the site directory which I "assume" is a redirect to what iWeb considers to be the "Default" page. But, I see no way to edit or even view the contents of the index.html page.
    How do I create/replace an index page?
    Message was edited by: GoldwingTX

    Bonjour
    Your new home page need to be the first one at the top of the sidebar of iWeb.
    Publish
    iWeb will build a new index.html which redirects to the new home page
    Safari > menu bar > Safari > Clear the cache of your browser before visit your website

  • I'm unable to open files I've created in the new pages with the new pages. It tells me to update my pages

    Is anyone else having this problem? I've updated pages and when I try to open files I created, it tells me to update pages

    Trash Pages 5 and go back to Pages '09 which should still be inside the iWork folder inside your Applications folder.
    Then let everyone know in the App Store what a stellar (singular) App Pages 5 is.
    Peter

  • Iweb 08 - how can i replace a single published page with an updated page?

    At the moment, I find that I have to publish all four of my sites everytime I make a change to a single page.
    Is there a way I can publish a single webpage and replace it via the ftp?
    I'm sure I'm doing this wrong but can't seem to figure out why.

    See Chapter 2 here.

Maybe you are looking for

  • How can I permit all traffic from inside-dmz-outside on asa5505

    Scenario : Servers are in DMZ, Internal LAN Users should access ports Specified (5000 & 2048). Router 2801 is facing Leased line; from there it’s connected to firewall. Router LAN IP: 83.111.X.X - 255.255.255.X ASA Version 7.2(4) hostname ciscoasa do

  • Is there a way to define a layer for dynamic objects?

    Hi all. Basically, I'm creating a number of dynamic text field objects in my Actionscript, but it looks like its being rendered on the wrong layer. I've written the actionscript in the first frame of my 3rd layer (which is masked), but the objects th

  • Payment terms field display at MIRO screen

    Hi, How can I make Payment terms field "Display" at MIRO screen?? Regards, Sattuj

  • How to attach java program with CRM OD

    Hi i have a java program that i want to attach with CRM OD user interface so that i can run it on the press of a button or through any other way. Please suggest me some way to do this.

  • ADF Deployment on OC4J11g

    Hi, I have created a small application using Toplink and ADF-RC. When I run the application I am getting the below error... oracle.security.jazn.JAZNRuntimeException: JBO-34010: The "model/DataBindings.cpx" descriptor appears in the application class