How to make a script dynamic while adding forminstances in a dynamic form

I have a form . Which has 8 pages (page 1-8).There is a radio button at the bottom of the page - 8 , If it's clicked as yes , then it will add an instance of Page 6,7,7&8.There are two Dropdowns in Page 6.
1st Dropdown is for Entity and the 2nd Dropdown is for State Value.Script is written on the onChange event for the Entity : Suppose a value is selected in the entity , then basing on that value some fixed valued dropdown list will appear for State field.If i add an instance for the Page 6,7,8 which is under Subform Section -1 Then the Drop Down for the State value is not working in the new instance created.I tried a lot but it's not working.Is there anyhelp for it ?
Script for Entity field
        TopmostSubform.Sub_Form_Section1.Page6.Entity::change - (JavaScript, client)
var newVal = this.boundItem(xfa.event.newText);
switch (newVal)
    case "A":
        TopmostSubform.Sub_Form_Section1.Page6.State.clearItems();
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('x');
        break;
    case "B":
        TopmostSubform.Sub_Form_Section1.Page6.State.clearItems();
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('a');
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('a');
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('c');
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('d');
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('e');
        TopmostSubform.Sub_Form_Section1.Page6.State.addItem('f');
        break;
    default:
    break;

Hi,
It is a bit awkward without the form, but basically the script does not know which page6 your are referring to. When there is a single instance of the page, it can be referenced by "...page6.State", but when there are several instances of the page, they are referenced by "...page6[0].State", "...page6[1].State", "...page6[2].State", etc.
So the task is to find out which instance of page 6 the dropdown is in and then reference that instance. You will see from above that the index is zero based, it is a good idea to include a line that will print the output (i) to the Javascript Console (Press Control+J when previewing). You can comment this out (//) or delete it after testing.
The next thing is to resolve the node when combining the page SOM and the particular instance of it (i).
So:
var i = this.parent.index;
console.println("i: ", i); // when previewing press Control+J to see the output
var currentPage6 = xfa.resolveNode("TopmostSubform.Sub_Form_Section1.Page6[" + i + "]");
var newVal = this.boundItem(xfa.event.newText);
switch (newVal)
    case "A":
        currentPage6.State.clearItems();
        currentPage6.State.addItem('x');
        break;
    case "B":
        currentPage6.State.clearItems();
        currentPage6.State.addItem('a');
        break;
    default:
    break;
It may need some tweaking, but should be close to working.
Good luck,
Niall

Similar Messages

  • How to make links in dynamic text?

    Hi All,
    I need to know how to make links in dynamic text. I have
    created a
    table to hold the dynamic copy, and the copy is added through
    a CMS page
    that I created. This Admin page is accessed through a
    browser, and I
    don't know how to attach a link to selected text within a
    browser. Can
    anyone point the way? It's probably so easy I'll feel dumb.
    Thanks,
    Brett

    "Brett" <[email protected]> wrote in message
    news:fpf7j6$23m$[email protected]..
    > Thanks Hunter,
    >
    > Yes, I suppose a legend on the admin page would provide
    a solution. And
    > ultimately, if the client doesn't feel confident doing
    writing the HTML
    > they would have to pay me to do it for them. OK, that
    works for me.
    The only other thing might be to use something like FCK (or
    one of the many
    others... ContentSeed, I think is one Murray mentions often)
    for the CMS,
    that would give an easier option for the end user. WebAssist
    has an
    FCK-based plug-in called iRite that can give a more
    wordprocessing-like feel
    to the field (i.e., they could just highlight the text and
    then click a
    button to add the link).

  • How to make reason code compulsory while processing F-53

    Hi Boss,
    Can u plz. tell me How to make reason code compulsory while processing F-53. this is because I have defined differnet reason code and one is having blank text.
    Thanks
    S

    hi,
    Just check this one dont check previous one....
    goto TCODE OBC4 and then click on ur company FELD status variant and double click on field status group ....
    Then click on G067 RECONCILTION ACCOUNTS and then double clickn that in that and then click on payment transactions and then select REASON CODE AS REQUIRED.
    ur problem will solve...
    if useful assign points
    regards,
    santosh kumar

  • How to make the screen dim while music is playing

    I can't get the screen to dim while playing music on my iPod Nano.  It used to be that the screen dimmed while music was playing until it lit up when I hit a button to change volume, track, etc.  This preserved the battery life.  It seems that I inadvertantly changed some setting just a few days ago because I saw the apple logo appear on the screen and since then have not been able to figure out how to make the screen dim while playing music.  I think the fact that the screen is staying on while I'm listening now is making the battery out very quickly.  Does anyone know how to solve this problem?  Thank you!

    Hello ZingMA,
    You need to reset the backlight timer.
    Go to settings, general, and backlight. You should be able to set if from there. I am assuming you have a 6th gen nano. If you have a different model the user manuals have the steps. Found here:
    iPod nanos
    Hope this helps.
    ~Julian

  • How to make UOM as mandatory while creating PR in ME51N

    Hi all,
    While creating PR, UOM is not populated automatically. The PR also created without entering UOM.
    So, here UOM is optional. how to make this UOM as mandatory while creating PR in ME51N?
    Thanks
    pabi

    Hi Pabitra
    Go to SPRO>Materials Management>Purchasing>Purchase Requisition>Define Document Types ( CHECK which type of field selection is assigned to your PR Document type)
    and then go to
    Go to SPRO>Materials Management>Purchasing>Purchase Requisition>Define Screen Layout at Document Level>select that field selction here eg NBB  then go to details, then double click Quantity and Price ( Filed selection group) there make filed label Unit of measure as Required quantity
    and then  slect the filed selection ME51N and do the same settings as above.
    Cheers
    Kris

  • How to make powershell script.

    How to make script that copy content from notepad to other notepad and reverse the text?

    If you mean a .txt file then there's three aspects to your question.
    Open a file and read the text
    Reverse the text
    Save the text into a new file
    For point one, this technet article is good:
    http://technet.microsoft.com/en-us/library/ee692806.aspx
    For point two you could turn the text into one or more strings, then convert those into arrays, loop through them and then re-assemble them. This article shows you most of that:
    http://technet.microsoft.com/en-us/library/ee692804.aspx
    And finally you need to save that text as a file, there's lots of ways but the Out-File cmdlet is the simplest.
    This might also be of use:
    http://www.ehow.com/how_7174023_write-basic-powershell-script.html

  • How to make a script for expand column width

    Hi experts,
    Is that possible to make a script for expand the column width aim to let the columns show up all the overset text?
    Regard
    John

    Hi John,
    As Uwe advised it would be wise to put a stop on any while loop in case the condition is never fulfilled which would mean the script will break.
    Without knowing what specifically you are working on you could make the below amendments to do this.
    myTables = app.documents[0].stories.everyItem().tables.everyItem().getElements();
    for (var t = 0; t < myTables.length; t++) {
        BE_resizeColumnsToFitContents(myTables[t], 200);
    function BE_resizeColumnsToFitContents(tableToEdit, tableMaxWidth) {
        for (var i = 0; i < tableToEdit.columns.length; i++) {
            while (tableToEdit.columns[i].overflows === true) {
                if (tableToEdit.width < tableMaxWidth) {
                    tableToEdit.columns[i].width += 1;
                    tableToEdit.columns[i].recompose();
                else {
                    alert("Column " + i + " contents too large for column.");
                    break;
    I won't put any extra functions in this because it might not be what you're after. To use this you just define the table width as a second argument to the function (but you could change this parameter to something else, like page, column or cell width). And, if you want to have a fail action you just put it in the 'else' part.
    Brett

  • How to make AE script folder?

    Hi, i want to ask something about script in after effect CS6. I have many script in my AE and I think its quite difficult to find the script i want. So, how to make script folder in AE or maybe group of script? So if I want to use the script i can find it easier....
    Thank you and sorry for my bad english...

    // create a new FolderItem in project, with name “comps”
    var compFolder = app.project. items.addFolder(“comps”);
    AE CS3 Scripting guide, page 78

  • How to make automatic counting number while printing

    i've create an Order Form using InDesign then i want to print it.. how to make increase document number run automaticaly while printing?? thx for your help

    Form numbering can be done in a variety of ways. For high volume jobs (or small jobs, too if you happen to own a numbering machine) the numbers are often printed separately after the forms themselves are printed.
    The next most efficient method is to use a printer with variable data capabilities that can pull the numbers from an external file and add them to the print job as it runs.
    The only way to do it directly in InDesign is to make a multipage file -- one page for each number. To do that you will need a list of numbers as a text file, one number per line. You can use this file either for a Data Merge or you can place it like any other text file. Which method is best will depend on the job itself. In either case, I would recommend putting all of the repeating text on the master page. For data merge, leave a hole where the numbers belong and apply the master AFTER you do the merge. For placing, include a frame to hold the number on the master page, apply it to page one, and use autoflow.

  • How to make a graph dynamic data driven? Plus some XML basics for Illustrator?

    I need to make some graphs that are linked to a series of data through XML files (originally Excel) and create an indvidual document for each data set. They will be used for the web and print. Please advise.

    Tis is what you can do you create say your chart or your data say in Excel and you export ast Tab Delineated Text.You can then import that data for a chart with the import chart feature it is the first icon on top of the chart data window then you can make the chart dynamic asa variable and capture the data set then import another chart's data as txt as you did before then capture that as a data set abnd so on if you have then ten data sets each one will correspond to the one you need you can name the data sets so you can easily call up the one you need.
    I never made a chart in excel or imported such data before a few minutes ago nor have I a=ever made a variable of a chart but this all works pretty reasonably.
    More advance than this I would have to experiement but you can export the variable libraries and open them in Illustrator and figure it out for a way to load or export the excel info so it opens as a chart in Illustratorbut Illustrators charts are kind of primitive so donot expect much without a script to help you.
    Perhaps you can figure out an actiopn toautomate the process?

  • How to make a script to convert RGB to CMYK as black 100%?

    Hi guy
    my customer sent me a book (144 pages) for print but all of them are RGB and Tiff, she scan them. there are on the page some texts and pictures. The text are R=30 G=30 B=30.I think if I can make a script I will do it very soon to black 100%, but unfortunately I dont know anything to make script 
    anybody can help me ?anybody can make it for me ?

    We need to know some more information.
    1. The book consists of 144 pages, and each page is in fact an RGB image in TIFF format.
        Correct?
        That means, the text is already rasterized, but with low resolution (no more than 300ppi).
        A very bad starting point, in my humble opinion. For offset printing this is not acceptable.
    2. Is the printing process offset printing or by digital printing?
    Nevertheless we may think about a conversion of these images into CMYK K-only (one plate
    per page) . 
    a) Increase contrast until R=G=B=0 for text.
    b) Convert each image into Grayscale, using a so-called Black-Ink-Profile, for instance
        Black-Ink-ISOCoated-v2-eci (can be explained later)
    c) Make empty CMYK image, here for  ISOCoated-v2-eci, and paste the Grayscale into the
        K-channel. All further handling happens as CMYK file for the process ISOCoated-v2-eci.
        Void plates CMY don't matter.
        Post #12 here:
        Re: Colour shift (from CMYK = 0 0 0 20 to Grayscale K = 22 !)
    All this can be done by an action (I hope so...).
    Much better would be a new start by InDesign with typographical text (K-only vector instead of raster)
    with images in RGB or CMYK, taking into account the intended process.
    Note: Photoshop can deliver vector text, if exported as PDF.
    Best regards --Gernot Hoffmann

  • Launchd: how to make a script run every weekday?

    I'm trying to make a script run every weekday as a LaunchAgent. Is there a way to do this like you could in cron?
    Here is the relevant portion of my LaunchAgent plist:
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>9</integer>
    <key>Minute</key>
    <integer>0</integer>
    <key>Weekday</key>
    <integer>3</integer>
    </dict>
    I have tried changing the Weekday integer to 1-5 or 1,2,3,4,5 but neither worked. It only works with a single integer. Do I have to create 5 separate plists for each weekday?
    Any ideas?

    Thanks VK, for others who are looking to do something similar, here is the relevant part of the code to make the command run every day (since that field is missing) at 7:00pm and 7:01pm:
    <key>StartCalendarInterval</key>
    <array>
    <dict>
    <key>Hour</key>
    <integer>19</integer>
    <key>Minute</key>
    <integer>00</integer>
    </dict>
    <dict>
    <key>Hour</key>
    <integer>19</integer>
    <key>Minute</key>
    <integer>01</integer>
    </dict>
    </array>

  • How to make a script for find text object?

    Hi everyone
    I want to make a script for find and select text object and then find next, find next, and so on, but without any open dialog
    Is that possible make a script for this?
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "(\[\x{2022}\])|(\x{25CF})";
    app.findGrep();
    thanks
    Regard

    You already have that. A script does not 'find, select, find next' - it finds all texts as soon as you execute the 'app.findGrep' command.

  • How to make a script for a terminal command

    I need to find instructions on how to create a script to automatically run the following Terminal command;
    Sudo chmod 755 /private/var/spool/cups. It will also need to include the admin password as you will be prompted to enter it after the command line is entered. Apparently the only way to get Quark 7 to print adobe pdf's is to open a terminal window and type the command every time the machine is rebooted. This is a temporary fix and I do not want the MAC users to have to type the command.
    Thanks
    Sal

    This Script works here. Get you the error, when you save or checks the syntax?
    When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.
    The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

  • How to make this script work

    Help me to make this script work, please!
    function(){
    app.findGrepPreferences.firstLineIndent  = "8 mm";
    app.findGrepPreferences.leftIndent  = "8 mm";
    app.changeGrepPreferences.firstLineIndent  = "8 mm";
    app.changeGrepPreferences.leftIndent  = "16 mm";
    app.selection[0].changeGrep();
    app.findGrepPreferences.leftIndent  = "16 mm";
    app.changeGrepPreferences.leftIndent  = "24 mm";
    app.selection[0].changeGrep();

    Hi,
    Its already replied, see below code:
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.firstLineIndent  = "8 mm";
    app.findGrepPreferences.leftIndent  = "8 mm";
    app.changeGrepPreferences.firstLineIndent  = "8 mm";
    app.changeGrepPreferences.leftIndent  = "16 mm";
    app.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    First run the above code, again you want to change leftIndent from '16 mm' to '24 mm' run below code:
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.leftIndent  = "16 mm";
    app.changeGrepPreferences.leftIndent  = "24 mm";
    app.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    by
    hasvi

Maybe you are looking for

  • How do I save a bookmark on the list to a specific folder?

    I have amassed a collecti0n of over 1000 bookmarks. is there a tutorial anywhere to learn how to manage those bookmarks. Like in: a.keep them under specific folders... what are the steps to move a bookmark to the inside of a folder. or ... b.list the

  • Upgrade 9.2.0.6 to 9.2.0.8

    My Current Environment is: Database: Oracle 9.2.0.6 RAC on RAW DIVICES. OS: AIX 5.1 Storage: Shark Applications: Cognos, Informatica, OTM 5.5 We are planing to upgrade as below: OS: AIX 5.1 -> AIX 5.3 Database: Oracle 9.2.0.6 -> 9.2.0.8 RAC on Raw Di

  • Weblogic managed server crash and automatic restart on Solaris SPARC platform

    hi Everyone, We are facing a problem a problem with Weblogic managed server where the managed server crashes and automatically restarts (via nodemanager) on Solaris SPARC platform. The system info is as below: OS:                            Oracle So

  • Can't Restore my iPod?

    I just plugged in my shuffle to add a few songs, and it told me that I needed to restore it to the factory setting, which makes sense, since I had used it as a data storage system earlier today. But I went to look in iTunes 7 to do just that, and it'

  • Help in POSTING_INTERFACE_CLEARING

    Hi, Somebody Know how Function POSTING_INTERFACE_CLEARING works or maybe If  there are any function which works like POSTING_INTERFACE_CLEARING . I will appreciate your help