Referencing an object in a repeating subform

I'm trying to have the value of a text field in a repeating subform (lets call it the “Identify” subform) of my form to be set to the value of “TextField18” in the corresponding subform instance of the “Groups” subform.
In more detail:
In the form I ask the question - how many groups do you have? The number for that answer is the number of instances of the "Groups" subform that I have. Within that subform is a text field ("Text Field18")  where the user would enter the name of the group.
Later, in a completely different section of the same form, I have a subform called "Identify". I have figured out how to set the number of instances of "Identify" to match the number of instances of "Groups". What I would like to do is have a field in "Identify" display the name of each group (as entered in "TextField18" in the "Groups" subform) - one per instance of the subform.  So if the groups were Orange, Red and Purple as entered in instances 1-3 respectively of the "Groups" subform. I would want the field in instance 1 of the "Itentify" subform to autopopulate with Orange, and the field in instance 2 to autopopulate with Red, and so on.
Is this possible?  Any advice is appreciated!

Hi,
Your repeating subforms, Groups and Identify, will have an index property to identify their occurance.  So in the calculate event of the textfield in Identify using JavaScript place the following code;
xfa.resolveNode("Groups["+Identify.index+"].TextField18").rawValue;
This will return the corresponding value in the Groups subforms.  Note you may have to adjust the SOM expression if Groups and Identify are not at the same level.
Bruce

