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.

Similar Messages

  • Button makes subform visible, then adds another instance

    Hello,
    I have a button which makes a subform visible. That is working fine.
    I'd like the button when clicked a second time to add another instance of the same subform. Is this possible? I have no idea how to begin with the JavaScript for this and would appreciate help.
    Thanks in advance,
    MDawn

    Instead of making the subform visible and then adding instances you can do it just using instances then the button is doing the same thing.
    To "hide" the subform using instances, make sure under Binding that the Min Count is clicked off and the Inititial Count is set to 0 (zero) - your subform will now be hidden by default.
    Change the code you have showing the subform to use addInstance() instead of presence, using the underscore shortcut for the Instance Manager (you have to use the underscore method because the instance doesn't exist yet):
    _hiddenSubform.addInstance(true);
    If you remove instances back to zero then the subform will go away again. Doing it this way also has the advantage of resetting all the data in the subform.

  • Add multiple repeating subforms based on radio button

    I have a form with a hierarchy like this:
    Action
    Survey
    Recommendation
    I do not want the Action or Recommendation visible until a radio button on the survey selecting yes is performed. Multiple Recommendations can be added by clicking an "Add" button. Everytime a recommendaton is added, a summary table is also added in the "Action" subform. This is, so far, working.
    My problem is that the user then has the ability to add another instance of the Survey and once again can select the radio button for yes with more Actions and Recommendations. What I cannot get it do is keep the Actions from the first Survey and start adding the additional ones from the new Survey Recommendations.
    I have tried hiding the Action subform until the radio button yes is selected and I have tried setting the instance to 1 when it is selected. But nothing I've tried is working correctly. It either won't added the recommendations from the second survey or resets the Actions back to 1.
    Would a better solution possibly be to have all of the actions compile in a table at invisibly at the end of the form after all the instances have been done? I really wanted them to appear as a sort of summary at the beginning?
    Please, any help!!!

    Hi Satish,
    I have seen some funky behavior with radio buttons and dynamic subforms. Make sure you are testing with Acrobat or Reader version 7.0.5. Earlier versions have some know quirks with radio buttons and dynamic subforms. As for the radio button not populating when merged with data, I haven't seen that problem before in any version. If you can post your form somewhere, I'd be glad to have a look for you.
    Jared Langdon
    J. Langdon Consulting, Inc.

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

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

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

  • Add Button

    Hello,
    I have created a subform that I would like to be hidden and when the add button is clicked the form will appear, then the user can click the add button as many times for the subform to appear as many times as necessary.
    currently the add button works if i have the subform visible. however, as soon as i changed the subform to 'hidden' the add button does not work.
    i tried adding code in the click event to make the subform visible when the button is clicked, however this is not working.
    does anyone know another way around this?
    thanks in advance,
    Nik

    Thanks Niall,
    I have tried to remove the minimum however i cannot find anything that says addInstance.
    I am using the generic Add button from the object library. this is the code that is under the click event:
    /* This button will Add one instance of the repeating subform or table row.
    sSubformSOM: SOM expression of the repeating subform or table row.
    bCalc: Flag - true if the new instance might be referenced by other calculations, otherwise false.
    message: The error message displayed.
    These variables must be assigned for this script to run correctly.
    Replace <value> with the correct value.
    var sSubformSOM = " form1.subfrmChildren1";     // Example: var sSubformSOM = "xfa.form.form1.Subform1";
    var bCalc = true;              // Example: var bCalc = false;
    var message = "You have reached the maximum number of items allowed.";
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 8.2.1.3158.1.475346.466429 - Subform_Instance_Controls_Add.xfo
    // Build the SOM expression of the Instance Manager using the 'underscore' syntax.
    var oSubform = xfa.resolveNode(sSubformSOM);         // Evaluate the SOM expression.
    var sParentSOM = oSubform.parent.somExpression;      // Get the parent SOM expression.
    var sManagerSOM = sParentSOM + "._" + oSubform.name; // Build the SOM expression of the Instance Manager.
    var oManager = xfa.resolveNode(sManagerSOM);         // Evaluate the SOM expression.
    var nMaxCount = oManager.occur.max;     // Get the maximum number of subform occurrences allowed.
    var nSubCount = oManager.count;         // Get the current number of instances.
    // Proceed if the maximum number of subform occurrences has not been reached.
    if ((nMaxCount == "-1") || (nSubCount < nMaxCount)) {
        // Invoke the Instance Manager.
        var oNewInstance = oManager.addInstance(1);
        // Fire the form calculations.
        if (bCalc == true) {
            // Execute all the form calculations.
            xfa.form.recalculate(1);
    } else {
        xfa.host.messageBox(message,"Add Item", 3);
    // END OF DO NOT MODIFY

  • How to add button in ALV report (Class method )?

    Hello experts,
    I have developed one ALV report using classes.
    I want to add one more  button on the report like already is there named DISPLQUA
    How ca i do that here?
    Following the code of CLASS definition & implimentation
    CLASS lcl_handle_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_on_user_command FOR EVENT added_function OF cl_salv_events
            IMPORTING e_salv_function.
    ENDCLASS.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    CLASS lcl_handle_events IMPLEMENTATION.
      METHOD handle_on_user_command.
        CASE e_salv_function.
          WHEN 'DISPLQUA'.
            PERFORM show_quant_record.
         WHEN 'DISPQM03'.                                " Here i want to add button
           PERFORM display_quality_notification.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_on_user_command
    ENDCLASS.                    "lcl_handle_events IMPLEMENTATION

    HI Ronny.
    Code snippet for reference.
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION.
        METHODS :
    *--Toolbar control
          HANDLE_TOOLBAR FOR EVENT TOOLBAR
            OF CL_GUI_ALV_GRID IMPORTING E_OBJECT
                                         E_INTERACTIVE,
    ENDCLASS
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *--handle toolbar
      METHOD HANDLE_TOOLBAR.
    * append a separator to normal toolbar
        CLEAR G_TOOLBAR.
        G_TOOLBAR-BUTN_TYPE = 3.
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
        CLEAR G_TOOLBAR.
        G_TOOLBAR-FUNCTION = 'SAVE'.
        G_TOOLBAR-ICON = ICON_SYSTEM_SAVE.
        G_TOOLBAR-BUTN_TYPE = 0.
        G_TOOLBAR-QUICKINFO = 'Save the Customer'(203).
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.                    "HANDLE_TOOLBAR
    Hope this helps.
    Gary.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:41 PM

  • Add button to unused space in JTableHeader

    I have modified my JTable so that I can have multiple rows of column headers. I did this by extending BasicTableHeaderUI. In my particular instance, the first column of the table will never have more than one row in the header (unlike other implementations of multi-row headers I have seen, my column headers don't automatically fill upwards to take up all usable space in the header). So, I have "unused" space in the header above the first column.
    I would like to put some buttons there that are relevant to the table, but so far every effort to do so has failed.
    In the SSCCE below I have created a very stripped down version of my TableHeaderUI. It doesn't contain any of the code to create multiple row headers, it just pushes down the standard column headers to create some space. I try adding a button to the rendererPane, but it doesn't show up. There is a commented out line that paints the button which does work in terms of showing the button, but that's probably not the right way to do this (and the button doesn't work anyway).
    So, why isn't the button showing up? Am I doing this the right way (i.e. adding the button within the UI)? Thanks in advance for you help.
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.plaf.basic.BasicTableHeaderUI;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableColumnModel;
    public class HeaderButtonTable extends JPanel {
         public HeaderButtonTable() {
              String[] colNames = {"column 1", "column2", "column3"};
              Object[][] data = {{"a","b","c"},{"d","e","f"}};
              JTable table = new JTable(data, colNames);
              table.setPreferredScrollableViewportSize(new Dimension(400,100));
              table.setFillsViewportHeight(true);
              table.getTableHeader().setUI(new ButtonHeaderUI());
              JScrollPane scrollPane = new JScrollPane(table);
              add(scrollPane);
         public class ButtonHeaderUI extends BasicTableHeaderUI {
              public void paint(Graphics g, JComponent c) {
                   Rectangle clip = g.getClipBounds();
                   Point left = clip.getLocation();
                   Point right = new Point( clip.x + clip.width - 1, clip.y );
                   TableColumnModel cm = header.getColumnModel();
                   int cMin = header.columnAtPoint(left);
                   int cMax = header.columnAtPoint(right);
                   if (cMin == -1) cMin =  0;
                   if (cMax == -1) cMax = cm.getColumnCount()-1;
                   TableColumn draggedColumn = header.getDraggedColumn();
                   int columnWidth;
                   Rectangle cellRect = header.getHeaderRect(cMin);
                   TableColumn aColumn;
                   for(int column = cMin; column <= cMax ; column++) {
                        aColumn = cm.getColumn(column);
                        columnWidth = aColumn.getWidth();
                        cellRect.width = columnWidth;
                        if (aColumn != draggedColumn) {
                             paintCell(g, cellRect, column);
                        cellRect.x += columnWidth;
                  JButton test = new JButton("test");
                  test.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e) {
                             System.out.println("pressed");
                  test.setBounds(2, 2, 60, 15);
                  rendererPane.add(test);  //why isn't this showing up?
                  //this line will display the button, but button doesn't work
    //          rendererPane.paintComponent(g, test, header, 2, 2, 60, 15);
              private Component getHeaderRenderer(int columnIndex) {
                   TableColumn aColumn = header.getColumnModel().getColumn(columnIndex);
                   TableCellRenderer renderer = aColumn.getHeaderRenderer();
                   if (renderer == null) renderer = header.getDefaultRenderer();
                   return renderer.getTableCellRendererComponent(header.getTable(),
                        aColumn.getHeaderValue(), false, false, -1, columnIndex);
              private void paintCell(Graphics g, Rectangle cellRect, int columnIndex) {
                   Component component = getHeaderRenderer(columnIndex);
                   rendererPane.paintComponent(g, component, header,
                        cellRect.x, cellRect.y + 30, cellRect.width,
                        cellRect.height - 30, true);
              public Dimension getPreferredSize(JComponent c) {
                   long width = 0;
                   Enumeration enumeration = header.getColumnModel().getColumns();
                   while (enumeration.hasMoreElements()) {
                        TableColumn aColumn = (TableColumn)enumeration.nextElement();
                        width = width + aColumn.getPreferredWidth();
                   return new Dimension((int)width, 60);
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(new HeaderButtonTable());
              frame.pack();
              frame.setVisible(true);
    }

    Yes, I've seen similar links/posts about how to activate buttons in the header of a table, but those do it by adding listeners to the renderer. My buttons would be directly in the CellRendererPane that is the container for the table header. I would have thought that by putting the button directly in the Cell RendererPane that it would have nothing to do with the rest of the table header. CellRendererPane extends Container. Is it not possible to put a JButton in a Container? JFrame extends indirectly from Container and you can add buttons to that.
    Edited by: Bob.B on Oct 28, 2009 10:57 PM

  • Add button to SharePoint 2013 form with InfoPath and/or SharePoint designer

    Since I am new to working with Sharepoint 2013, I have the following questions to ask you about Infopath 2013 and possibly SharePoint Desinger 2013:
    1. Yesterday I created a custom list in my 'test area of SharePoint' and opened the list in Infopath 2013 to see what the form would look like. Now I have alot more columns and edits to add to the list. I am planning to add more columns to the list when
    I am in my 'test area' and then make cosmetic changes to the form using Infopath 2013. I am thinking that if I continue this way, I may lose some ediut changes I have made using Infopath 2013. Thus can you tell me the best way to add more columns to the list
    and/or modify the existing columns and not lose the edit changes that I made using Infopath 2013?
    2. The infopath 2013 form does not contain any buttons to click. I need a button to show up for every user to click so that a workflow can be started. Do I need some kind of a task list(action)? Thus can you tell me how to add this type of a button to the
    form?

    Wendy, Please go through this video from
    channel 9 (http://channel9.msdn.com/Blogs/NickDallett/InfoPath-2010-Customize-a-SharePoint-List-Form)  which will uilding froom explain similar form building from scratch.
    As per Peter's replay yes you can update form even after add columns in list and you can add extar control like button to your infopath form.
    Workflows are usually started when creating or updating an item inside a SharePoint document library. 
    Open the workflow in SharePoint Designer and under "Start Options' on the workflow's home page, remove the check from "Start workflow manually...". Be sure the check either "Start on create..." or "Start on change...". In
    your case I think you would use "Start on create...".
    Hope these inputs will help
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Adding a button by clicking on a "Add button" button

    Hi,
    I want to add dynamically button controls on my application. These buttons will be created when the user click on a "Add button" button.
    What command should I use to get that result ?
    Using <mx:button...> into the [[CDATA... doesn't work and all the trys I did based on what I grabbed on the net didn't run neither.
    Thanks a lot for any input.
    Loic

    Hi Greg,
    Thank you for your great input.
    However, Flex throws an error when I try that.
    var btn:Button = new Button(); > "This type can't be found or isn't a compiling constant" (Frenglish translation sorry)
    I am using patchpanel technology and here is the code. Maybe this is because I want to mix both import com.adobe.cs3.InDesign and mx.controls.* stuff ?
    Here is my code so far if it can help understanding :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="325" height="254" creationComplete="onCreationComplete()">
         <mx:Script>
              <![CDATA[
                   //Importe le DOM Indesign
                   import com.adobe.cs3.InDesign.*
                   import mx.controls.Alert;
                   import mx.controls.Button;
                        Fonction appelée quand l'utilisateur appuie sur le bouton 'start'
                   public function onClick():void
                        // Creation d'un bouton
                        //myButton = new Button();
                        //yButton.label = "Hello world !";
                        //InDesign.alert("ttt");
                        var btn:Button = new Button();
                      btn.label = "New Button";
                      btn.addEventListener(MouseEvent.CLICK, clickFunc);
                      vb.addChild(btn);
                   private function clickFunc(evt:MouseEvent):void{
                        mx.controls.Alert.show(evt.currentTarget.toString());
                        Fonction de recadrage du fichier swf après son initialisation
                   public function onCreationComplete():void
                        InDesign.$resize( width, height);
              ]]>
         </mx:Script>
         <mx:Button x="135" y="119" label="start" click="onClick()"/>
         <mx:Button label="Add Button" click="addButton();"/>
           <mx:VBox id="vb"/>     
    </mx:Application>
    Thanks anyway for your first input and hoping you could help me fixing that issue.
    Regards,
    Loic

  • Remote Control Menu Button

    Starting from the top, I have a 1st play title menu (A) with 4 buttons that are targeted to 4 other menus (B) – each of which, have multiple motion buttons leading to individual clips (C).
    I would like to be able to click on the Remote Control Menu button anywhere within the DVD and have it return to the 1st play title menu (A). In the Disc Inspector, I have set the “Remote Control” pull down menu to the 1st play title menu (A).
    I can achieve what I want by clicking on the Remote Control “Title” button but not the “Menu” button. What am I missing?
    Thanks in advance for your help.

    Sorry - I made an assumption that you were not able to go fro a track to the title menu... what you are asking is to go from a menu to the title menu by using the ;menu' key.
    Sadly, it won't be possible - the Menu key is designed to move only between tracks and menus. If you are in a track it will take you to a menu, once there, pressing it again willr eturn you to the track.
    You need to use the 'return' key to traverse through the menus, but it isn't a robust implementation in DVDSP.
    Therefore, the only way to accomplish what you want is to use the Title key on the remote control when in a menu... unless you add a button to each sub menu that jumps to the title menu.

  • Adobe reader closes automatically while table entry is added by add button

    Hi Team,
    I am new in adobe form. I have developed an adobe interactive form using livecycle designer integrated with SAP. My form has a table and under that there is an add button. When the form is opened in adobe reader and  add button is clicked, I have written a javascript code which appends a new entry in the table above. Everything is fine upto here.
    Now when I keep on clicking the add button, new entries are created and table grows. But when the table populates the current page and grows to populate the next page, suddenly the adobe form closes. I think there is an inconsistancy happening as my configuration for the table or the subform wrapping the table and the add button is conflicting.
    Could you guys give me some advise on this. I can provide screenshots or the adobe document on request.
    Thanks,
    Mainak

    Hi,
    I would say you are definitely coming up against memory restrictions. There are a couple of posts by John Brinkman that I would recommend.
    First I would look at why the form is 6Mb and see if you can reduce this down. For example, select fonts that are already in Reader (like Myriad Pro) and then deselect Embed Fonts in the File > Form Properties > Save Options. Also do not embed images into the form. See:
    http://blogs.adobe.com/formfeed/2010/02/big_and_complex_forms.html.
    http://blogs.adobe.com/formfeed/2010/09/xdp-size-matters.html.
    http://blogs.adobe.com/formfeed/2009/11/linked_vs_embedded_template_im.html.
    Next look at your script. You mention loops, so check is your script efficient. For example, use xfa.resolveNodes() once outside of the loop, instead of xfa.resolveNode() inside the loop. Make sure that variables are declared. See:
    http://blogs.adobe.com/formfeed/2011/10/script-performance-exercise.html.
    http://assure.ly/kUP02y.
    Also check for any script that you have in events that fire frequently, like layout:ready event and comment these out. See.
    http://assure.ly/nB0Bvz.
    The dataset seems very large at 2Mb. Does this include image data? It may be that the user is interacting with the form, while it is still trying to process the XML and the loops.
    Hope that helps,
    Niall

  • How we can add buttons on report/dashboard ?

    Hi,
    I want to add buttons on my report/dashboard so that clicking on one button it should generate one report, by clicking on another button it should generate another report.All these things are to be done on single dashboard/report.
    Thanks,
    Ganesh

    Hi Ganesh,
    Just as Olaf said, we can embedded all other reports as subreports in the main report, then control its visibility toggled by some Textboxes. For more details, please refer to the following steps:
    Drag some Textboxes(Textbox1, Textbox2, Textbox3…) and some Subreports to design surface.
    Right-click one subreport to open Subreport Properties dialog box.
    Select the report name which you want to display as the subreport in the General pane.
    Select “Hide” option when the report is initially run and enable it toggled by ‘Textbox1’ item.
    In the Parameters pane, add parameters if necessary.
    Use the same method for other subreports.
    The following screenshot is for your reference:
    The following blog is for your reference:
    http://www.codeproject.com/Articles/195017/SSRS-Series-Part-II-Working-with-Subreports-DrillD
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Strange behaviour of SAP Add Button

    I have a user defined screen designed using screen painter.
    <b>In that screen i have a Martix loaded with data using User DataSource.</b>
    Inside the screen i have add/edit/delete button so all the functionality is embedded inside the screen and everything working fine.
    But when i click the SAP'S Add button (which is available down the top menu) the data inside the matrix is cleared off.
    Any solutions to this?

    Hi
    check the AutoManaged property of your form instance.
    Regards

Maybe you are looking for