InstanceManager problem

Hello

I am trying to add subform using instanceManger.addInstance (true); in a button click event. But subform/instance is not added.

I created a sample POC and attach a screenshot. Please let me know the question why I am not able to add the subform.

InstanceManager.JPG

concerning

Sunil

Hi Sunil,

A few reasons, I am not able to send you your form. But see the solution below:

(1) set the "Subform1' link of the property:"Repaeat subform for each data Item.

That would solve your problem.

In addition, you must set your page 1 of flow content. If this isn't the case, when you add instances more your instances beyond the button submit without moving the button down.

Thank you

VJ

Tags: Adobe LiveCycle

Similar Questions

  • Dynamic table count (removeInstance problem)

    Hello guys,.

    I am trying to create a table that has a column with auto-numbering (a kind of index). Each line has an addition / removal of button and every time I have add / delete a line, a desire to recalculate the index column because I want to order.

    Everything works fine when I add rows to the table, but when I try to delete a line, I can't recalculate lines indices, Livecycle throw again a very generic exception "GeneralError: operation failed."

    The code I use is as follows:

    Form1. #subform [0]. Table1.Row1.Subform1.Add::click - (JavaScript, client)

    rowNum var = this.parent.parent.index + 1;

    this.parent.parent.instanceManager.addInstance (rowNum);

    for (i = 0; i < this.parent.parent.instanceManager.count; i ++) {}

    xfa.resolveNode ("Row1 [" + i + "]"). Cell2.RawValue = "" + (i + 1);

    }

    Form1. #subform [0]. Table1.Row1.Subform1.Remove::click - (JavaScript, client)

    Try

    {

    rowNum var = this.parent.parent.index;

    this.parent.parent.instanceManager.removeInstance (rowNum);

    for (i = 0; i < this.parent.parent.instanceManager.count; i ++) {}

    xfa.resolveNode ("Row1 [" + i + "]"). Cell2.RawValue = "" + (i + 1);

    }

    }

    catch (Err)

    {

    App.Alert (Err);

    }

    I noticed that whenever I do a removeInstance, each operation that I do at the level of the table gives me this exception. I am a newbie of Livecycle is possible I'm missing something very basic here...

    If you want to take a look at what I'm talking about, I have shared here http://wikisend.com/download/616276/test_dynamic_numeration.pdf

    Any help will be much appreciated

    Thank you!

    Ok

    I found a solution using the event layout: loan here

    https://Acrobat.com/#d=tdpzltrl25yU2PkvgaQO9w

    One less problem

  • My interactive form is a hot mess (several problems with javascript and formcalc)

    I have worked on a report form of dynamic loads for our society, but have met with a number of problems. I would appreciate help on one of them!

    Problem 1:

    Last subform: table 4 (Miscellaneous) - this subform does not force the footer (signature, comments) section as other subforms do downstairs. The painting is in a subform positioned within a subform flowed. 3 other tables have no problem pushing data down.

    Problem2:

    The button "-" on the tables (to subtract a line) USED to work, but now are not. The button "-" on EACH table is broken.

    Problem 3:

    Add line still works fine on most of the tables (with the exception of the final table, MISCELLANEOUS charges). If I add a few lines of the last subform apparently stops working altogether past tier 3 buttons. Add 2 lines to the final table (miscellaneous charges) to see what I mean. It seems to me that this problem is probably related to problem 1 somehow.

    Problem 4:

    Cannot get GRAND TOTAL working little matter what I try.

    I downloaded my work in progress here: www.essential-equipment.com/pdf/ExpenseReport.pdf

    If anyone can help me I would be very happy.  Also, it would be difficult to make this form capable of carry over to a new page?

    Thanks in advance to anyone who helps

    Hello.

    Problem 1:

    The subform of deviations "Table4Subform" is not set to automatically adjust to the height.

    Problem 2.

    The removal script is in a complex way, use this script instead:

    if (this.parent.parent.instanceManager.count > 1) {
              this.parent.parent.instanceManager.removeInstance(this.parent.parent.index);
    }
    

    Problem 3:

    Remove the grouping 'Body', then the subform flow crrectly on the next page.

    Problem 4:

    The benchmark for total fields are not correct, this is why the grand total script fails.

    Change in:

    Sum(Table1Subform.Table1.FooterRow.Total1, Table23Subform.Table2.FooterRow.Total2, Table23Subform.Table3.FooterRow.Total3, Table4.FooterRow.Total4)
    
  • Dynamically add the instanceManager text value to instanceManager another

    Hello

    I have a dynamic form that has two subforms with instanceManagers. One is called options, and another description. Subform 'options' has a button that adds an instance both "_options" and «_description» InstanceManagers

    I click the button twice so I have three instances of each. Each instance of "_options" has a field OPTION, and each instance of '_description' has a DESCRIPTION field. I want to write code that will automatically set the text value of the OPTION to the value of the DESCRIPTION text.

    example:

    -options

    -OPTION (input field)

    -descriptions

    -DESCRIPTION

    Click

    Click

    -options

    -OPTION (1)(input field)

    -OPTION (2)(input field)

    -OPTION (3)(input field)

    -description

    -Description (1)(input field)

    -DESCRIPTION (2) (field)

    -DESCRIPTION (3) (field)

    fill option fields

    -options

    -OPTION (1)(rawValue: the soup is good)

    -OPTION (2)(rawValue: soup really sux)

    -OPTION (3)(rawValue: soup is ok)

    and here's my problem - how do I get these values for the other instanceManager? I have a code that does not work, but I don't want to offer something. Please, help me, I am struggling with this instance of reference bs for awhile

    You must use xfa.resolveNode to analyze the number of index levels.

    I just did a quick test with a few tables on the output of a field event in Table1, I put a corresponding field in Table2 to the same value. Works the same with subforms.

    xfa.resolveNode ("Table2.Row1 [" + this.parent.index + "]"). TextField1.rawValue = this.rawValue;

    Depending on how many levels deep into the repeating subform your domain is that you will need to play with the 'this.parent.index' to get the path to the repeating subform (this.parent.parent.index, etc.).

    Hope that's what you're looking for!

  • Slight problem with removeInstance

    I have a form with repeating subform. The coding I have used for the button 'Add subform' is;

     topmostSubform.ContinuationSheet.ButtonAddSheet::click - (JavaScript, client)
    ContinuationSheet.instanceManager.addInstance(1);
    ButtonReset.presence = "hidden";
    ButtonSaveAs.presence = "hidden";
    ButtonPrint.presence = "hidden";
    ButtonAddSheet.presence = "hidden";
    

    When you press the reset button, it is supposed not only to reset all of the form data, but also reset the counter of subform to 0. The coding that I use for this is;

     topmostSubform.ContinuationSheet.ButtonReset::mouseUp - (JavaScript, client)
    xfa.host.resetData();
    while (ContinuationSheet.instanceManager.count > 0)
    {
        ContinuationSheet.instanceManager.removeInstance (1);
    }
    

    Everything works as expected, for the most part. The only problem I encounter is that the buttons in the original subform remain hidden. I tried a lot of different scripts to try to make them see the upward, but nothing helped. Any help would be much appreciated.

    Yes like I said it was just a quick idea. The code should be more based on audit for the last instance and then display but not displaying not if this isn't the last instance.

    Then why are you hiding the buttons instead of just let them float after repeating subforms? You could have buttons in their own subform that lives inside the cast a subform, but outside the repeated instances so that it always shows upward at the end.

    Ah, I think I got it:

    If (this.parent.instanceIndex == this.parent.instanceManager.count - 1) {}

    This.Presence = "visible";

    }

    else {}

    This.Presence = 'hidden ';

    }

    You must subtract one from the County, because it is 1-based, but the index is 0-based.

    Tested and it seems to work ok. You may need to play with the 'parents' (this.parent.parent... etc.) depending on how buried the subform and hold the keys. If you leave them in a subform, and then you could put this code in the subform that contains the buttons instead of on the buttons themselves.

    Oh and I put that on the layout event: loan.

    Post edited by: Jono Moore - added event info

  • Problem with a menu drop-down dynamics based on instances of subform

    I'm having a problem with a dynamic drop down based on instances of subform.  Here's my question:

    Subform1 = value 1 and is repeatable
    Subform2 = Subform1 to 1 and is repeatable
    Subform2 = value 2 to Subform1
    Subform2 = value 3 to Subform1

    Subform1 = value 2 and is repeatable
    Subform2 = Subform1 to 1 and is repeatable
    Subform2 = value 2 to Subform1
    Subform2 = value 3 to Subform1

    I can fill my first run down the 1 subform values by the following:

    var nCount = Subform1.instanceManager.count;
    Console.println ("nCount:" + nCount);


    for (var i = 0; i < = nCount; i ++)
    {
    var vFld = xfa.resolveNode ("Subform1 [" + i + "]");
    vVal var = vFld.Val.rawValue;
    this.addItem (vVal);
    }


    It gives me 1 (Subform1) value and the value 2 (Subform1)

    I'm now trying to fill a second drop down based on this drop down selection.

    For example:

    If the value 2 (Subform1) is selected in the drop down, I want the secodn drop-down is populated with the value 1 (Subform2) and the value 2 (Subform2) and 3 (Subform2) value for 2 value Subform1.

    I appriciate any help I could get on it.

    Thank you
    Eagle

    Hello

    Ah ok, so I think that it's the one- https://acrobat.com/#d=nddInIuQUwXMY8ciRPoOfw

    Hope this helps

    Malcolm

  • addInstance problem

    I'm having problems using addInstance in my form, I checked the forums and tried a lot of things the question is always the same.

    I have a form with 2 pages and for the second page, there is an Add button whenever I click on add to add the content of page 2.

    I'm saving my dynamic form as I put the subform range for the max and min values.

    But still, I get the error

    GeneralError: Operation failed.
    XFAObject.addInstance:1:XFA:form1 [0]: P2 [0]: Add [0]: click
    The item [max] has violated its number of occurrences.

    Hello

    Here is the form to the you: https://acrobat.com/#d=G3vkuNS4xdlbTH7xVNiSEg.

    You have been referring two subforms down into P2, P2 is the extensible object. I modified the script to refer to the extensible object:

    P2.instanceManager.addInstance(true);
    

    You can also use the shortcut for instanceManager (_):

    _P2.addInstance(true);
    

    You have implemented P2 flowed, so that this new instance appear right after the previous instance. So I put in place a new P3 which is positioned and new instances of this page appear on a new page. Take a look at the parameters of paging.

    Hope that helps,

    Niall

  • instanceManager line above

    Hello world

    I think I have a common problem and there is probably an easy fix. I hope.

    I have a dynamic array with an Add button in the header row and DELETE buttons in all the lines after that.

    The idea is that I can add as many lines as I want, and then delete them if I want to. Standard stuff.

    The problem is that each button Delete will remove the line above it. I want to remove the line that it is.

    Here is my code:

    Form1.dynamic_tables.table_holder.item_price_table. Row1.Button6::click - (JavaScript, client)

    item_price_table. Row1.instanceManager.removeInstance (1);

    Obviously, I'm hurting something with the argument for removeInstance, but I don't know what it is.

    Thank you very much

    Joe

    Hey Joe,

    The setting for the removeInstance is the instance you want to delete, based on a system of numbering from scratch. So it should work:

    item_price_table.Row1.instanceManager.removeInstance(this.parent.index);
    

    Good luck

    Niall

    Ensure the dynamics

  • Subforms in subforms add the problem of the Instance

    Hello

    I am new to Adobe Livecycle Designer (I use version 8.2.1) but I managed to almost all elements of the long form that I need to produce, with the exception of a section, I'm having trouble getting it to work properly. In the example, I have a subform extensible "organization" subform "Membership" page, which has buttons add and remove instances, which are working properly. But within each instance of this "organization" subform is another subform instance stretch "ExpertNames" with the buttons add and remove instances.

    The 'Body' form allows an organization to be named and the subform 'ExpertNames' allows several members of this organization to be named and associated with each organization. The user should be able to list several organizations of each with one or more members. I can successfully add several instances of the 'Body' form using one after another

    Membership.Organisation.instanceManager.addInstance(1)

    and remove the instance selected using

    Membership.Organisation.instanceManager.removeInstance(this.parent.index)

    I have the following text together on the button to add a new instance of the form 'ExpertNames '.

    Membership.Organisation.ExpertNames.instanceManager.addInstance(1);

    and the following to delete the instance selected in the form 'ExpertNames '.

    Membership.Organisation.ExpertNames.instanceManager.removeInstance(this.parent.index);

    However when I add a second instance of the form 'Body' which is a new organization and try and add additional members to the Organization of the 2nd it adds them to the organisation ofst 1 rather than the second! I have an example in the form of problem I can send if necessary.

    Hope someone will be able to help with this.

    Thanks in advance

    Lara

    Send the form to [email protected] and include an explanation of the question and I'll have a look when I get the chance.

    Paul

  • Problem adding rows in a table

    Hi all

    I'm having a strange problem by adding the lines of the table here. Everything seems to be in place. But when I click the button nothing happens. I worked on tables more complex and added lines safely, but I don't understand what is happening here. I saved the dynamic XML form, interactive form, I put the paging of expandable lines. But heck! It does not at all. I'm totally confused. More more while I drag the table from the object palette, an error and LC closes its doors. But when I click on the table on the toolbar and in the inserted table for it then it shows no errors. What is going on?? Any help is greatly appreciated.

    Script: form1. Page1.Subform1.Button1::click - (JavaScript, client)
    Form1. Page1.Subform1.Table1.Row4.instanceManager.addInstance (1);

    Thank you.

    Sidonie.

    Hi Francine,.

    The version that I have downloaded from Acrobat.com was registered as Static.

    When I saved as a dynamic in the file save as dialog, it worked perfectly. https://acrobat.com/#d= * KWIuuYfTYgasrEr4ERRaw

    Good luck

    Niall

  • Problem with the removal of the first row of the table

    Hi all

    I have a problem with my forms with tables where I have buttons to add or remove rows from the table. Adding the lines works fine but deleting lines has a problem when deleting the first row. Example: Here is a table with two rows where column 1 has the add and remove buttons and column 2 user imput that looks like this:

    Column 1
    Column 2
    Add and remove buttons hererank 1
    Add and remove buttons hererank 2
    Add and remove buttons hererank 3

    If the user deletes line 2 the table looks like which is correct:

    Column 1
    Column 2
    Add and remove buttons hererank 1
    Add and remove buttons hererank 3

    If the user deletes line 1 then the table looks like which is false since the ranks 2 and 3 should be left:

    Column 1
    Column 2
    Add and remove buttons hererank 1
    Add and remove buttons hererank 3

    The code is pretty simple:

    Table3.row2.instanceManager.addInstance (1); for the click event of the button Add line

    Table3.row2.instanceManager.removeInstance (1); for the click event of the button Delete line

    What I am doing wrong?

    Thanks in advance!

    Al

    The expression will be based on your structure... done .This refers to the current object, parent refers to the container parent of this object and index is the index of this object. So watching your hierarchy and from the key, you will need this.parent to join the line subform is it in (usually it is th esubform that repeats). If it's in a subform, you will need to add another parent. Continue on this road until you get to the repeating subform and then ask its index. Your expression might look like this.parent.parent.parent.index. Using this.index, you find the instance of the button object and there are just people and that's why you always get 0.

    Make sense?

    BTW your form is attached not... so I can't check what you should put it.

    Paul

  • PROBLEM OF INSTANCES EXTRA LINE

    I have created a form and I have the following problem:

    I have a drop-down list and the user can select one of two options. When the user selects one of the options, she fills in the values for the other drop-down lists that are in a row. I created a button to add instances of the line and the problem is that the values are only filling on the drop-down list in the first row and not on other lines created when you click on the button "add a line". The PDF form is attached.

    I appreciate any help!

    Thank you in advance!
    Monti

    Hello

    I moved the script of the change to the exit event event:

    var vRows = Servicesrow.instanceManager.count;
    var vService = this.rawValue; 
    
    for (var i = 0; i
    
    The function call now includes the current value of the drop down.
    Inside of the script object, the function is changed:
    function SetFlooringtypeEntries(vService)
    {
         ...
         ...
         ...
    
       var aFloortype = FlooringtypeFlow[vService];
    
    Finally, add the button of a line a bonus script to call the function in the new line:
    var i = servicerequest.Servicesrow.instanceManager.count;
    
    var newInstanceRow = servicerequest.Servicesrow.instanceManager.addInstance(1);
    
    var vService = top.typeofservice.rawValue;
    
    xfa.resolveNode("servicerequest.Servicesrow[" + i + "]").servicesscript.SetFlooringtypeEntries(vService);
    
    It works here. I also had a quick glance at the drop-down list in the second array. It works (to a degree). He was referring to a script object "listscript" that did not exist.
    I hope that this gets you going.
    Niall
  • Unable to Scan to the computer after downloading macOS Sierra. Is this a software problem?

    How can I scan from HP Envy 4500 to computer after downloading macOS Sierra?

    Hello wdemetris,

    Thanks for asking for scanning helps here in the Apple Support communities. I understand how it is important to have access to your scanner and am happy to offer help for this.

    As a precaution, we always recommend that you have backups to make sure that all your data is safe. You can perform a backup using Time Machine and an external hard drive. Use this article to help make a backup of your Mac: use Time Machine to back up or restore your Mac.

    Then, in accordance with article help: printer and scanner for Sierra, El Capitan, Yosemite, and the Mavericks macOS software, the HP Envy 4500 e-all-in-one is supported for printing and scanning. The drivers must be installed, but if not, if it please go to the App Store and check the updates tab to see if there are updates for HP. If there is, please install.

    If you have only general questions about how to get your updated scanner in place or how to scan pictures, please check out these two articles: macOS Sierra: implement a scanner & macOS Sierra: scan images or documents. If everything is configured correctly and you still have problems scanning, please visit this help article: macOS Sierra: scanning troubleshooting.

    Thanks again and have a great rest of your day.

  • My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    Hello brooksm549,
    Thank you for using communities of Apple Support.

    I got your message which, since updating your iPhone 6 to iOS 10.0.2 your iPhone stops when it is 40% and the power to empty very quickly. I understand your concern with the iPhone turn off and drains the battery. I recommend you to review the use of the battery to see what app contributes more to the battery drain. The following article will provide you with steps on how to check the use of the battery:

    On the use of the battery on your iPhone, iPad and iPod touch

    When you know about the soft uses more battery, you can change your settings in order to optimize the battery life:

    Maximize the life of the battery and battery life

    Best regards.

  • MacBook Pro display problem

    Hello members of the community.

    As of recently, I have noticed some glitches when feeding on my MacBook or awakened from his sleep.

    The colors are distorted, usually with pink, green, or yellow blobs. Blobs cannot entirely replace the colors, they appear to be contained in a element would normally be. For example. the menu bar will be partially pink and white, but pink does not leave the menu bar in this area, and the Office has green lines on it.

    I tried to take a screenshot, but the problem resolves in about 20 seconds, but it's a recurring problem.

    It happens when I wake up, connection or not. I had also certain powers serious and problems of performance, such that my MagSafe LED would not illuminate when plugged on rare occasions, fan could turn unnecessarily, graphics performance were SUPER slow, and the health of my battery was running out quickly. I actually ran a report on the system at 2 different times and my quality of full load is depleting of 1.2% per charge cycle, which is very worrying. I went from 6281 mAh mAh 6138 maximum capacity after two cycles of load. I'm tracking closely it because at this rate, my battery will survive only at load cycles about 150 instead of the 1000 expected, gives me the idea that this could very well be a bad battery. The computer is also warm to the touch while you sleep, not connected to the power supply. I NAP active but even taking into account should not be hotter my iPhone did the same thing.

    I have reset the SMC, and it solved a couple of problems. The charger works fine now and my performance improved considerably (which made me feel better, either it is a high-performance laptop, a 11-inch MacBook Air should not he surpass), and battery life has improved. I feel even if it uses a lot of power in his sleep. Maybe I need to turn off the NAP and see if that makes a difference. The graphic bug still persists however, and I don't have enough time to see if the max battery is depleting again.

    In regards to the bug, is there something that can be done? Basically, I want to assure you that I took all appropriate measures or if someone else has this problem to see if it can be software related instead of my computer.

    I have the entry level MacBook Pro with the retina, last generation.

    Any constructive contribution welcome!

    See you soon.

    -adreaux

    Hello bernardn753,

    After reviewing your post, it seems that you are having problems with the screen showing strange things on it. Looks like you already have a troubleshooting. I recommend you read this article, as reset NVRAM would be to reset your screen resolution settings that should help.

    How to reset the NVRAM on your Mac.

    Thank you for using communities of Apple Support. Good day.

Maybe you are looking for