Set subform instances

I have reworked my form but don't seem to have a way to delete my previous post, however, I still have a problem.
My form is for building inspections in a certain area. Basically the first building is inspected and the inspector has the ability to add recommendations by selecting a radio button. Selecting this changes the presence of the Recommendation form to visible and adds a summary of the recommendation in a table called Summary.
My code when selecting the radio button and showing the Summary and Recommendation is:
if(this.rawValue == 1)
Recommend.presence = "visible";
else
Recommend.presence = "hidden";
if(this.rawValue == 1)
actionSummary._Summary.setInstances(1);
In the recommendation, they have the ability to add additional recommendations which subsequently adds new summaries. This is all working fine however, my problem is once the inspector adds another building. When they add recommendations for the new building, my summary instances resets to 1 and deletes everything that was already there from the first building.
I tried adding this to the radio button but it did not work:
if(actionSummary.Summary.index => 1)
actionSummary._Summary.addInstance(1);
What I need it to do when a new building is added with recommendations is add the summaries to the end of what is already there.
Can anyone help?

Thanks Naill,
You suggest an interesting approach. It certainly a solution for my situation.
All the table rows start out "hidden" however this particular row can have multiple instances (added once the initial row is made visible).
Various rows are presented depending upon the way the user interacts with a drop-down box above.
Advantages using your method: If the user changes their mind, the row instance(s)  disappears and the values that may have been entered in the fields are  obliterated, not just hidden--good, I think.
Disadvantages using your method: going back and re-working much of the code for the drop-down box (160 lines of code, just on this one drop-down). It's an extremely complex form and there is a lot going on.
Yet, a different approach might be to make the rows all visible initially and the table hidden. Then, reveal the table and hide the rows.
I think I'll try your suggestion on a future project.
Finally, you write "I suspect it is expected."  Is there a concurring opinion out there, anyone?
Thanks!
Stephen

Similar Messages

  • SSAS Tabular - Adding Column to a table gives error "Object reference not set to instance of object"

    If I make changes to a table in SSAS Tabular Visual Studio, the newly added column gives error as "Object
    reference not set to instance of object"

    Hi VikasJain13,
    According to your description, you get the "Object reference not set to instance of object" error when adding columns in Tabular. Right?
    Generally, it throws this error when the internal code is accessing the property of an empty object. As you mentioned it happens when you make changes on a table, mostly it means that table is already a empty object. Please re-process your tabular to see
    if this table is still existing. 
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • Is it possible to set character set at instance level?

    hi all,
    I have some confusion.
    say my database character set is AL32UTF8.
    and i want tio set charcter set of instance is WE8MSWIN1252
    Is it passible to set character set at instance level?
    Please reply with yes or No or why?
    Thanks & Regards,

    Hi,
    It's DataBase Level. One best example would be when you try to change the character or characterset conversion by using "Csscan" you can check the log or report. Which can guide what the things are happening. Instance - I think you might be referring to "Session".
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • Setting dynamically instance id

    Hello
    Is this possible to set dynamically instance id for bpel process instance?
    I would like to implement following scenario: bpel process listen on aq/jms queue. Every message dequeued from this queue creates new bpel process instance. Message payload is XML element containing i.a. unique id which I would like to set as bpel process instance id. Is this possible? Is this possible to set dynamically instance id using Java API to create new BPEL process instances?
    Thanks
    Jarek

    you can't change the instance id but the engine allows you to assign an application id (or many application ids) to an bpel process instance.
    In the NormalizedMessage you could do:
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, your-application-id)

  • 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

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

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

  • Is it allowed to set bmp instance variables in ejbFindByPrimaryKey

    Hello together,
    one simple question to the specification gurus:
    Is it allowed to set the instance variables of a Bean Managed Persistence
    Entity Bean inside the ejbFindByPrimary Key method?
    The Problem is:
    We are using OC4J (Oracle Containers 4 J2EE) and run multi threaded clients.
    In some situations it happens, that the same instance of an Entity in "pooled state"
    is used for concurrent ejbFindByPrimaryKey calls by the container.
    Due to the implementation of the ejbFindByPrimaryKey it sometimes happens,
    that during this call the Threads are switched and the value returned by the
    method, which is stored into an instance variable, is overwritten (some typical
    unwanted side effect in a multithreaded environment).
    So this leads to the question above!
    Ciao
    Stefan

    As far as I'm aware you shouldn't attempt to change the state in an ejbFindByPrimaryKey method - this should simply look up the appropriate instance, not alter the state. ejbLoad seems a more appropriate place to be doing that sort of thing.
    I'm not too sure, though - obviously your application will have very particular requirements.

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

  • Schema binding, add new subform instance

    I'm creating a fairly simple form which has an unknown amount of grouped entries. I made a data connection to my schema and used "Generate Fields" to bring the fields into the document bound to the schema.
    If I do this multiple times using each instance as a subform I can get a nice xml doc out of it ripe for digestion like so:
    <root>
         <entry>
              <data1>
              <data2>
              <data3>
         </entry>
         <entry>
              <data1>
              <data2>
              <data3>
         </entry>
    </root>
    However, I don't know how many entries the client will be adding so I want to have a button that adds a new instance of the bound data as done manually before. I have been able to prove the concept with a static subform using _Subform1.addInstance(1) on a button.
    When I try to apply it to the bound data subform, nothing happens, no error, no new instance. Also the Repeat Subform for Each Data Item area is greyed out in the Object Binding for the Schema-ed subform.
    Does anyone have an idea about what's going wrong here?
    Thanks in advance,
    Kevin

    Few things to check here.
    1) The parent subform needs to be set to Flowed. Then you should get the Repeat Subform for Each Data Item enabled for you.
    2) The form should be saved as dynamic.
    Let me know if you still have issues. If so, send the form to [email protected] so I can have a look at it..
    Thanks
    Srini

  • Subform instances and data missing in email submitted pdf

    I have created a form in which a user can add instances of a subform, enter data, and submit it to an email address as a pdf. When I receive the form the instances are missing. What steps do I need to follow to ensure that all of the data that is entered is sent? Thank you.
    Stephen

    I made sure "Preserve Scripting changes" was set to automatic. And still when I save the form, the instances are not saved.
    Basically I have a main page with several checkboxes that open instances of different types of order forms. It works great in PDF View, but when I save the form with data filled in, only the First page and data are saved and the instances of the other forms do not show up.

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

Maybe you are looking for

  • Dynamic header in oo alv print_top_of_page based on current line

    I would expect this to be a common problem with the solution easily to google/find, but somehow... dynamic header generation during alv print_top_of_page: - i print an oo alv grid, sorted by kunnr - for each new kunnr a new page -> now I want during

  • IMG settings after creating new output type for a purchase order smartform

    Hi all, Do I need to make changes in IMG after creating a new output type in NACE for a purchase order smartform? I have customized a purchase order smartform according to the requirements and copied an existing output type and assigned the custom fo

  • Designer

    I downloaded Oracle Designer 6i by the web site, I installed it on my computer and I configured the client side but I cannot configure the server side. I don't undestand how I can use the designer and what I must configure for use Client and server i

  • Condition, Expression 2 Question

    Hi, I'm relatively new to ApEx, so I apologize if my question is light weight. One of the selections for condition type is "Value of Item in Expression 1 = Expression 2". I wanted to only display a button if 2 fields had the same value, and thought t

  • Amperage with Tiger vs Leopard?

    Does anyone know what a reasonable Amperage was in Tiger for a 15" G4 Aluminum 1.67 GHz (all you're doing is looking at this forum with Airport turned on, but no music etc)? You can find the number by going to About this Mac -> More Info -> Power ->