Similar Messages

  • XML Schema to generate table data from a repeating subform data

    Hi All, I would like to have a check box that when checked, will hide a quotation form, and make a purchase order form visible, carrying over some of the field data from the quotation form into a new table on the Purchase order form. I've attached this form at https://workspaces.acrobat.com/?d=pqpsXx5VPi*LkMeVKrX57w if you would like to take a look. When the checkbox is unchecked, it will hid the PO form, and make the quite form visible.
    The idea behind this is that my client will create his quote and send t to his customer. Once the customer accepts the quote, he can just click a button to generate his purchase order that he will send to his supplier.
    It seems that because I've got buttons to add rows on the quote form that the problem is more complex. I would be able to do this myself if the table had a fixed number of rows and I was able to use global fields and naming each cell something different, but beacuse it's a single repeating subform, I can't seem to make it work at all.
    I understand that because its a repeating subform that I need to create an XML schema to accomplish this, but also can't figure out for the life of me how to actually create the schema. I've been reading tons of tutorials, but no clue how to apply it to my specific need. I have only been able only find info on how to bind the data source once it's been created.
    I would be forever grateful if anyone could help me out.
    Thank you!

    I've edited your form and put it here.
    Here's what I've done:
    Inserted script into your checkbox renamed Accpted that hides/shows the Purchase Order/ Sales Quotation
    I've included a scripting object with a function I wrote to transfer data from like named fields/subforms from one section to another
    Inserted a few common fields into your Purchase Order table
    What you need to do is complete the development of your Purchase Order table. Make sure the common fields between the quote and purchase tables have the same names in order to transfer the data.
    No schema necessary.
    Kyle

  • Assigning values to repeating subforms using a script

    I am using a script to add values to a repeating subform. Below is a simple example. In the real script I would use a loop to do the inserts.
    //declare XML structure
    String hrxdproot = /process_data/hrxfaform/object/data/xdp/datasets/data/form1";
    //assigning repeating subform number
    int i = 1;
    //assign a value to the first repeating subform
    patExecContext.setProcessDataStringValue(hrxdproot + "/Details[" + i +"]/employee_name", "Aditya");
    However, the error I get is
    "Target exception: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. "
    I also tried to use a SetValue module to perform the same function and got the above error.
    /process_data/hrxfaform/object/data/xdp/datasets/data/form1/Details[1]/employee_name = "Aditya"
    Finally, I manually merged a sample xml (with 2 instances of the repeating subform) with the pdf and it worked fine. So I don't think there is a problem in the XML.
    Can someone please help...
    Aditya

    But the question is wether or not you're going to dynamically add nodes to your structure. Even if the schema permits to have multiple nodes under a specific section, it's hard to use xPath to do that. For example if you have a structure like the following:
    <Root>
      <Node1/>
    </Root>
    and use the following xPath /process_data/xmlvar/Root/Node1/Child1, you're going to end up with the following:
    <Root>
      <Node1>
          <Child1>
       </Node1>
    </Root>
    Now if you try to add another node under child node with a similar xPath /process_data/xmlvar/Root/Node1/Child2, you're going to end up with the following:
    <Root>
      <Node1>
          <Child2>
       </Node1>
    </Root>
    It won't append the node, it will replace everything under Node 1.
    So if this is what you're trying to do (add multiple children nodes), then you would have to create the xml structure using standard DOM objects within a custom component or the script service and the set the resulted xml to an xml variable.
    I hope this clears thigns up.
    Jasmin

  • Dynamic Table with repeating Subform

    Hello,
    I am maiking a form which has a Dynamic Table with a repeating Subform.  The repeating subform has a dropdown list field which has three options for the user to pic.  "LABOR", "EQUIPT.", & "MATL."
    The way I want the form to work is the user will choose which item they want to add to the form with the dropdown list.  Whatever amount they put into the "Amount" column will go to the corresponding total "LABORTotal", "EQUIPTTotal", & "MATLTotal"
    The repeating Subform is basically the Row1, but I have the table split up into subforms because of issues I had eariler with the form.  The repeating subform title is "detail". 
    I cannot get the sums for the 3 items to go into the corresponding totals field.  This is the script that I have for the labor total field:
    form1.total.LABORTotal::calculate - (JavaScript, client)
    var nAmount = xfa.resolveNodes("detail[*].Table1.Row1.AMOUNT");
    var nItem = xfa.resolveNodes("detail[*].Table1.Row1.ITEM");
    var nSum = 0;
    for (var i=0; i<nAmount.length; i++)
        if (nItem.item[i].rawValue == "LABOR")
        nSum = nSum + nAmount.item(i).rawValue;
    This.rawValue = nSum;
    I am not familiar with loop scripting or var scripting so I know I am getting it wrong somewhere. 
    I would greatly appreciate any help!
    Thanks

    Okay,
    Here is your form back to you: https://acrobat.com/#d=IA67zcTBrWlnpcYS234*XQ.
    The issue wasn't the script. If you select the dropdown and go to the Object > Binding palette, you will see you had ticked "Specify values" and these were set to 1, 2 and 3.
    This meant that if the user selected LABOR, the value of the dropdown was "1" and NOT "LABOR". This was throwing the if statement.
    I deselected the specify values and it worked as expected.
    Hope that helps,
    Niall

  • How to remove all instance in a repeatable subform (bis)

    Hi Niall,
    A few years ago, you helped a user who asked "How to remove all instance in a repeatable subform". Please could you do again with approximately the same problem ?
    In a click event, I have the script "_CarteEN.addInstance();". Well ! Many cards appear. To protect them, I put above a mask (it's a button with a background Fill). Now, how can I do to remove all masks with only one click using the resetdata or anything else...
    I try this but it doesn't work.
    while (flowedSubform.CarteEN._CacheCV.count > 2)
         flowedSubform.CarteEN._CacheCV.removeInstance(1);
    Many thanks for your help !

    There is no subform named "flowedSubform"
    The "CacheCV" is not a container object (subform). so you can't access the instanceManger of this object.
    the below lines should work
    while(_CarteEN.count >1)
         _CarteEN.removeInstance(1);
    Nith

  • Repeat subform until the end of the page

    Hi there,
    I'm relatively new to Livecycle and scripting, and I have a question that can hopefully be answered. I have a form in which the content is set to flowed and includes expandable fields. The last printable object in my form is a repeatable subform called ChainOfCustody. It's presence is set to hidden until the user clicks Print. It then becomes visible on the prePrint event. I'd like to have ChainOfCustody repeat as many times as it takes to fill the page it's on regardless of whether it appears 1 time or 10 times. I thought I could use addInstance inside a While loop and test when it's no longer on the current page, but that didn't work. I'm running out of ideas at this point, so any help is appreciated. (Below is my form's hierarchy, if that helps.)

    You can achieve this by using master pages and pagination.
    The implementation will be determined by your form requirements. The simple example attached is an example with two body pages:
    - sPageBody
    - sPageLast
    Regardless of how many pages the sPageBody flows over (by clicking the 'Add Section' button) and whether the sHideShow subform is hidden or visible, the sLastPageFooter always displays at the end of the last page.
    Ben Walsh
    www.avoka.com

  • Repeatable subform is not displaying contents

    I have a number of subforms within my main form - one of the subforms can have multiple instances so I've set it as repeatable, etc. The initial instance of the subform can be invoked from a number of different dropdown lists elsewhere in the form. Now then, I can display the repeatable subform but when I try to display other subforms within the repeatable subform, nothing is appearing - it just shows a space where the content should be! I've set the content of the repeatable subform to be hidden in the layout-ready event of the repeatable subform but still nothing is being displayed.
    It's made even more strange as I have another repeatable subform elsewhere in the form and this displays fine.
    Any ideas what could be the issue? Has anyone come across this before?
    Thanks for any help,

    Using the layout:ready event to show/hide content is a risky business, I have seen inconsitant results in the past, works in one place and not another.
    According to the manual ...
    Note: Scripts that fire on layout:ready should not do anything that would cause the layout of the form to change. For example, this would include anything involving subforms or tables that grow or shrink, adding fragments dynamically at run time, adding or removing subform instances, and toggling the presence setting of an object between hidden and visible.
    (http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000766.html)
    Hope this helps.

  • 'Repeat Subform for Each Data Item' is greyed out

    Hi there,
    I need to make a certain subform repeatable but the 'Repeat Subform for Each Data Item' is greyed out.  It's parent subform is not greyed out so I can make this repeatable but this is not the requirement.
    Is there another setting that prevents a subform from being repeatable?
    Many thanks,
    Kieran Kelly

    I guess you need to set the set the content flowed instead of positioned for which subform you want to repeat.
    Click on the subform you want to repeat in the hierarchy panel , then in the object panel click on the content and set in the flowed format.
    Hope it helps .
    Thanks.
    Bibhu

  • Error: Cannot drop schema because it is being referenced by object

    My database has a schema with the same name as a user (let's call it 'username'). This schema was not explicitly created. I want to drop the User 'username' but I have to drop the schema 'username' first; However, when I tried to do that I got the message...
    "Cannot drop schema 'username' because it is being referenced by object 'vw_Inventory'
    There is a view named 'vw_Inventory' but I don't see where it's referencing this schema, or any schema for that matter. Why would I get this error and how do I resolve it so I can drop the Schema and User?
    Darrell H Burns

    If a Schema has some objects in it, then you cannot drop that Schema until you remove all the objects out of it. You can change the schema owner
    to another database principal and drop the user like,
    Alter Authorization ON Schema::username TO DBO; Drop User username;
    other option would be
    Transfer the username schema objects to a different schema and drop username schema and user like.
    Alter Schema DBO Transfer Username.[OBEJECTNAME] ;
    --need to repeat this until you transfer all objects under this schema
    Drop Schema username;
    Drop User username;
    Regards,
    Praveen D'sa
    MCITP - Database Administrator - 2008
    sqlerrors

  • Repeating Subforms Incrementally

    This is going to sound kind of funky...
    We have a business requirement that a repeating subform ONLY repeat in multiples of 5. The subform is a column that counts five times across a page horizontally. Our form can never have more or less than 5 columns across any page, not matter how many of the have data.
    For instance, if our data should only need 8 columns to fill, the form should build 2 sets of 5 columns (which are on seperate pages). The five on the first page would be filled and the first three on the second page would be filled. That would leave to empty columns on the second page.
    Here's the real kicker. Our business requirements forbid us from using JavaScript or FormCalc. We have to do it via form object settings. Does anyone have ANY ideas on how to possibly go about doing this?
    Thank you so much for any help! If this is unclear or it would be easier to solve with conversation, feel free to email me.
    Ryan D. Lunka
    Cardinal Solutions Group
    [email protected]

    Ok. We actually did manage to figure it out. For reference here's what we did:
    Instead of setting up the columns as one repeatable subform, we put all 5 columns on as seperate (not repeatable) items. We used the same id for all 5 of them so they auto-index themselves as (column[0], column[1], etc). Then we bound the schema to the fields in all 5 of the columns. So each field in each column had a binding to node.repeatableNode[*].whatever_value. Then the larger subform that all of those columns reside in, is set to repeatable.
    LiveCycle automatically fills those "columns" one at a time because of their indexing. When it gets past five, it repeats the entire subform (which HAS to have five columns) but only fills the neccesary columns as it continues.
    Ask a funky question, get a funky answer. But it works.
    Ryan D. Lunka
    Cardinal Solutions Group
    [email protected]

  • Repeating Subform reference (FormCalc)

    How do you concisely reference a repeating subform? I need to retrieve a value from a field in repeating subform within a repeating subform without explicitly referencing each field. Please provide a FormCalc sample if possible. Fyi, I have read a million for/if loop and resolveNode threads but still don't get it. The abreviated code is below but goes on forever... Thank you in advance for being so smart and helpful.
    if(PartNo==110) then
         Item1=sfQtMaster.sfQuote[0].sfDetail[0].sfPrice.Item1     //Quote 1, Row 1
         Item2=sfQtMaster.sfQuote[0].sfDetail[1].sfPrice.Item2     //Quote 1, Row 2
         Item3=sfQtMaster.sfQuote[0].sfDetail[2].sfPrice.Item3     //Quote 1, Row 3
    elseif(PartNo==111) then
         Item1=sfQtMaster.sfQuote[1].sfDetail[0].sfPrice.Item1     //Quote 2, Row 1
         Item2=sfQtMaster.sfQuote[1].sfDetail[1].sfPrice.Item2     //Quote 2, Row 2
         Item3=sfQtMaster.sfQuote[1].sfDetail[2].sfPrice.Item3     //Quote 2, Row 3
    endif
    Thanks

    I would make a variable called 'count' and then use a loop to scroll through all the instances referencing the index of each instance as count.

  • Multiple repeating SubForms binding to the same data node

    Having multiple repeating SubForms binding to the same data node : In our documents, many times we need to display information from same table in multiple locations. For example, if document displays information of Insureds on one page and information of drivers on another page, we need to create a LiveCycle document with two SubForms. Each SubForm needs to have a repeating binding to CommonInsured element in XSD.  LiveCycle Designer is not able to handle such case. We cannot have two subforms bound to the same node, ONLY in a case where repeating option is selected for data binding.
    The only way I have found out is the following Javascript
    //Get the data node from XML. You will find the code for this function in //JavaHelperFunctions library.
    // InsuredDataRepeatingSubForm is a second subform.
    //You need to manually add instances to this subform at the
    //runtime and Insured data to each instance.
    var insuArray = JavaHelperFunctions.getInsureds();
        var i=0;
        for( i=0; i<insuArray.length; i++)
           if (i>0)
    var thesubform = this.InsuredDataRepeatingSubForm.instanceManager.addInstance(i);
                  thesubform.InsuredName.rawValue = insuArray[i].fullName.value;
           else
                   this.InsuredDataRepeatingSubForm.InsuredName.rawValue = insuArray[i].fullName.value;
    Is there any way I can achieve directly using bindings since we are trying to minimize javascript that changes the layout of the form?
    Thanks in advance!

    Unfortunately not. I've spent countless hours/days trying to do the same thing. You have to use code. The form consumes all the data it can into the repeating elements until there is none left and it is not reused.
    Here's a function I wrote just for that purpose. Feel free to use it:
    function loadData(source,target){
    target.setInstances(source.count);//set the target's subform instances to match the source's
    for (var a=0;a<source.count;a++){//loop through each subform instance
      var sourceSubform=source.resolveNode(source.name.substr(1)).all.item(a);
      var targetSubform=target.resolveNode(target.name.substr(1)).all.item(a);
      for (var b=0;b<sourceSubform.nodes.length;b++){//loop through the children of each
       if (sourceSubform.nodes.item(b).className=="field" && targetSubform.resolveNode(sourceSubform.nodes.item(b).name)!=null)//check for matching fields
        if (typeof(targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData)=="undefined" ||
         typeof(targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData.body)=="undefined")
         targetSubform.resolveNode(sourceSubform.nodes.item(b).name).rawValue=sourceSubform.nodes.item(b).rawValue;
        else
         targetSubform.resolveNode(sourceSubform.nodes.item(b).name).value.exData.loadXML(sourceSubform.nodes.item(b).value.exData.saveXML(),1,1);
       if (sourceSubform.nodes.item(b).className=="instanceManager" && targetSubform.resolveNode(sourceSubform.nodes.item(b).name)!=null)//check for matching subforms
        loadData(sourceSubform.nodes.item(b),targetSubform.resolveNode(sourceSubform.nodes.item(b).name));
    Just make sure the source and target subform hierarchies are identifal, same name and all. It will recurse down the tree and transfer source fields (rich text and plain) to their sister targets.
    Kyle

  • How to Highlight Fields in a dynamically repeatable subform?

    Hi team ,
    I have Problem in highlighting the fields in a dynamically repeatable subform. Sub form will have min count = 1 and max Count =20 and subform is flow able.each subform is flow able .
    I have to check only two fields in a subform whether they are null or empty . If the fields are empty or null then i have to highlight the fields .
    Below scripting is not working as per the requirement .
    I have written the below scripting  on click event of a button.
    function Test()
    var cnt = subform1.subform2.subform3.instanceManager.count;
    for(var i =0;i <= cnt;i++)
                    var vAccnt = subform1.subform2.resolveNode("subform3["+ i +"]").txtfldAccnt.rawValue;
                    var vAmount= subform1.subform2.resolveNode("subform3["+ i +"]").txtfldAmount.rawValue;
                    if(vAccnt == "" || vAccnt == null)
                                    var vName = Page1.WorkArea.GLDistribution.sfrmGLDistribution.sfrmDistribution.txtfldGLAccnt.somExpres sion;
                                    var fieldObj = xfa.resolveNode(vName + ".ui.#textEdit.border.fill.color");
                                    fieldObj.value = "255,0,0"; 
    Please help me How i can solve this problem.

    There is a space in the expression "somExpres sion".
    Just remove the space and try. I don't see any other problem in your logic.
    -Nith

  • Passing field data from a repeating subform to another repeating form

    Hi all,
    In my main form, I have a repeating subform which captures various customer demographics. It repeats up to 7 instances based on how many clients are associated to a particular account.
    The form user clicks a button to add new instances then fills in the various fields.
    What I have currently is another hidden subform which I need to then make visible, but I also need one new instance of that form, prefilled with selected fields, for each instance of the first subform.
    I'm not sure how to go about doing this. Based on my searches, it appears I need some sort of script to resolve each node and associate it with the second subform instances but I'm really unclear how to do that.
    Any advice will be greatly appreciated! TIA

    Hi all,
    I thought I found what I was looking for but still having problems getting it to work. Found this example on John Brinkman's blog...
    var srcFields = Subform1.resolveNodes("$.#field[*]");
    for (var i = 0; i < srcFields.length; i++) {
      var fieldName = srcFields.item(i).name;
      // if the same-named field exists in S2…
      if (Subform2.nodes.namedItem(fieldName)) {
         Subform2[fieldName].rawValue = srcFields.item(i).rawValue;
    I created a simple form containing 2 flowed subforms, each with one text field (same name). I added a button to subform1 to add one instance of subform1 on each click. I placed the script above in the change event of the text field in subform1.
    Nothing is happening at all in subform2. I can add my 3 instances, enter a name in the text field but nothing shows up in the text field of subform2.
    Can anyone offer any suggestions? Very new to this stuff so I'm really at a standstill. TIA!

  • Populate drop-down list in table row or repeating subform

    I am currently working on an Adobe Interactive Form integrated with web dynpro ABAP.  I would like to create a table or repeating subform with a number of drop-down lists populated from SAP.
    I am using the Enumerated Drop-down list from the WebDynproNative menu.  In my WDDOINIT method, I am populating the attributes using the set_attribute_value_set method.  This is working fine when my dropdown is not in a table or repeating subform.  The dropdown is populated and the selected value is returned to SAP when submitting the form.  However, when I place the dropdown in a table row or a repeating subform, the dropdown is not populated.
    Any ideas or suggestions?

    Hi There,
    I am facing problem in Dropdown lists in Subforms.
    I want the region dropdown list values according to country (only for DE) dropdown list value. Both Dropdown lists are in a Subform.
    For that, I have used this in EXIT event of Country Dropdown list:
    if (this.rawValue == "DE Deutschland")
    data.Item.IT_ITEM.DATA.ZZ_REGION.clearItems();
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Schleswig-Holstein","1");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Hamburg","2");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Niedersachsen","3);
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Bremen","4");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Nordrhein-Westfalen","5");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Hessen","6");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Rheinland-Pfalz","7");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Baden-Württemberg","8");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Bayern","9");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Saarland","10");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Berlin","11");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Brandenburg","12");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Mecklenburg-Vorpomme","13");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Sachsen","14");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Sachsen-Anhalt","15");
    data.Item.IT_ITEM.DATA.ZZ_REGION.addItem("Thüringen","16");
    else
    data.Item.IT_ITEM.DATA.ZZ_REGION.clearItems();
    It does only change first region dropdownlist value, not others because both dropdown lists are in a Subform.
    Other problem is that it works only when All Country Dropdown lists are "DE". Means, first region dropdown list depends upon not only first country dropdown but also other dropdown.
    My requirement is, If first country Dropdown is "DE", only first Region Dropdown list should be fill, not others. And so on.
    Please provide solution that How can I change all dropdown lists of a Subform dynamically?
    Waiting for reply.
    Thank you
    Chandler Bing

Maybe you are looking for

  • Can I open multiple Paypal accounts to accept payments for multiple businesses?

    Hello, I plan on setting up two businesses that will use Paypal to accept payments. Can I set up two seperate Paypal accounts to accept payments for my two businesses?

  • DHCP Problems on new SSID

    Hi all, I have an SSID where clients cannot get DHCP addresses. I have captured the following debug and from what I can see the WLC recieves the DHCP address from the DHCP server and then attempts to forward that to the Station but the station does n

  • How to export flv file from Final Cut Pro?

    I'm using Final Cut Pro and try to export edited video in "Flv" format. However, there is no such choice and only "Flc" available? My friend has the same version of Final Cut Pro and there is "Flv" format to choice, why?

  • My external 1tb My Passport won't display

    The eternal displayed this morning, was ejected properly, now won't display other than in Disk Utility, however, it won't allow me to access or eject it.

  • Scheduling Alarms and Reminders from Background Task

    I need to schedule alarm or a reminder from a background task.. When I try, I got the following error: System.InvalidOperationException: BNS Error: The API can only be called from foreground app I Know the message is pretty clear, but... Is there a w