How to reference table rows added using addInstance?

OK, this one's probably quite simple, but I'm at wit's end . . . .
I have a table with body rows that can be added using addInstance.  what I can't figure out is how to reference the newly added rows and teh fields within them.  If the row reference for the inital row before addInstance is:
Table.Row1.CellName before the addInstance, after the addInstance wouldn't it be Table1.Row1[0].CellName and the newly added row be Table1.Row[1].CellName?  I try that and the debugger tells me that Table1.Row1[1].CellName has no properties.
I basically need to determine whether the user has filled out anything in the added rows and I'm having a devil of time figuring out how to reference the added rows and their cells.  Thanks in advance!

Your logic is correct but to reference that som expression you woudl have to use this notation:
xfa.resolveNode("Table1.Row[1].CellName").method or property
The reason for this is the use of the square brackets. Javascript interprets this an an array. When you use the resolveNode method you can pass a string and hence the square brackets get interpretted correctly.
Paul

Similar Messages

  • How to lock a row by using 'for update'?

    how to lock a row by using 'for update'?

    Hi,
    SELECT * FROM <TABLE> WHERE <PK_COLUMN>=<VALUE> FOR UPDATE NOWAITThis will help in locking the row with the primary key value that you provide
    cheers
    VT

  • How to reference a dynamically added field

    I'm trying to set the value of a field that was dynamically added as part of a table section and I can't figure out how.
    The table section is added by clicking on a button and that works just fine. I can access any field value in the table section that has the instance '0'. But I can't seem to figure out how to access field values from any other instances of this table section.
    Here's the hierarchy of one of the fields:
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection.Row8.dteFormedD ateDevMem
    Where 'MemberSection' is the section of rows the button will add an instance of. Now, I can access the value of the date field for the first instance of 'MemberSection' with the following:
    DeveloperIdentityTbl.MemberSection.Row8.dteFormedDateDevMem.rawValue
    If I want to do the same thing say for the 3rd instance of the 'MemberSection', how would I do that?
    Thanks for the help!!
    Marc

    Hi,
    WhyIsThisMe is correct. You must reference the instance of the repeating 'MemberSection' by its index. Otherwise (as you have found) it defaults to the 1st instance.  Sounds easy, right? Well...
    Truth be told, this will depend on the scripting language you have chosen. The actual refernce syntax used for formCalc and javaScript is considerably different.
    WhyIsThisMe's reference:
         TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[2].Row8.dteFor medDateDevMem
    should work for formCalc, but it won't for javaScript. For that you would need to use resolveNode()
    var indx = 2;  // you probably will be selecting a differnt row under different circumstances, right? So, assign the index value to a variable
    or instead
    var indx = 0;
    if(condition){indx= 2;}
    else if(condition){indx= 3;}  //you get the idea
    //then you would do the assigning the value using resolveNode() by building the string that goes inside the ():
    xfa.resolveNode("TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSectio n[" + indx + "].Row8.dteFormedDateDevMem").rawValue  
    //you're building a string in javaScript, so the + is used. There are 3 parts to the final string for the resolveNode().   finalString = "part1" + indx + "part3"
    ////////////////////////////////////////////  Still with me?  I usually opt for formCalc when referencing instances, since it is generally more forgiving
    // In formCalc, 1st assign an index value to variable.
    var indx = 0;
    if(condition)then
         indx= 2
    elseif(condition)then
         indx= 3   //you get the idea
    endif
    // then, use that variable to reference the instance of 'MemberSection'  //resolveNode() not needed in formCalc
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[indx].Row8.dteF ormedDateDevMem
    Good luck!
    Stephen

  • How to retrieve table rows data and add into DB

    Hi All,
    I'm a beginner in JAVAFX, I have developed a table and adding the data into the table in multiple rows. on button click I would like these rows to be added into DB.
    Please could anyone help on this. I'm copy the code for reference.
    CODE:
    import javafx.ext.swing.SwingComponent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    package class TableColumn{
    public var text: String;
    package class TableCell{
    public var text: String;
    public var id;
    public var str:String;
    public var str1:String[];
    public var num:Number;
    package class TableRow{
    public var cells: TableCell[];
    package class SwingTable extends SwingComponent{
    var table: JTable;
    var model:DefaultTableModel;
    public var selection: Integer;
    public var columns: TableColumn[] on replace{
    model = new DefaultTableModel(for(column in columns) column.text, 0);
    table.setModel(model);
    public var rows: TableRow[] on replace oldvalue[lo..hi] = newVals{
    for(index in [hi..lo step -1]){
    model.removeRow(index);
    for(row in newVals){
    model.addRow(for(cell in row.cells) cell.text);
    public override function createJComponent(){
    table = new JTable();
    model = table.getModel() as DefaultTableModel;
    var selectionModel = table.getSelectionModel();
    selectionModel.addListSelectionListener(
    ListSelectionListener{
    public override function valueChanged(e: ListSelectionEvent ) {
    selection = table.getSelectedRow();
    return new JScrollPane(table);
    }

    Instead of using a combo box, using a text ring makes it much easier to disable items in the list. Here is a vi that will do what you want. Also you can delete the last element in the table and make it enabled in the text ring for selecting again.
    - tbob
    Inventor of the WORM Global
    Attachments:
    test_table[1].vi ‏75 KB

  • How to access Table rows in ADOBE form

    Hello Experts,
    I want to access the Table rows which are getting populated by WDA context, in form JavaScript when the table is populated.
    on the basis of few cell values i want to disable and enable particular cells in table rows when the table is rendered to the user.
    Please provide your inputs and suggestion on how to write a java script for it and in which event  i should write the script.
    i searched SDN and found couple of blogs and threads and tried using them but not working.
    Thanks,
    Siddharth

    Hello All,
    thanks for your suggestions.
    after some research and  trial and error i found the solution:here is the sample code for those who might face this issue.
    SUPERNODE(Root Node)
        --SUBFM(SUBFORM)
    MYNODE( Table)
    DATA(Table ROW)
    ADD       (Table COLUMNS)
    DELETE   (Table COLUMNS)
    var data1;
    var norows = xfa.resolveNodes("SUPERNODE.SUBFM.MYNODE.DATA[*]").length;
    for ( var i =0; i < norows; i++)
         if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").rawValue == "")
        xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").access = "readOnly";
        if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").rawValue != "")
        xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").access = "readOnly";

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

  • Delete internal table rows without using loop statement

    i have an internal table which consists of 100 records.
    i need to keep only first 5 records.
    without using the loop statement i need to delete the rest of the records. how can we achieve this result.
    i.e.  delete itab1 where  "recordno"  > 5.
    regards.
    ZG

    Hi,
    Delete itab [FROM idx1] [TO idx2] {Where (log_exp)]
    To delete several lines at once, you have to specify at least one of the additions FROM, TO, or WHERE. You can only use the additions FROM and TO with standard tables and sorted tables.
    Delete itab [FROM idx1]
    If you specify FROM, all the table rows from the table index idx1 onwards are included.
    Delete itab [TO idx2]
    If you specify TO, all the table rows from the table index idx2 onwards are included.
    PARAMETERS: p_carrid TYPE sflight-carrid,
                p_connid TYPE sflight-connid.
    DATA: BEGIN OF seats,
            fldate    TYPE sflight-fldate,
            seatsocc  TYPE sflight-seatsocc,
            seatsmax  TYPE sflight-seatsmax,
            seatsfree TYPE sflight-seatsocc,
          END OF seats.
    DATA seats_tab LIKE STANDARD TABLE OF seats.
    SELECT fldate seatsocc seatsmax
           FROM sflight
           INTO TABLE seats_tab
           WHERE carrid = p_carrid AND
                 connid = p_connid.
    LOOP AT seats_tab INTO seats.
      seats-seatsfree = seats-seatsmax - seats-seatsocc.
      MODIFY seats_tab INDEX sy-tabix FROM seats.
    ENDLOOP.
    ENDLOOP.
    SORT seats_tab BY seatsfree DESCENDING.
    DELETE seats_tab FROM 5.
    Thanks & Regards,
    ShreeMohan
    Edited by: ShreeMohan Pugalia on Jul 21, 2009 4:28 PM

  • How to Delete duplicates rows without using rowid/distinct.

    How to delete duplicates rows present in a table without using rowid or even distinct.

    How about:
    SQL> SELECT * FROM t1;
             A          B
             1          2
             2          3
             1          2
             4          4
             4          4
             4          4
    SQL> DELETE FROM t1
      2  WHERE (a, b) IN (SELECT a, b FROM t1
      3                   GROUP BY a, b
      4                   HAVING COUNT(*) > 1) and
      5        rownum = 1;
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    1 row deleted.
    SQL> /
    0 rows deleted.
    SQL> SELECT * FROM t1;
             A          B
             2          3
             1          2
             4          4Although, if I was asked a similar question with all those restrictions, my first response would be along the lines of: Is this question indicative of the way I will have to work if I join this company? If so, there is no point answering because I wouldn't touch this job with a ten foot pole.

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • Finding table row length using javascript in oa framework

    hi all,
    Can anybody suggest some idea to find out the table row length in js... but i had read the values by
    document.getElementByid('N3:checval:'+i).value etc etc.
    so can suggest me how to get the table row length in js or where can i find some examples on tables with javascript events associated with that.
    this is urgent..

    hi,
    Let me know ur target and what js function u have written for it. If you need to ask... getting no.of rows in js.... u can write in js :
    table=document.getElementById(<table id>);
    alert("rows>>"+table.rows.length);
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to display table data without  using ALV  and table element.

    Hi,
            Its possible to display table data without using ALV  and table element.
           Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
           (every time i am fetching single row data ),
           But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
           settings and header data etc..things.
          Give solution to  display data part..
    Regards,
    Rakhi.

    Hi,
    Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
    In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
      DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
        LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
    * Standard Filter Function setting to FALSE
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
    * Standard Filter Function setting to FALSE Ends
    Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
    Hope this answers your query.
    Thanks.
    Kumar Saurav.

  • Smartforms  how to print Table rows on to the next page automatically

    if this question is answered pls point to the the link
    SMART forms:
    layout :  Half of my A4 page is filled with templates, a small portion is footer, the middle portion is Table.
    Note: i have set the condition for the footer as (tick the check box) "only after end of main window"
    Output:
                       the template is displayed the table is populated on the first page, no footer on 1st page,
                    on page 2 the table rows are printed (table rows were a lot) and finally footer got printed every thing as per normal
    what i want is:
                     instead of the table lines printed in the middle of page 2 (bcz my main window table is in the middle, top is templates)
                     i want the table lines (after filling the main window table lines in the 1st page) to continue to print from the
                     top of the page on page 2 and immediately after the table rows finish. footer must be printed....
    what should i be doing to get this output

    dear bob,
    yes i have done that already as u said, when i do it......
    i created a new page (next page) directed first page to next page
    on the next page my layout is like below
    removed all the templates dragged the main window to the top of the page...... 
    when i check the result, there is an empty line as the first line in the table (2nd page)
    and also the footer (again a template) on the first page, which is ticked as ( print after end of main window) is NOT displaying.

  • How to group table rows using GroupedColumn?

    Hi all,
    i know by binding the grouping value to a context, it can merge rows into one. but this only works if the two rows are adjacent.
    if the context looks like this:
    value 1
    value 2
    value 1
    value 2
    it can not group them together
    how to group them together and merge the rows?
    thanks.

    Hi erv,
    U need to use the TableSorter class for this.
    You can download the TableSorter.java class from the tutorial Working with Tables in Web Dynpro.
    Here you can select the project A) Creating Tables and download the Ready-to-use project. The lick to download project is:
    [/docs/DOC-8061#46|/docs/DOC-8061#46]
    Once you have downloaded the tutorial, you can find the TableSorter.java class in this path
    TutWD_Table/src/packages/com/sap/tc/webdynpro/tests/utils
    For more information refer to this blog:
    [Enhanced Web Dynpro Java TableSorter for SAP NetWeaver 04s|/docs/DOC-8061#46]
    Regards,
    Sayan Ghosh

  • How to stop table row from being split onto two pages

    How do I stop a row of output from being split between two
    pages. When the CFDocument loads, sometimes, the last row on a page
    "spills" over onto the next. I'd like to figure out who to prevent
    these "orphans" from happening, and force the row onto one page or
    the other.
    Here's my code for the doc... I have a sp that querys the sql
    db. Using CFDocument - CF Version 7.02

    If you know roughly how many lines of output will fit on a
    page (you can test to find out), then you can count result lines
    (you should be able to use RecordCount and do some math) and cfif
    against your counter and force a page break beforehand if the next
    table will be too much to fit on the page. Then just reset the
    counter after you page break.

  • Table rows selection using checkboxes

    I have a standard Table UI element with multi selection property set to "none".Selection of rows is handled by a checkbox column.
    The client requirement is to be able to select multiple rows using shift key.(for ex, user checks 1st row,presses shift key and then checks 10th row,all 10 items have to be selected).How can we achieve this??

    Hi,
    Unfortunately, this is not possible as you cannot know whether user presses SHIFT key or not. You can achieve this in the following way:
    create an Action for check box and in onAction of checkbox, check if there is any row(check box value) is already selected or not. If it is selected, then create a popup to confirm, if the user wants to select all the rows till that or not. Then based ok/no you can select all the rows or not.
    Hope this helps u,
    Regards,
    Kiran

Maybe you are looking for

  • Viewing web cam does not work, help needed

    I'm having trouble viewing an iSight webcam on my iBook. I start up iChat on my MacBook then click accept to start viewing the webcam. 'connecting' comes up and thats as far as it goes. Same with audio, click accept and then it goes to 'connecting' t

  • Unable to ontain a connection to Hyperion Essbase .....Error

    im keep on getting this error message when i want refresh my planning desktop and when i want to do some thing with the webforms. if any one have any idea on this,, any help would be greatly appreciated. thanks in Advance

  • Really annoying problem.

    Well I thought I'd download a trial version of Photoshop on my computer so I did. However, Every time I attempt to install it I get the following error; ']Adobe Photoshop CS4 Error: Error 1612. The installation source for this product is not availabl

  • Acrobat XI Has Updated but Now Freezes

    My windows 8 version of Creative Cloud subscription has updated Acrobat to XI but now it freezes upon entry and does not respond to any mouse click, even to close the file

  • SAP Workflow to Guided Procedures

    Hi Gurus! Is it possible to start a browser with the URL of a Guided Procedure process instantiation form SAP WebFlow to start the Guided Procedure process automatically?