How to get row index of data table in the while ValueChangeListener fired?

Hi,
i have a data table in my page, which contains various components like inputText, selectOneChoice in each row.
i am invoking a method ValueChangeListener attribute of the selectOneChoice component. I have given the autoSubmit=true for this component.
<tr:selectOneChoice id="ratingModelType"
value="#{childRatio.ratingModelType}" binding="#{pageManager.form.bindRatioType}"
valueChangeListener="#{pageManager.form.onRatingModelTypeChange}" autoSubmit="true"
contentStyle="width:150px" required="#{!childRatio.disableChildRatioRatingModelType}"
requiredMessageDetail="#{appBundle['error.ratingModelTypeShouldNotBeEmpty']}">
<f:selectItems value="#{pageManager.catalog['Rating Model Type']}" />
<tr:selectOneChoice>In that method i want to fetch the map(with all updated values) relevant to the currently modified row of the table.
Since i am not using the selectionListener or any radio buttons in the page i am not able to get the row index of the table.
somebody please tell me how to get the row index of the table, while ValueChangeListener fired?
Thanks in advance.
Subbu

Hi niki,
Thank you so much. With your suggestion i got the result exactly what i want.
thanks again.
--subbu                                                                                                                                                                                                                               

Similar Messages

  • How to get row index in dynamically populated table?

    Hi,
    I am following example given in http://balusc.xs4all.nl/srv/dev-jep-dat.html to Dynamically populate datatable. How can I get row index while populating table in populateDynamicDataTable() method
    private List myList;
    private String[] headers; // Optional.
    private HtmlDataTable dynamicDataTable;
    // Actions ----------------------------------------------------------
    public void loadMyList() {
    // Set headers (optional).
    headers = new String[] {"header1", "header2", "header3"};
    // Set rows. This is a stub example, just do your dynamic thing.
    String[] row1 = {"ID1", "Name1", "Value1"};
    String[] row2 = {"ID2", "Name2", "Value2"};
    String[] row3 = {"ID3", "Name3", "Value3"};
    // Convert rows to List and set the List.
    myList = new ArrayList();
    myList.add(Arrays.asList(row1));
    myList.add(Arrays.asList(row2));
    myList.add(Arrays.asList(row3));
    public void populateDynamicDataTable() {
    //*********************** I want current row in this method *************//
    // Any columns?
    if (myList != null && myList.size() > 0) {
    dynamicDataTable = new HtmlDataTable();
    // Get amount of columns.
    int columns = ((List) myList.get(0)).size();
    // Set columns.
    for (int i = 0; i < columns; i++) {
    // Set header (optional).
    UIOutput header = new UIOutput();
    header.setValue(headers);
    // Set output.
    UIOutput output = new UIOutput();
    ValueBinding myItem =
    FacesContext
    .getCurrentInstance()
    .getApplication()
    .createValueBinding("#{myItem[" + i + "]}");
    output.setValueBinding("value", myItem);
    // Set column.
    UIColumn column = new UIColumn();
    column.setHeader(header);
    column.getChildren().add(output);
    // Add column.
    dynamicDataTable.getChildren().add(column);
    // Getters ----------------------------------------------------------
    public List getMyList() {
    return myList;
    public HtmlDataTable getDynamicDataTable() {
    if (dynamicDataTable == null) {
    loadMyList(); // Reload to get most recent data.
    populateDynamicDataTable();
    return dynamicDataTable;
    // Setters ----------------------------------------------------------
    public void setMyList(List myList) {
    this.myList = myList;
    public void setDynamicDataTable(HtmlDataTable dynamicDataTable) {
    this.dynamicDataTable = dynamicDataTable;
    I have tried dynamicDataTable.getRowIndex, but it returns -1
    Is there any other way?
    Thanks ,
    Chitra.

    When you dynamically populate a datatable, you're populating the columns, not the actual rows.
    Just add EL to the styleClass attribute, like:styleClass="#{myBean.myTable.rowIndex == 1 ? 'highlightedClass' : 'defaultClass'}"where 'myTable' refers to a HtmlDataTable property in the backing bean.

  • How to get row index in table?

    I will show row no in table.
    In help,I find a example and follow it,I test:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="rowSetProperty"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetProperty name="estimatedRowCount"/>
    </boundAttribute>
    </bc4j:input>
    </contents>
    </bc4j:column>
    It's OK! But I couldn't get current row index.
    I test:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="rowSetProperty"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetProperty name="currentRowIndex"/>
    </boundAttribute>
    </bc4j:input>
    </contents>
    </bc4j:column>
    It's error! How can I do?

    Thanks
    I try:
    <bc4j:column attrName="Fdesc">
    <columnHeader>
    <bc4j:sortableHeader text="Seq No"/>
    </columnHeader>
    <contents>
    <textInput readOnly="true">
    <boundAttribute name="text">
    <bc4j:rowSetIteratorProperty name="currentRowIndex"/>
    </boundAttribute>
    </textInput>
    </contents>
    </bc4j:column>
    Nothing be showed in the table cells.
    Here, I finished using Javabean:
    public class ClsRowIndexBean
    private int _counter=0; 
    public ClsRowIndexBean()
    public int getCounter()
    return _counter++;
    public int getCurrentCounter()
    return _counter;
    public void setCounter(int counter)
    _counter = counter;       
    }

  • How to get row index?

    Hi,
    can any one tell me how to get the particular row index matrix. I need to get the row index when et_validate event raised.
    Regards,
    Siva

    Hi Siva,
    Use offset property in DBDataSource Object.
      Int RowNo;
    RowNo= DbDatasource.Offset;
    Regards,
    Sravan Kumar Pothu

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Get row count for different tables to the same line

    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;
    Thanks!

    >
    Hi,
    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;Something like this? One of the many uses for CTE's - Common Table Expressions - AKA
    subquery refactoring. Worth getting to know - very handy!
    with acount as
      select count(*) as counta from dual  -- put your table name here
    bcount as
      select count(*) as countb from dual  -- put your table name here
    ccount as
      select count(*) as countc from dual  -- put your table name here
    select a.counta, b.countb, c.countc from acount a, bcount b, ccount c;HTH,
    Paul...
    Edited by: Paulie on 25-Jul-2012 17:44

  • How to get selected  row index  of a Table ?

    hi gurus,I'm new  to Webdynpro for abap
    I'm displaying    just Flight details in a Table  so
    how to get selected  row index  of a  Table  and need  to be display in Message manager.

    Hi,
    For getting the row index use the following code.
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA index TYPE i.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_el_node = lo_nd_node->get_lead_selection(  ).
      index = lo_el_node->get_index( ).
    node is the name of the node which is binded to the table.
    For printing the message u can use code wizard.
    Press ctrl-F7. Now Select generate message.
    IN this select the method  REPORT_SUCCESS
    In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
    Write the whole code in onLeadSelect of the table.
    Regards,
    Pankaj Aggarwal

  • GETTING ROW COUNTS OF ALL TABLES AT A TIME

    Is there any column in any Data dictionary table which gives the row counts for particular table..
    My scenario is...i need to get row counts of some 100 tables in our database...
    instead of doing select count(*) for each table....is there any way i can do it?
    similary How to get column counts for each table..in database .For example
    Employee table has 3 columns...empid,empname,deptno....i want count(empid),
    count(empname),count(deptno) ...is there any easy way for finding all column counts of each table in data base? is it possible?

    Why does "select count(mgr) from emp" return null and not 13?Good question ;)
    Seems that xml generation in principle can't handle »counting nulls«:
    SQL> select xmltype(cursor(select null c from dual)) x from dual
    X                                                
    <?xml version="1.0"?>                            
    <ROWSET>                                         
    <ROW>                                           
    </ROW>                                          
    </ROWSET>                                        
    1 row selected.
    SQL> select cursor(select count(null) c from dual) x from dual
    Cur

    1 row selected.
    SQL> select xmltype(cursor(select count(null) c from dual)) x from dual
    select xmltype(cursor(select count(null) c from dual)) x from dual
    Error at line 1
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    Error at line 0
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    but
    SQL> select xmltype(cursor(select count(1) c from dual)) x from dual
    X                                                
    <?xml version="1.0"?>                            
    <ROWSET>                                         
    <ROW>                                           
      <C>1</C>                                       
    </ROW>                                          
    </ROWSET>                                        
    1 row selected.Looks like a bug to me ...

  • How to get selectedRow index from TableColumnModel

    Hi Folks, Can anybody suggest me how can i get the selected row index from TableColumnModel. User can add any number of rows to the table , but when user clicks on any row I need to get that Index.
    This is very urgent requirement.
    I'll will be glad if i get quick answer.
    Below is my problem description in detail:
    I'm using 5 column table. Each column is having its own customised editor.
    now when user clicks on add button I'm populating one row in table(which contains 5 columns). In similar fashion user can add n number of rows. Now my question is if user clicks on any row i have to get the selected row index, based on that i have to do some other manipulations.
    I have tried out using ListSelectionModel it works fine . But when I use setter method to set the selected row index it is not able to produce current selected row. Below is the code snippet
    ListSelectionModel selModel = arl.getTableSelectionModel();
              selModel.addListSelectionListener(new ListSelectionListener() {
              public void valueChanged(ListSelectionEvent listSelEvt) {         
              ListSelectionModel mdl = (ListSelectionModel)   listSelEvt.getSource();      
              setSelectedRow(mdl.getMaxSelectionIndex());
    private static int getSelectedRow(){
            return selectedRow;      
        private static void setSelectedRow(int row){
          selectedRow = row;When i call getSelectedRow() it is not giving me the current selected row index.
    Please suggest me the right approach.
    This is very very urgent for me.
    Thanks,
    Joe

    Hi Camickr,
    Actually there are two columns, one is having JComboBox list and other is just JTextField. Now when user selects particular item from JComboBox list then some corresponding value has to be populated in second column. ie second column value should be kept changing depending on the user selection from JComboBox.
    Now the problem is user can add one row (which contain above two columns) and can selects item and clicks on "add" button to add another row and selects some desired item from JComboBox and that corresponding value will be populated in next column. Now that actual problem is if user clicks on first row again to change the item from JComboBox I'm unable to set the corresponding value in its next column. For this reason I'm asking you how can i get the current row?
    Below is the code snippet:
    cbo.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                  //  JComboBox cb = (JComboBox)evt.getSource();                    
                    cbo = (JComboBox)evt.getSource();                                   
                    String item = (String) cbo.getSelectedItem();
                    item = item.trim(); 
                    int row = getSelectedRow();
                    if(getSelectedRow() == -1){              
                        return;
                    String len = (String)mdlListner.getValueAt(getSelectedRow(),mdlListner.LENGTH);                           
                    String dt = (String)mdlListner.getValueAt(getSelectedRow(),mdlListner.DATA_TYPE);               
                    len = len.trim();
                    if(item.equalsIgnoreCase(stringN) ||
                            item.equalsIgnoreCase(charN) ||
                             item.equalsIgnoreCase(binaryN))
                      jftLengthField.setEnabled(true);               
                      if(len.equalsIgnoreCase(notApplicable)){          
                        mdlListner.setValueAt("",getSelectedRow(),mdlListner.LENGTH);                                       
                        jftLengthField.setBorder(null);                   
                    else{
                            mdlListner.setValueAt(notApplicable,
                                        getSelectedRow(),mdlListner.LENGTH);
                            jftLengthField.setEnabled(false);
                    }); Pls suggest me the solution for this.
    Thanks,
    Joe

  • How to get row number of selected entry from OVS search result

    Hi,
    Anyone having any idea on how to get row number of the  selected entry/ how to differentiate rows in OVS search result in ON_OVS method?
    Regards,
    Jatin

    Hi,
    You can get the selected record to <ls_selection> structure in co phase 3.
    From that structure you can get what ever field you want.,
    check the below code for reference,
    << Moderator message - Cut and paste response from F4 help for ALV table field removed. Plagiarism is not allowed in SCN >>
    hope this helps u.,
    Thanks & Regards,
    Kiran
    Edited by: Rob Burbank on Jan 5, 2012 5:24 PM

  • How are attribute and text master data tables linked in SAP R/3?

    Hello,
    how are attribute and text master data tables linked in SAP R/3?
    Most tables with attribute master data like T001 for company codes,
    have a text master data table T001T (add "T" to table name).
    When looking at the content of table T001 via transaction se11,
    the text are automatically joined.
    But for some tables there is no "T"-table (e.g. table TVBUR for sales offices
    has no text table TVBURT), but in se11 you get texts. There is an address
    link in TVBUR, but the Name1, etc. are empty.
    a) Where are the text stored?
    b) How does the system know of the link?
    Hope someone can help!
    Best regards
    Thomas

    Hi Thomas
    The master and text table are not linked by name, of course, if you see the text table, it has the same key fields of master table, only it has the field key spras and the field for description.
    The link beetween the tables is done by foreign key: if you check the text table TVKBT u need to see how the foreign key for field VKBUR is done:
    -> Foreing key with table TVBUR
    -> Foreing key field type -> KEY FIELD FOR A TEXT TABLE
    ->Cardinality-> 1-:CN
    It's very important the attribute sets for Foreing key field type, if it's KEY FIELD FOR A TEXT TABLE, it'll mean the table is a text table: i.e. that mean the master table is a check table for the text table, where the foreign key type is for text table.
    U can find out the text table of master table by SE11: GoTo->Text Table
    U can fined some information in table DD08L.
    Max

  • I'm a MB Pro beginner (after 25 years with PC). I have an Iomega ext HD, but how do get it indexed. I'm trying searches in Finder, and it says "searching Iomega drive" - but I don't think it's indexing. How do I force it to index?

    I'm a MB Pro beginner (after 25 years with PC). I have an Iomega ext HD, but how do get it indexed?, and it doesn't come up with any results I'm trying searches in Finder, and it says "searching Iomega drive" - but I don't think it's indexing. How do I force it to index?

    Well I'm leaning the other way. I think my present MBP will be the last Apple product I buy.
    With the way Apple is going, all New Mac computers are sealed unit that don't allow the user to upgrade them in any way. They are getting more expensive initially. They are impossible to fix, even by Apple. All the parts are either soldered to the Logic Board or glued inside the case parts. The add on warranty only covers manufacturing defects and is expensive. And to fix one out of waranty is close to if not more then a new system.
    The only thing different in a Mac, and most other products Apple sells, is the operating system and the cases they come in. As for the OS both have their glitches and at this time there are no viruses that infect OS X. There is more software available for Windows. More choices as to what hardware you can use or upgrade to at a later date.
    Mac computers are becoming large iPads or iPhones with built in keyboards.
    jeremy_from_rome wrote:
    And as for the question: PC or Mac, the consensus that I hear from colleagues and friends is just as you state it: stay with Mac, be patient, work at it, and you’ll never look back! Thanks again

  • How   to  find  global  index  in partition table

    Hi guys ,
    need one help
    How to find global index on partition table
    How to find local index on partition table
    Need query
    Thanks in advance
    Edited by: nav on Feb 17, 2012 6:51 AM

    nav wrote:
    Hi Solomon,
    so I have to identify partition & index are created or not,
    also I have check the status of index ( both global and local)So what's the problem? Table/index partition is an object, so you can query DBA_OBJECTS:
    SELECT  SUBOBJECT_NAME,
            CREATED
      FROM  DBA_OBJECTS
      WHERE OWNER = partitioned-table-owner
        AND OBJECT_NAME = partitioned-table-name
        AND CREATED >= TRUNC(SYSDATE)
    /This will give you partitions created today. So if you run this right after your job (I hope your job doen't run too close to midnight), you'll get table partition name your job created. Same logic can be applied to indexes.
    SY.

  • How to get length of a data field

    Hi Experts,
    How to get length of a data field. For example data field /BIC/0COSTCENTER length is 9. and the entry in the table is /BIC/0COSTCENTER = 1000 only. How to get the lenth of value in the table.
    Any help greatly appreciated. Thanks.
    Best Regards,
    Suresh.

    Below is example  code
    Data: var1(10) type c value '2500',
          var2 type i.
    var2 = Strlen( var1 ).
    write var2.
    <b>Reward Points for helpful answers</b>
    Satish

  • Abap logic not fetching multiple rows from master data table

    Hi
    I just noticed that my logic is fetching only 1 row from master data table.
    ProdHier table
    PRODHIERACHY            Level
    1000                                  1
    1000011000                      2
    10000110003333              3
    10000110004444              3
    '10000110005555              3*
    logic only fetches one row of level 3, I would like to fetch all level 3 rows.
    DATA: ITAB type table of /BI0/PPROD_HIER,
          wa like line of ITAB.
    Select * from /BI0/PPROD_HIER INTO wa where /BIC/ZPRODHTAS = 3.
    IF wa-PROD_HIER(10) = SOURCE_FIELDS-PRODH2.
         RESULT = wa-PROD_HIER.
         ELSEIF wa-PROD_HIER(5) = SOURCE_FIELDS-PRODH1.
         RESULT = wa-PROD_HIER.
    ENDIF.
    ENDSELECT.
    thanks

    Hi,,
    I have implemented the logic in end routine and it still reads only the first row.
    I am loading only PRODH1 and PROD2 but now I want to get all values of PRODH3 from the master data table.
    The first 5 values are PRODH1 and first 10 values belongs to PRODH2.
    Whenever PRODH2 = 1000011000 in source I should get the following values
    10000110001110
    10000110001120
    10000110001130
    I have multiple rows of 1000011000 so my result should be
      1000011000               10000110001110
      1000011000               10000110001120
      1000011000               10000110001130
    DATA: ITAB type table of /BI0/PPROD_HIER,
    wa like line of ITAB.
    data rp type _ty_s_TG_1.
    Select  * from /BI0/PPROD_HIER INTO table itab where /BIC/ZPRODHTAS = 3.
    LOOP AT RESULT_PACKAGE INTO rp.
    read table itab into wa with key PROD_HIER(5) = rp-PRODH1.
    IF sy-subrc EQ 0.
         rp-PRODH3 = wa-PROD_HIER.
         ELSE.
    read table itab into wa with key PROD_HIER(10) = rp-PRODH2.
    IF sy-subrc EQ 0.
         rp-PRODH3 = wa-PROD_HIER.
    ENDIF.
    ENDIF.
    MODIFY RESULT_PACKAGE FROM rp.
    ENDLOOP.
    Edited by: Bhat Vaidya on Sep 10, 2010 11:27 AM
    Edited by: Bhat Vaidya on Sep 10, 2010 11:37 AM

Maybe you are looking for

  • Ical error -14

    I think this is a client side problem with iCal 4.0.1 in OS 10.6.2, because I'm able to use my exchange calendar via iCal on other machines. The broken machine is stuck in an error loop: +The account "Exchange" currently can't be modified. To discard

  • Mac OS creates huge PDF file - PDF file size too big

    Hi, I have a 80 K Word file. The file is one page, some text and a 12 KB .jpg file imported in. I then duplicated the jpg graphic 7 times (8 total images). Here are the resulting sizes when creating PDF's using different methods within Mac OS X print

  • How do you execute macros in excel using forms--urgent

    i want to execute a macro which is in excel from forms. i am using the dde built in. how ever when given the command dde.execute ( conv_id,'[module1.macro1()]', 1000 ); i get an oracle error. and the macro does not get executed. how ever when the sam

  • BPS Log to find deleted BPS objects

    Hello Experts, Somebody might deleted few planning layouts and functions from production environment but we can see those objects in test and quality environment. Our aim is to know  who, what and when deleted those objects. Could somebody let me kno

  • Debugging UserExits?

    Hi, RFC FM "CIF_PIR_INBOUND" is called from APO. This FM calls customer function through CALL CUSTOMER-FUNCTION '001'. Exit name is "EXIT_SAPLCPIR_001" & include is "INCLUDE ZXCIFU15". I have implemented this userexit in Deveopment environment, while