Instance Manager add subform in between 2 subforms

Hi,
i am having 3 subforms in a page.
1. My first subform is "untitle subform".  - contain button "add table" in a new subform.
2. Second is "Subform[0]" and  - contain a table
3. Third is subform[1]. - contain table
Problem : when i press the "Add table" button , the new subform (containing the new table) , create in between  Subform[0]" and Subform[1]" ,
instead after the subform[2].
Scripting (java script)
var
sSubformSOM = "xfa.form.VariableList.page2.form";
var
oSubform = xfa.resolveNode(sSubformSOM);
var
sParentSOM = oSubform.parent.somExpression;
var
sManagerSOM = sParentSOM + "._" + oSubform.name;
var
oManager = xfa.resolveNode(sManagerSOM);
if
((nMaxCount == "-1") || (nSubCount < nMaxCount)) { 
var oNewInstance = oManager.addInstance(1); 
Pls suggest a solution for this.

Hi,
As you know the binding is set in the Object > Bindling palette. You can't change the binding using script at runtime, therefore if objects have a binding Name/Normal or Global, then they will participate in the XML data processing.
I don't think you can change this in LC Designer/Acrobat. You might be able to process the XML file once you have received it.
Good luck,
Niall

Similar Messages

  • Instance manager and subforms

    I'm using a JS statement that I've found to dynamically delete subform rows when the user clicks a delete button:
    Subform.Row1.instanceManager.removeInstance(this.parent.index);
    This works if my delete button appears in Row1, like this:
    Subform
    Row1
    Button
    Field1
    Field2
    However, I'd like to wrap the button in a subform so that I can hide the button on print. My table looks like this:
    Subform
    Row1
    SubformA
    Button
    SubformB
    Field1
    Field2
    Row1 is a flowed subform so that when I hide SubformA I don't get any empty space.
    The JS statement isn't working. With my ignorant eyes it appears that instead of this.parent.index I need something like this.grandparent.index. Is something like this do-able? Any alternative ideas?

    Thank you rlunka! That did the trick. And thank you for your quick reply Paul. I didn't tell you that I was trying to get fancy by using a hidden button object and a graphic. To get the graphic positioned on top of the button, I placed them within a positioned subform.
    So my table really looks like this:
    tTravelers
    Row1
    sTravelers (flowed subform)
    untitled subform (positioned subform)
    removeButton
    image
    untitled subform
    Field1
    Field2
    FooterRow
    untitled subform
    addButton
    image
    The click event on the removeButton object looks like this:
    tTravelers.Row1.instanceManager.removeInstance(this.parent.parent.parent.index);
    sTravelers is a flowed subform, so when I hide the removeButton untitled subform (which takes up the entire row width), I don't get any blank space. Sorry if this is too much info. Now I just need to test the heck out of it.

  • Add Subform Instance

    Hi there,
    Would it be possible for someone to help with a problem I'm having trying to add a subform instance? I've looked at an example and tried to use the same method but for some reason cannot get it to work and I've no idea why! Happy to send the form if that helps.
    Any help greatly appreciated,
    Thanks.
    Ken

    //_<subformname>.addInstance(1); //is syntax do not get confused it starts with underscore followed by subform name (no need to give entire hierarchy)
    //and the number 1 in the parenthesis adds one instance if use 2 two new instances are added
    //check the example below
    // Invoke the Instance Manager to add one instance of the detail subform.
    _Section2Detail.addInstance(1);
    //Invoke the recalculate method to include the field values from the added subform in calculations.
    //add to forec the layout manager to redraw screen
    xfa.form.recalculate(1);
    if you still run into issues do email me copy at n_varma(AT)lycos.com.
    Good luck,

  • Count instances of additional subforms using instance manager

    I am familiar with using the following code in the calculate event in tables when the instance manager is used to add rows:
    this.rawValue = this.parent.index+1;
    However, I have a simple form that due to the need to expand the text field, I have used used a subform rather than table. While the instance manager works correctly, the number remains at one for each added instance.
    A link to the form is here:
    Dropbox - SMP Comments Form.pdf
    Any help would be appreciated.

    Hi,
    Using .parent only gets you to the StaticPortion object, you need to go one further up, so either use parent.parent or CommentSubform (which is the one that repeats).
    If you change your calculate event code to the following you can remove the layout:ready code.
    var count = _CommentSubform.count
    this.rawValue = CommentSubform.index+1;
    Regards
    Bruce

  • Using the instance manager to control subforms at run time

    Hi,everybody.
    I encountered a question when I put the code "subFormName.instanceManager.addInstance(1);"
    into the subForm's initialize event to dynamic create a new subForm(it's a XDP document).It create 3 new subForms below the original subForm,but when I put the same code into a button's click event or save the document as "Acrobat 7 (static) PDF Form" format,it's all right.what's wrong with it?
    I need your help.
    Best regards.

    There are some restrictions concerning what one can do in each event. I imagine that you can't add instances into a subforms initialize event. If you need three more instances to show, set the minimum on the Object Binding tab to four.

  • Add/Remove instance manager issues

    My add instance button is working as intended.
    The remove instance button is working, but not as I would like it to. The instance it removes is not necessarily the last instance added, as I would like. When "clicked" it removes the second instance listed. This is a problem when you add 5 or so instances, and need to remove the last one, and end up having to remove all of them because removing the #2 instance just messed up the order of instances.
    If this is not making sense I can show you what I'm referring to by uploading/sending interested parties the form.
    Here is the "click" event javascript code. I adopted the code from the remove instance manager example, maybe I did not convert it correctly to my form. Not sure why it deletes from the first instance down, instead of last instance up. Any help is appreciated.
    var nNumSub = 0;
    var nSubLength = Subform1.nodes.length;
    for (var nCount = 0; nCount < nSubLength; nCount ++)  {
         if (Subform1.nodes.item(nCount).className == "subform"  {
              nNumSub = nNumSub + 1;
    nNumSub = nNumSub - 1;
    if (nNumSub < 1)  {
        xfa.host.messageBox("The minimum allowable number of subforms is 1. You cannot remove any more subforms.", "Warning", 3);
    else {
         Subform1.Subform2.SubformImpression.instanceManager.removeInstance(nNumSub);
    Thank you,
    B

    Paul,
    So I want to do the same thing, but my instance manager set-up is much simpler:
    form1.QuickNoteGathering.Data.Button1::click - (JavaScript, client)
    Data.Info.instanceManager.addInstance(1);
    So what code would I use to have a button that removes the last instance added?
    Also, I want the instances to continue on to several pages if needed (i.e.: my outlay is just a small sample and one can add as many additional information layers as they need). But it all goes awray as it comes to the buttom of the first page. So I can I assure that as you click the add additional info, it will persist to as many pages as needed?
    Thanks. I can send you the form if you need me too, since there is no upload anymore to this forum.
    thanks
    Shai

  • Add Subform dynamically,on click of Button, in Interactive form generated by Adobe Document Services

    HI,
    I have an XDP file designed by Adobe Designer 7.1 with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    Now, this XDP file generates an Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI" ;
    xfa.host.messageBox( "Instances" + tmpForm.all.length ) ;
    On clicking the button, i get the length of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0,and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    Hi,
    you can't change the behavior of the save button in the browser nor in Reader/Acrobat.
    You can add a custom button within your form which calls a custom script from a folder level script using the browserForDoc method.
    The browseForDoc methos is the only one whcih can change the name in the saveAs dialog.
    Here's an example., you can run from Acrobat console.
    You need to combine it with the solution from the other thread to make it work with your form.
    http://forums.adobe.com/message/2266799#2266799%232266799
    var oRetn = app.browseForDoc({
        bSave: true,
        cFilenameInit: "MyForm.pdf",
        cFSInit: "",
    if (typeof oRetn !== "undefined") {
        this.saveAs({
            cFS: oRetn.cFS,
            cPath: oRetn.cPath,
            bPromptToOverwrite: false

  • Add Subform dynamically,in Interactive form in WebDynpro

    HI,
    I an using NW2004s SP9  and have an Interactive form designed by Adobe Designer 7.1 from within the NetWeaver Developer Studio, with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    The Webdynpro application displays the Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI"  ;
    xfa.host.messageBox( "Instances" +  tmpForm.all.length ) ;
    On clicking the button, i get the number of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0, and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    HI Dezpo,
    Thanks a lot for replying.
    I had checked the updated <b>SAP Note 834573</b> -Interactive Forms based on Adobe software: Acrobat/Reader version, which states that:
    For SAP Interactive Forms by Adobe, you require the following:
    Adobe Acrobat as of Version 7.0.9
    Adobe Reader as of Version 7.0.9
    <b>Important:</b>
    Note that you can only have limited use of Reader 8.0 for forms that, at runtime, are integrated in a WebDynpro application through the xACF technology (Active Components Framework). In this runtime environment, Reader 8.0 currently only supports static interactive forms. If you are using <b>dynamic interactive PDF forms</b>, we recommend that you use <b>Reader 7.0.9.</b> In the application, you can use parameters, or you can call methods, to determine whether you want to create a static or dynamic PDF form.
    I tried with the reader versions - 7.0.7,  7.0.9 and 8.01, but it doesn't work for either of them.
    Regards,
    Siddhartha Jain

  • Access Permissions for instances of a subform

    Is there any way to set access permissions for an instance of a subform rather than the subform as a whole? Especially for a template that has a certain number of instances saved, where only instances which have been previously saved should be access="nonInteractive" but new instances should be editable.

    Like PeeJay says, a custom window controller seems the way to go. Try creating a subclass of NSWindowController, with header something like this:
    #import <Cocoa/Cocoa.h>
    @interface MyWindowController : NSWindowController
    IBOutlet NSTextField *infoField;
    -(void)setInfoText:(NSString *)str;
    @end
    The implementation of the setInfoText would be something like:
    -(void)setInfoText:(NSString *)str{
    [infoField setStringValue:str];
    Create a nib file with your window in interface builder. Drop the header file for your custom window controller into the interface builder window. Set the custom class of the nib's File's Owner to MyWindowController. You can then hook up the window and infoField outlets from File's Owner to your window.
    In the body of your code where you open a new info window, add something like:
    MyWindowController *windowController=[[MyWindowController alloc] initWithWindowNibName:@"nameOfWindowNibFile"];
    [windowController setInfoText:@"Whatever"];
    [windowController showWindow:self];
    If you are going to have an undetermined amount of these custom window, it might be a good idea to store the window controller instances in a mutable array, rather than retaining instance variables for each one.
    Jim

  • How can I copy an Instance of a subform

    I know that it is possible to create a new Instance of a subform with the addInstance() methode. Is there a methode to copy the values of all Fields from one Instance to another (for example to a new createt Instance).

    I am not aware of any method that allow you to copy the values of fields in one instance of a subform to another subform.
    Unless, your subform fields has "default values" that pre-determined at designing time. Otherwise, individual value from one field has to be assigned to the corresponding field in the new subform at run time.

  • Reference objects within a specific instance of a subform

    Hello,
    How can I refer to a specific instance of a subform using variables
    As an example, say if I want to excute the statement,
    if (subform1[someVar].table1.row1.texfield1.rawValue=="test")
    else { ... }
    The resulting console message is:
    "section[someVar] has no properties"
    Even if I try the following,
    if (subform1[2].table1.row1.texfield1.rawValue=="test")
    The console message becomes "section[2] has no properties"
    I am certain that the property exist...
    What should I do in this case?
    Thanks,
    Dan

    Phrase Express does not work when Victors (our current project) is opened up with a Firefox Browser.
    Phrase Express is a tool that will allow a pre-typed clause to be populated onto the title (or tax) typing form. When Victors is opened in IE, the tool works perfectly. If Victors is opened in Firefox (either 2.0 or 3.0), the typing form loses focus when Phrase Express is accessed, and so the clause does not know where to go. If you use a hot key from Phrase Express (such as Ctrl-Shift-O for the degree symbol), Phrase Express does not lose focus, and can be used.
    We also loaded at different websites and saw that Phrase Express will lose focus in them when using a Firefox browser as well.

  • Resolve Nodes - For Loop - Instance Manager Please Help

    Hello,
    I made a table in lifecycle designer that uses the instance manager to add rows.
    I want to write code that will loop through each of the instances and perform a comparison.  I would like the code to examine the index field.  If the index field = 2,  then return the value of the num amount field.
    This is what I have tried so far and it does not work. 
    var
     var
    var
    oFields = xfa.resolveNodes("Subform1[*].index1");
    var     
    nNodesLength = oFields.length;
    for     (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
      if (oFields.item(nNodeCount).rawValue ==2)     {
         form1.#subform[2].Table5.Row5.NumericField1.rawValue
         = form1.Page1.Subform1.Capital1.Capital1.detail.numAmount.rawValue;}
    break;    

    Here is a more lengthy definition of my problem.   I hope someone can help. 
    1.     I have a table that will allow the user to add rows when they click the plus button.  Here is the code
    ----- form1.Page1.Table7.#subformSet[0].#subformSet[1].detailHeader2.Button2::click: - (JavaScript, client)
    _detail.addInstance(this.parent.index);
    //Invoke the recalculate method to include the field values from the added row in calculations.
    xfa.form.recalculate(1);
    2.     The table also has a button to delete rows.   Here is the code
    ----- form1.Page1.Table7.#subformSet[0].detail.Button2::click: - (JavaScript, client) --------------
    // Invoke the Instance Manager to remove the current instance of the detail subform.
    _detail.removeInstance(this.parent.index);
    // Invoke the recalculate method to update the form calculations.
    xfa.form.recalculate(1);
    3.     The table has a drop down list named txtPartNum and that allows you make a selection.  Once you have made the selection a script populates other fields in the same row. The Drop Down list contains this code:
    ----- form1.Page1.Table7.#subformSet[0].detail.txtPartNum::initialize: - (JavaScript, client) ------
    // Populate the part number Drop-down List.
    partNoScript.populatePartNo(this);
    ----- form1.Page1.Table7.#subformSet[0].detail.txtPartNum::change: - (JavaScript, client) ----------
    // Populate the description and the unit price when we change the part number.
    partNoScript.getDesc(xfa.event.newText, txtDescription, numUnitPrice, index1);
    4.     The following script populates the following fields:
    txtPartNum,
    txtDescription,
    numUnitPrice,
    index1
    ----- form1.#subform[2].#variables[0].partNoScript::partNoScript - (JavaScript, client) ------------
    // This script object controls the interaction between the part number, description and unit price fields.
    // When you fill the partNo, partDesc and partPrice arrays, make sure they have the same number of array indices in
    // each array i.e. for every part number, there should be a matching description and price.
    // Array of part numbers.
    // This script object controls the interaction between the part number, description and unit price fields.
    // When you fill the partNo, partDesc and partPrice arrays, make sure they have the same number of array indices in
    // each array i.e. for every part number, there should be a matching description and price.
    // Array of part numbers.
                         var partNo = new Array(" ",
                                                                    "Company Labor - Regular Hours",
                                                                    "Company Labor - Overtime Hours",
                                                                    "Company Engineering - Regular",
                                                                    "Company Engineering - Overtime",
                                                                    "Company Burden",
                                                                    "Subcontract Labor",
                                                                    "Subcontract Engineering",
                                                                    "Subcontract Material",
                                                                    "Subcontract Equipment",
                                                                    "Subcontract Labor & Material Bid",
                                                                    "Purchased Materials",
                                                                    "Materials from Inventory",
                                                                    "Transportation Equipment",
                                                                    "Miscellaneous Tools Shope and Garage",
                                                                    "Construction Equipment",
                                                                    "Rental Equipment",
                                                                    "Permits",
                                                                    "Legal Fees",
                                                                    "Other Miscellaneous");
    // Array of part descriptions.
    var partDesc = new Array(" ",
                                                                    "1221.9922",
                                                                    "1222.9922",
                                                                    "1221.9922",
                                                                    "1222.9922",
                                                                    "1221.9922",
                                                                    "1232.9933",
                                                                    "1232.9933",
                                                                    "1232.9933",
                                                                    "1232.9933",

  • Please help with Instance Manager

    Hello,
    I created a button that will show/hide a subform. The issue is I need multiple buttons like this. I thought changing the name of the subform in this script would allow me to use another button for a different subform. For instance, Instead of using the word Alabama I could replace it with Alaska and it would show/hide that subform. Could having multiple pages in a subform affect its functionality? Please Help!
    // Invoke the Instance Manager to add and remove the alabama subform.
    if (fAlabama.value == "0") { // fAlabama is a document variable used as a flag.
    // fAlabama = 1 when the alabama subform is displayed.
    _alabama.setInstances(1); // Add the comments subform.
    this.resolveNode("caption.value.#text").value = "Clear Alabama"; // Change the button's caption.
    fAlabama.value = "1"; // Set the flag value.
    else {
    _alabama.setInstances(0); // Remove the alabama subform.
    this.resolveNode("caption.value.#text").value = "Add Alabama"; // Change the button's caption.
    fAlabama.value = "0"; // Reset the flag value.
    Thanks,
    Venus

    When you say you are not in standalone mode, I assume you are connecting to an Oracle Management Server which is running somewhere in your network. You need to discover your node. To do this you must start the intelligent agent on the server where you have your database. Then from the OEM console select navigator from the menu bar, and then discover nodes. Next enter the name of your server. OEM will attempt to contact the intelligent agent on that server in order to get the database information.

  • Problems with instance manager and bound items

    I'm having a problem with bound fields.
    I have made a form that uses the instance manager so i can add several products,
    i'm using a button to export all this to a XML file  via XML schema but for some reason when i preview the form
    i can add new instances without problems and the original instance works ok but the second instance and all instances after that changes when anything is changed in any of them, they are in other words linked.
    Removing the xml schema made it work like it's supposed to but how do i get it to work with the xml schema?

    It sounds like your XML schema may not be properly setup to reflect the unlimited number of instances.
    <xs:element name="products">
         <xs:complexType>
              <xs:sequence>
                   <xs:element name="product" maxOccurs="unbounded">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="product">
                                       <xs:complexType>
                                            <xs:sequence>
                                                 <xs:element name="productName" type="xs:string"/>
                                                 <xs:element name="useCase" type="xs:string"/>
                                            </xs:sequence>
                                       </xs:complexType>
                                  </xs:element>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
    </xs:element>
    The element you wish to repeat should have a "maxOccurs" property that is greater than 1.  You should also make sure that your subform is properly linked to this element.

  • Best guidance for WCF instance management

    i read about  instance management from this article http://www.tutorialspoint.com/wcf/wcf_instance_management.htm
    but still do not understand when one should go for per call , per session and single instance management.
    suppose i will develop wcf service which will be consumed by 1000 client and every time traffic will be huge and also few function could be there in my service which may take long time to return response. so guide me which instance mode i should choose.
    thanks

    Hi Mou_kolkata,
      According to this case, I have shared the corresponding details below:
    1.First of all, I just summarize the key points of instance management
    (1) Per-Call Service :
    default instance activation mode of WCF
    every client request achieves a new dedicated service instance
    memory consumption is less
    (2) Per-Session Service :
    Private or confidential session is maintained between the client and a particular service instance
    the per-session service offers a new service instance which remains dedicated to each client request and autonomous of all the other instances
    (3) Singleton Service :
    all client requests independent to each other get connected to the same well-known single instance
    it gets disposed only when the host closes down
    2.For your case, I suggest you to apply singleton service .because your wcf service consuming more than 100 clients. This service is created just for once when the host is created. In case, the host is not provided with any singleton
    instance, the service returns as NULL. The activation mode is at its best when the work amount in each method call is little and no pending operations are there in the background.
    for  configuration , set like below :
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    class MySingleton : ...
    Further guidance for service code,host code & client code, you can refer in that link is enough.

Maybe you are looking for

  • G3 Pismo Powerbook and HP Deskjet 3325 Printing Problems

    The problem is that the Deskjet fails altogether to print sometimes. The error message tells me to allocate more memory to the printer. I do so but this does not help at all. I have 128Mb virtual memory turned on in addition to the built-in RAM of 12

  • Exporting files from triton le into garage / logic exp

    greetings... i'm all over the net, seeking enlightenment, as concerns exporting midi files from a '95 triton-le (no usb), into garage / logic-exp...... slow going it is, & the "one-to-one" sessions, have thus-far, proven somewot of a bust... i've no

  • Changing Architecture Design - SSRS Sharepoint Integrated Mode

    Hi. I have a multi-server SharePoint configuration I am trying to simplify and was wondering if I could get some advice here. I am not very knowledgable of SharePoint but have a good understanding of how distributed server architectures basically fun

  • Help with Java logos

    Last year, i remember getting some logos from java.sun.com. There's a lot of logos to download (eg. New,Save,Help,Cut,Copy,Paste...) But now, i just simply couldn't find it. Can anyone tell me where it is or paste the link. i desperately need it. Tha

  • Can I run Windows on iMac

    I want to get a radio control airplane simulator, but there are none avalable for Macs. Would appreciate hearing from anyone who has windows running on his/her iMac.