Subform instances problem

I have a subform that reads data from an XML data file.
For every instance of an XML data elelment - I want a new instance of the subform with the associated data -
I cannot seem to get this to work - after many attempts.
from the Live Cycle UI - The for It appears to be working , at least, the bindings are correctly indicating the right information for the subform - but the object palette is grayed out and I can't seem to figure out how to instruct the subform to re-instantiate for every occurrence of a particular XML data element.  It reads the first element encountered , one only .... and misses all other occurrences of the data element.
would it be possible to zip up the form and the xml data file and submit it for a review -
the form is actually rather simple - so this is even more frustrating  (Arggh)
Thanks

Thaks Paul ;
I have sent the form and the data file - to the email yo listed.
The form is signed, etc - and works normally - but i can' identify the issue for the subform instances -
I gave it my best effort -
Thanks for assisting .

Similar Messages

  • Remove subform instance problem

    HI there
    I am using the following code to remove the last subform instance
    subform.instanceManager.removeInstance(1)
    However in test it appears to be removing the last instance but one.
    Can anyone help me fix this.
    Thanks
    Darren

    Hi Paul
    Many thanks for your quick response.  When I added that to my form it removed the first instance rather than the last instance.  I had a look on the links here and for any one else that has a similar prob the following seems to have fixed the problem
    subform.instanceManager.removeInstance(subform.instanceManager.count-1)
    Thanks again
    Darren

  • 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,

  • Adding subform instance - paging issue

    Hi,
    I have a form which includes a subform where one can press a button to add a subform instance.
    The subform is located in the middle of the page, with a small subform below it. 
    When I presss the add button to add the subform, the subform below the added subform goes to a new page.  I don't know why its doing this as there is plenty of room below the lower subform before the end of the page.
    I recently added data fields to the form.  Before I added the data fields, when I would press the add subform button, the subform below would not go to a new page.
    Any ideas?
    Andrew

    Just a thought but does your form content area extend to the bottom of the page or does it end at the same place the bottom subform ends?

  • Making Subform Instances Visible/Invisible

    Hello,
          I am trying to loop through the Subform Instances of the form and trying to make them visible/invisible on the click of a Check Box. The script seem to run just fine but the values nothing happens to the subforms. The script is written on the CLICK event of check box and is as below:-
    ----- HAP_DOCUMENT.APR.HAP_DOCUMENT.Positions.DATA.CHECK_BOX::click: - (JavaScript, both) ----------
    var
    nCount = APR.HAP_DOCUMENT.T_ELEMENTS.DATA.instanceManager.count;
    //var plan_value = this.parent.PLANS.rawValue;
    var
    plan_value = this.parent.parent.parent.Storage_Form.PLANS.rawValue;
    for (var nItem = 0; nItem < nCount; nItem++) { // Begin Loop T_ELEMENTS after the Instance is created
    var sub_Tele = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"]";
    var tName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA";
    var sCount = xfa.resolveNode(tName).instanceManager.count;
    for (var sItem = 0; sItem < sCount; sItem++) { // Second Loop on T_COLL_CELL
    var fName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA";
    var tCount = xfa.resolveNode(fName).instanceManager.count;
    for (aItem = 0; aItem < tCount; aItem++){ // Third Loop on T_FIELD
    var gName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"].simpleField.VALUE_STRING";
    var lName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"].simpleField.CAPTION";
    var subName = "HAP_DOCUMENT.T_ELEMENTS.DATA["+ nItem +"].T_COLL_CELL.DATA["+ sItem +"].T_FIELD.DATA["+ aItem +"]";
    var aVal = xfa.resolveNode(gName).rawValue;
    var bVal = xfa.resolveNode(lName).rawValue;
    var subVal = xfa.resolveNode(subName).presence;
    if (bVal == "Position Number"){
    if (aVal == plan_value) {
    if ( this.rawValue == 1) {xfa.resolveNode(subName).presence
    = "visible";}
    else {xfa.resolveNode(subName).presence
    = "hidden"; }
    Is there any other way of addressing the properties of the Subform Instances? Could any please help me as to why there is no effect on the subforms?
    Regards,
    Shishir.P

    Is the form saved as dynamic? Are you getting any errors in the javascript console?
    Paul

  • Problem with Subform Instances at First Opening

    Hi All,
    I have a large, complex form that has several subforms that I need to have zero instances the first time the form is opened. Most of those subforms that I set the initial instances = 0 on the Object pallet do exactly that--they behave and open with zero instances! However, I have one subform that always starts with an instance (1 instance instead of zero instances). I really don't want to work-around this, as I have done in the past when this has heppened. I want to solve it.
    I have tried
    Unwrapping the subform and the re-wrapping in a new subform
    Manually editing the <occur/> element in the XML for the subform.
    repeatedly trying different things in the Object pallet--the initial count checkbox always reverts to unchecked and the count to blank--I actually see it un-checking itself and removing the "0", right after I return to Design View from the Preview. This even happens after I have manually set the values in the XML. I double-check the Object pallet to see that my edits are reflected there (they are) and then... upon returning from Preview, it reverts and my <occur/> edit vanishes.
    I have looked for scripts that might be causing this--without any luck.
    I have encountered this sort of thing before and finally gave up and used the "presence" property as a work-around. The subforms don't always get utilized by the user and they should only exist when the user needs them. I will be exporting the XML data out of this form and exporting a lot of empty elements just presents another problem I'd like to avoid.
    Any suggestions are most welcome. I hope someone knows of a solution--I have spent way too much time on this.
    Cheers,
    Stephen

    Hi,
    Thanks kjaeggin and Bruce,
    I have the checkBoxes unchecked and the occur element is <occur min="0" max="-1"/> .
    Actually, this is the way the checkBoxes and XML have been all along and the results are what what I have previously described.
    One of my attempts to fix this was manually adding the "initial" attribute to the <occur/> element (by directly editing since it won't stick in the Object pallet)
         <occur min="0" max="-1" initial="0"/> that the edit reverts to <occur min="0" max="-1"/>.
    Also I have tried
         <occur min="0" max="1" initial="0"/> this is what I really want (max="1") and it reverts to <occur min="0" max="-1"/> as well
    And
         <occur min="0" max="1"/> reverts to <occur min="0" max="-1"/>
    The documentation for scripting the "initial" property of an object says:
         "This property should be used only for printed and static forms."
    This doesn't make sense to me because static forms don't have repeating containers, so why would you need/use it?
    Finally, to rule out that there is a script or property within mySubform causing this, I have set the presence property for all the subforms contained within mySubform to Inactive (Exclude from form processing) leaving only a single static object to be rendered if there is an instance of mySubform. (Bruce, I am not sure you have this on LCD 9. It is in ADEP Designer 10 and is supported by the target version). The result is the same--I see the first static object GrandParent.Parent.mySubform.staticObject but when I add a GrandParent I see GrandParent.Parent.nothingElse -- the added GrandParent doesn't have a mySubform. So it only misbehaves when the form is first opened, not when a GrandParent is added.
    I have removed global bindings from the few objects in mySubform that have them--no change. I have commented out the 1 script in mySubform that runs at form:ready--no change. I am going to look at scripts outside mySubform that get values from objects within mySubform, to see if somehow that is where the answer is. I would think that scripts would impact new instances of GrandParent, as well. I've looked at all other form:ready scripts and none interacts with or get values from mySubform.
    I think I may just have to settle for a work-around. Sure would like to know whats going on here, though.
    Thanks,
    Stephen

  • Problem: Adding subform instances

    Hello,
    I'm trying to add some instances of a subform.
    Therefor I added the Instance Control Button to my form.
    I customized it to my form and tested it.
    But when I click the Button, nothing happened. After 5 times, a message opened, that I have reached the limit of instances. But no instance is visible.
    What could be the problem?
    Alternative: Can I programmatically change the minimum count of repeats of the subform? It's possible that I could calculate, how much lines I need. So that is the second chance.

    I solved my problem.
    The reason that instances that were added did not show is because there were positioned subforms below where I was adding instances and they covered up new instances because they did not move.
    I solved the problem by re-organizing the form.
    1. All objects were put in a positioned sub-form. Some of them were in a subform by themselves.
    2. Each positioned subform was wrapped in a flowed subform with flow direction Western Text. The flow direction probably doesn't matter here because the flowed subform has only one object in it.
    3. The page-level subform was made flowed, direction western text.
    4. The form must be saved as a dynamic form.
    When I added instances, everything moved down correctly.
    You can probably not wrap everything in positioned subforms first, but you have to account for LiveCycle left-justifying everything in flowed subforms by putting blank text boxes to act as spacers to keep fields in place.

  • Subforms within subforms add Instance problem

    Hi
    I am new to Adobe Livecycle Designer (I am using version 8.2.1) but I have successful made nearly all elements of the quite long form I need to produce except for one section I am having difficulty getting it to function correctly. In the example I have a repeating subform ‘Organisation’ on page subform ‘Membership’ which has buttons to add and remove instances, which work correctly. But within each instance of this ‘Organisation’ subform is another repeating instance subform ‘ExpertNames’ with buttons to add and remove instances.
    The ‘Organisation’ form allows an organisation to be named and the ‘ExpertNames’ subform allows multiple members for that organisation to be named and associated to each organisation. The user should be able to list multiple organisations each with one or more members. I can successfully add multiple instances of ‘Organisation’ form one after another using
    Membership.Organisation.instanceManager.addInstance(1)
    and remove the selected instance using
    Membership.Organisation.instanceManager.removeInstance(this.parent.index)
    I have the following set on the button to add a new instance of the ‘ExpertNames’ form
    Membership.Organisation.ExpertNames.instanceManager.addInstance(1);
    and the following to remove the selected instance of the 'ExpertNames' form
    Membership.Organisation.ExpertNames.instanceManager.removeInstance(this.parent.index);
    However when I add a second instance of the ‘Organisation’ form i.e. a new organisation and try and add additional members to the 2nd organisation it adds them to the 1st organisation rather than the second! I have an example of the problem form i can send if needed.
    Hope someone will be able to help with this.
    Many thanks in advance
    Lara

    I still have not been able to find a solution to this does anyone have any ideas?
    I have an example of the problem in a form that I can email.
    Many thanks in advance
    Lara

  • Subform add Instance problem

    G'day
    I'm very new to LiveCycle and teaching myself to create forms
    I have a drop down box in a subform requesting information. Depending on the information required certain text boxes will appear (using switch case script) dateFrom dateTo dateCourt txtOther
    When I add a new instance of this subform the list appears correctly in the drop down box but when the item is selected the text boxes do not appear at all.
    I am probably missing something fundamental. Any ideas
    Cheers
    //cboInfoRequired
    RFI.InfoRequested.Info.cboInfoRequired::exit - (JavaScript, client)
    switch(RFI.InfoRequested.Info.cboInfoRequired.rawValue){
      case "Info A":
      RFI.InfoRequested.Info.dateFrom.presence = "visible";
      RFI.InfoRequested.Info.dateTo.presence = "visible";
      RFI.InfoRequested.Info.dateCourt.presence = "hidden";
      RFI.InfoRequested.Info.txtOther.presence = "hidden";
      break;
      case "Info B":
      RFI.InfoRequested.Info.dateFrom.presence = "hidden";
      RFI.InfoRequested.Info.dateTo.presence = "hidden";
      RFI.InfoRequested.Info.dateCourt.presence = "visible";
      RFI.InfoRequested.Info.txtOther.presence = "hidden";
      break;
      case "Info C":
      RFI.InfoRequested.Info.dateFrom.presence = "hidden";
      RFI.InfoRequested.Info.dateTo.presence = "hidden";
      RFI.InfoRequested.Info.dateCourt.presence = "hidden";
      RFI.InfoRequested.Info.txtOther.presence = "visible";
      break;
      case "Info D":
      RFI.InfoRequested.Info.dateFrom.presence = "hidden";
      RFI.InfoRequested.Info.dateTo.presence = "hidden";
      RFI.InfoRequested.Info.dateCourt.presence = "hidden";
      RFI.InfoRequested.Info.txtOther.presence = "hidden";
      break;
    //cmdAdd
    RFI.InfoRequested.AddInfo.cmdAdd::click - (JavaScript, client)
    RFI.InfoRequested.Info.instanceManager.addInstance(1);

    Hi,
    the problem is your SOM expression.
    When you write RFI.InfoRequested.Info.dateFrom.presence = "hidden"; the PDF-viewer interprets it always as RFI[0].InfoRequested[0].Info[0].dateFrom[0].presence = "hidden"; where the accessor [n] is always 0 which means the first instance of the related object.
    It should work if you just write dateFrom.presence = "hidden"; because the object is at the same level in the hierarchy and there is no need to parse the entire tree to find the object.

  • Problem with Subform Instances at Form Opening

    Hi All,
    I have a fairly large complex form that has several subforms that I want to have zero instances the first time it is opened. Most of those subforms that I set the initial instances = 0 on the Object pallet do exactly that--they behave! However, I have one subform in particular that no matter what I do, it always starts with an instance. I really don't want to work-around this, as I have done in the past when this happens. I want to solve it.
    I have tried
    Unwrapping and the re-wrapping in a subform
    Edited the <occur/> element in the XML for the subform.
    repeatedly trying different combinations of min count, max and initial count values in the Object pallet--the initial count checkbox always reverts to unchecked and the count to blank--I actually see it un-checking itself and removing the "0", right after I return to Design View from the Preview. This even happens after I have manually set the values in the XML, double-checked the Object pallet to see that my edits are reflected there (they are) and then... upon returning from Preview, it reverts and my <occur/> edit vanishes.
    I have searched for some offending script that might be causing this--but there is nothing that fires automatically tied to the instances of the subform. There are initialize, formReady and calculate scripts on objects in the subform, but nothing tied directly related to the instances of the subfom?
    I have encountered this sort of thing before and used the "presence" property as a work-around. I will be exporting the XML data out of this form and I don't want a bunch of empty elements to deal with.
    Any suggestions (besides "have you considered being a gardener?") are most welcome. I hope someone knows of a solution--I have spent way too much time on this.
    Cheers,
    Stephen

    Hi All,
    I have a fairly large complex form that has several subforms that I want to have zero instances the first time it is opened. Most of those subforms that I set the initial instances = 0 on the Object pallet do exactly that--they behave! However, I have one subform in particular that no matter what I do, it always starts with an instance. I really don't want to work-around this, as I have done in the past when this happens. I want to solve it.
    I have tried
    Unwrapping and the re-wrapping in a subform
    Edited the <occur/> element in the XML for the subform.
    repeatedly trying different combinations of min count, max and initial count values in the Object pallet--the initial count checkbox always reverts to unchecked and the count to blank--I actually see it un-checking itself and removing the "0", right after I return to Design View from the Preview. This even happens after I have manually set the values in the XML, double-checked the Object pallet to see that my edits are reflected there (they are) and then... upon returning from Preview, it reverts and my <occur/> edit vanishes.
    I have searched for some offending script that might be causing this--but there is nothing that fires automatically tied to the instances of the subform. There are initialize, formReady and calculate scripts on objects in the subform, but nothing tied directly related to the instances of the subfom?
    I have encountered this sort of thing before and used the "presence" property as a work-around. I will be exporting the XML data out of this form and I don't want a bunch of empty elements to deal with.
    Any suggestions (besides "have you considered being a gardener?") are most welcome. I hope someone knows of a solution--I have spent way too much time on this.
    Cheers,
    Stephen

  • Capturing data from additional subform instances

    I have a form with push buttons to add and delete additional instances of a subform containing fields. WHen I distribute the form and the form is returned, any additional instances of the subform are not captured and added to the dataset. Any ideas?
    Thanks for your help....
    Lane

    Thanks Niall for the prompt response.  I had actually come across both examples in my searching, however my form contains one table on a page.  If the user clicks a button (Add Another Location) the form replicates this page (along with a number of other pages, thus giving me a new blank table).  It is at this point that I would like the option of being able to copy the data from the first table instance into the second and so on but only if needed (hence the idea of using a checkbox to trigger the process).
    Hope this sheds a little more light on my problem.
    If this is somewhat confusing I'm more than happy to send you a copy of the file so you can have a look.
    Regards
    Michael

  • Referencing subform instances

    I have a tricky issue now that I am hoping someone can help with. I have an 8 page XFA form where the first 4 pages cannot be made expandable because the recipient company has to scan them when sent in by customers - so layout has to stay fixed. On page 2 there are three tables with fixed number of rows where the user can declare their shares in different currencies. If they have more shares than the rows allow, or more currencies, they can go to page 6 where they can add other currencies or more of the same currency from page 2. Each currency subform on page 6 is dynamic, and can have as many rows as needed.
    At the bottom of page 2 is where the totals of each currency for the whole form have to be declared individually - so £ from page 2 and page 6 (continuation), $ from page 2 and 6, and so on - reported as "£xx + $xx + Rxx".
    I have the form dropping each page 6 subform totals of each currency into separate boxes (eventually to be hidden) so that they can contribute to page 2 totals.
    The problem I have is that only the first instance from the page 6 currency contributing to the section 6 total - whichever currency is declared first. The others do not contribute.
    The script (FormCalc)calling that is:
    var do1 = Sum(topmostSubform.Page2.p2content.total_aggregate_nominal_dollar.rawValue) //page 2 value
    var do2 = Sum(topmostSubform.Page2.p2content.total_aggregate_nominal_dollar2.rawValue) //alternative page 2 value
    var do3 = topmostSubform.Page6.currency.Row2[*].calcs.total_aggregate_cont_dollar.rawValue //page 6 value
    if (do1 >= 1)
    then 
    $ = do1 + do3
    elseif (do2 >= 1)
    then 
    $ = do2 + do3
    endif
    What do I have wrong? Would I be better off in Javascript? 

    You must add the function Sum() to have each value together
    var do3 = Sum(topmostSubform.Page6.currency.Row2[*].calcs.total_aggregate_cont_dollar.rawValue) //page 6 value
    as long as this is formcalc and not javascript

  • Subform Instance Controls: Add Button

    Hello,
    I have a subform that i want to continue repeating when the user clicks on the add button. I would like the minimum to be 0 and when the user clicks on the button it will bring up the first occurrence. The problem is that it is not allowing me to have a minimum of 0, only 1. if i change it to 0 then the subform does not appear when clicking the add button.
    Also, i keep getting an error message when clicking the add button. it says "Date of birth: the birth date must be entered". the message appears about 5 times. I have made the date of birth field in the subform 'optional' as it was previously mandatory, and i have confirmed that there is no other script causing the problem, so im not sure why it isnt working.
    I would greatly appreciate any help that is offered.
    Thank you in advance!
    Nik

    Yes, you can have a subform with its occurrence set as 0 and then added when a user clicks an add button.
    In a simple form I have a button with the following script _Subform1.addInstance();
    There is a subform named SubForm1 that exists and has on the binding tab of the object Repeat Subform for Each Data Item "checked"
    The min, max and initial count are not selected.    This will have it that when the form is rendered there is no instance of 'Subform1' and that when the add button is pressed then 'Subform1' is added once.

  • Adding subform instances within subform instances

    In this form (attached), the user chooses a type of page to add by clicking the buttons pagebtn, discussion, assessment, or dropbox. When they click this button, an instance of SBtemplate.Pages is created, but only the subform they requested (page, discussion, dropbox, assessment) appears. So, while the user only sees the page type they requested, they are actually seeing a subform within another subform.
    The problem I am having now is that I can't create instances of subforms within these. For example, in the page subform, I need users to be able to create instances of the image, audio, and video subforms. And in the discussion subform, I need the user to be able to create an instance of the customrubric subform. I think this is not working because I need to specify the instance of SBtemplate.Pages in the code calling the instance manager.
    Is this a correct assessment? If so, how do I do that? If not, what can I do to accomplish this action?
    Thank you!

    I figured this out, so I wanted to post my form in case anyone is having the same problem.
    This is an example of a click event within one of my subforms to create an instance of another subform:
    xfa.resolveNode("xfa.form.SBtemplate.Pages[" + (this.parent.parent.parent.index) + "]").page._image.addInstance(this.parent.index);

  • How to reorder / move new pages and subform instances

    I have a form that has 2 functions - show a hidden page and duplicate the Page 1 and I need to reorder the pages once the user has added an instance or shown a page. I have Form A (Page 1) that can be duplicated but the user can add in a Form C (extra page) to be attached at the end of that instance of Form A.  So it goes like this:
    Form A (Page 1)
    button 1 - Adds new page 2 "Form C" to end of that "Form A"
    if (CompleteFormC.rawValue == 1) then
       topmostSubform.FormC2.presence = "visible"
       xfa.host.pageDown();
    else
       topmostSubform.FormC2.presence = "hidden"
    endif
    button 2: Adds a new instance of "Form A"
    topmostSubform.FormA.instanceManager.addInstance(1);
    xfa.host.pageUp();
    Currently, it adds the Form C to the very end, like so:
    Form A
    Form A
    Form A
    Form C
    Form C
    Form C
    I am trying to reorder the pages so the user can add in a Form C to every instance of Form A, like so:
    Form A
    Form C
    Form A
    Form C
    Form A
    Form C
    It's a little complicated but I would appreciate any help at all!

    Ahh, thank you. I just moved Form C into Form A subform group, it works and stays attached to that instance of Form A. Here's another issue... now that I have Form C appended to Form A, when I add in another Form A it correctly gets added after the last Form C but how can I get the form focus to go to the top of that new instance of Form A?
    Currently I am using: xfa.host.pageDown()
    But now it would be skipping down a few pages. Is there a way to also move to the top of that new instance?
    Thanks!

Maybe you are looking for