JTable cell Render on the last row column one help please

Hi All
I am hoping that someone will be able to help me with this....
I want to render the last row and column one of the table with this render
thanks for any help
Craig
    public class MyRenderer2 extends DefaultTableCellRenderer {
        public Component getTableCellRendererComponent(JTable table,
                Object value,
                boolean isSelected, boolean hasFocus,
                int row, int column) {
            ImageIcon icon = new ImageIcon(image_pics.SMALL_BLUE);
            setIcon(icon);
            return this;
    }

it still renders every row
any Ideas ??
I just want the last row column 0 to be rendered
I a call a method set table
then I call for the data
//TableModel
    public void setClientTableModel() {
        clientModel = new DefaultTableModel(coloumHeaderObject, 0) {
            public boolean isCellEditable(int row, int column) {
                return false;
        TableSorter sorter = new TableSorter(clientModel); //ADDED THIS
        sorter.setTableHeader(phoneList.getTableHeader()); //ADDED THIS
        phoneList.setModel(sorter);
       // phoneList.setTableHeader(null);
        setTable();
        revalidate();
    public void setTable() {
      // phoneList.getColumnModel().getColumn(0).setCellRenderer(new MyRenderer());
        phoneList.getColumnModel().getColumn(1).setCellRenderer(new MyRenderer1());
        phoneList.getColumnModel().getColumn(4).setCellRenderer(new MyRenderer2());
        phoneList.getColumnModel().getColumn(0).setMinWidth(20);
        phoneList.getColumnModel().getColumn(0).setMaxWidth(20);
        phoneList.getColumnModel().getColumn(0).setPreferredWidth(20);
        phoneList.getColumnModel().getColumn(1).setMinWidth(20);
        phoneList.getColumnModel().getColumn(1).setMaxWidth(20);
        phoneList.getColumnModel().getColumn(1).setPreferredWidth(20);
        phoneList.getColumnModel().getColumn(2).setMinWidth(80);
        phoneList.getColumnModel().getColumn(2).setMaxWidth(80);
        phoneList.getColumnModel().getColumn(2).setPreferredWidth(80);
        phoneList.getColumnModel().getColumn(3).setMinWidth(150);
        phoneList.getColumnModel().getColumn(3).setMaxWidth(150);
        phoneList.getColumnModel().getColumn(3).setPreferredWidth(150);
        phoneList.getColumnModel().getColumn(4).setMinWidth(20);
        phoneList.getColumnModel().getColumn(4).setMaxWidth(20);
        phoneList.getColumnModel().getColumn(4).setPreferredWidth(20);
        phoneList.setOpaque(false);
        phoneList.setGridColor(Color.lightGray);
        phoneList.setRowHeight(18);
        phoneList.setShowVerticalLines(false);
        phoneList.setIntercellSpacing(new Dimension(0, 0));
        phoneList.setFont(new java.awt.Font("Lucida Grande", 0, 11));
        phoneList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        if (ALLOW_COLUMN_SELECTION) { // false by default
            if (ALLOW_ROW_SELECTION) {
                phoneList.setCellSelectionEnabled(true);
            phoneList.setColumnSelectionAllowed(true);
            ListSelectionModel colSM = phoneList.getColumnModel().getSelectionModel();
            colSM.addListSelectionListener(new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    if (e.getValueIsAdjusting())return;
                    ListSelectionModel lsm = (ListSelectionModel) e.getSource();
                    int row = phoneList.getSelectedRow(), col = 3;
                    int rowID = phoneList.getSelectedRow(), colID = 5;
                    if (lsm.isSelectionEmpty()) {
                    } else {
                        int selectedCol = lsm.getMinSelectionIndex();
                        if (selectedCol == 4) {
                            phoneNumber = (String) phoneList.getValueAt(row, col).toString();
                            main.setPhoneNumber(phoneNumber);
                            main.openLargePhone();
                            lsm.clearSelection();
                        if (selectedCol == 5) {
                            ID = (String) phoneList.getValueAt(row, col).toString();
                         //   main.setID(ID);
                          //  main.deleteContact();
                            lsm.clearSelection();
//set table data
    public void setTest() {
        setClientTableModel();
        Object[] data = {" ", " ", "Work", "03 9841-8247", " "};
        clientModel.addRow(data);
        Object[] data1 = {" ", " ", "Fax", "03 9842-0360", " "};
        clientModel.addRow(data1);
        phoneList.getColumnModel().getColumn(0).setCellRenderer(new MyRenderer());
    }

Similar Messages

  • XCelsius list view selection does not show values of the last row/column

    Hallo,
    I have a list view selction in EXcelsius 2008 and there it shows the whole data as it sould and the correct line is marked as selected. When I embedd the swf-File in Crystal Reports 2008 the values of the last column and the last row are empty and the wrong line is marked as selected. What to do?
    Thanks in advance for your help.
    kind regards
    Monika Anna

    .. okay, the area definition in the data manager was incorrect. Now it works ....

  • Please help i started my project video format 720HD resolution 12x720 rate 25p at last when i finish and burn to dvd the edges are cut off any one help please i am really in trouble

    please help i started my project with  video format 720HD, resolution 12x720, rate 25p.  at last when i finish and burn to dvd the edges are cut off and my logo cut off the screeen aswell any one help please i am really in trouble. thanks

    Sorry, but I don't know anything about that app.
    I did go to their Web site and I see they have a support link. Perhaps you can get help there or in their forum.
    If you are OK with a DVD with a basic menu, you could try the Share>DVD option in FCP.
    Good luck.
    Russ

  • Sort rows in JTable except the last row

    Hi All,
    I have a JTable, which contains columns with numbers. The last row contains column sums.
    I want to be able to sort rows, but the last row with sums must remain motionless.
    Does anyone know the solution of this problem?
    Thanks in advance.

    These two posts are my example. It works pretty good but there is one significant niggle - when moving a column the 'total' table does not move smoothly but it does move. I look forward to 'camickr' reducing this to about 1 line.
    Part A.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Font;
    import java.text.DecimalFormat;
    import java.util.Comparator;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableColumnModel;
    import javax.swing.table.TableModel;
    import javax.swing.table.TableRowSorter;
    public class Sabre20090331
        static private class TotalizingTableComponent extends JScrollPane
            private TotalizingTableComponent(final TableModel tableModel)
                final SecondaryTableModel secondaryTableModel = new SecondaryTableModel(tableModel);
                final JTable secondaryTable = new JTable(secondaryTableModel);
                for (int i = 1; i < secondaryTableModel.getColumnCount(); i++)
                    secondaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                secondaryTable.getColumnModel().getColumn(0).setCellRenderer(new TitleCellRenderer());
                final TableColumnModel secondaryTableColumnModel = secondaryTable.getColumnModel();
                secondaryTable.setRowSelectionAllowed(false);
                final JTable primaryTable = new JTable(tableModel);
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    primaryTable.getColumnModel().getColumn(i).setCellRenderer(new NumberCellRenderer());
                final TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
                final DoubleComparator doubleComparator = new DoubleComparator();
                for (int i = 1; i < tableModel.getColumnCount(); i++)
                    sorter.setComparator(i, doubleComparator);
                primaryTable.setRowSorter(sorter);
                primaryTable.getColumnModel().addColumnModelListener(new TableColumnModelListener()
                    @Override
                    public void columnAdded(TableColumnModelEvent e)
                        // System.out.println("columnAdded()" + e);
                    @Override
                    public void columnRemoved(TableColumnModelEvent e)
                        // System.out.println("columnRemoved()" + e);
                    @Override
                    public void columnMoved(TableColumnModelEvent e)
                        //System.out.println("columnMoved()" + e);
                        secondaryTableColumnModel.moveColumn(e.getFromIndex(), e.getToIndex());
                    @Override
                    public void columnMarginChanged(ChangeEvent e)
                        //System.out.println("columnMarginChanged()" + e);
                        final TableColumnModel cm = (TableColumnModel) e.getSource();
                        for (int i = 0; i < cm.getColumnCount(); i++)
                            secondaryTableColumnModel.getColumn(i).setPreferredWidth(cm.getColumn(i).getWidth());
                    @Override
                    public void columnSelectionChanged(ListSelectionEvent e)
                        //System.out.println("columnSelectionChanged()" + e);
                final JTableHeader primaryHeader = primaryTable.getTableHeader();
                JPanel inner = new JPanel(new BorderLayout());
                this.setColumnHeaderView(primaryHeader);
                this.setViewportView(inner);
                inner.add(primaryTable, BorderLayout.NORTH);
                inner.add(secondaryTable, BorderLayout.CENTER);
            public static void main(String[] args)
                final JFrame frame = new JFrame("Totalizing JTable Example");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                final TableModel tableModel = new PrimaryTableModel();
                frame.setContentPane(new TotalizingTableComponent(tableModel));
                frame.pack();
                frame.setVisible(true);
    }Edited by: sabre150 on Apr 1, 2009 9:21 AM
    Changed the layout of the inner panel so that the secondary table is now in the CENTER. This stops the secondary table becoming detached from the primary when one expands the frame beyond the prefferred size.

  • Cant get the last row in jtable

    Hello all.
    I am trying to get the last row from the table but get "" from it.
    my table has 6 rows and i can get all rows right but the last line I have a problem.
            //creating the table
        for (i=0;i<this.rows;i++)
         model.insertRow(i,new Object[]{"input Y1:",""});
                for ( i=i;i<this.Amount+this.rows;i++)
         model.insertRow(i,new Object[]{"input Amount:",""});
    //end of creatingthis code creats the table that i need and its works right.
    for(i=0;i<rows;i++){
                  fObj.fullData[i] = Double.valueOf(GetData(table, 1, i).toString()).doubleValue();
            int j=0;
            String s=GetData(table, 1, 4).toString();
            //the problem line
            String s1=GetData(table, 1, 5).toString();
        public Object GetData(JTable table, int col_index, int row_index){
        return table.getModel().getValueAt(row_index, col_index);
      }this line i get ""
    String s1=GetData(table, 1, 5).toString();
    Edited by: vitaly87 on 00:41 08/04/2011

    vitaly87 wrote:
    Hello all.
    I am trying to get the last row from the table but get "" from it.
    my table has 6 rows and i can get all rows right but the last line I have a problem.
    this line i get ""
    String s1=GetData(table, 1, 5).toString();Looks right to me, given that your insert ismodel.insertRow(i,new Object[]{"input Amount:",""});(Hint: indexes start at *0* ).
    If it hadn't found the row, I expect you would have got an Exception
    Winston

  • Hiding bloc of Lines in a web template in the last row

    Hello,
    I want to hide a bloc of lines in a web query.
    Here I use the table interface with the method
    characteristic cell according to the "How to" - paper
    (How to hide a column).
    Normally , there is no problem to set the tag
    '<!--' in the first column ot the row to be suppressed and the tag
    '-->' in the first column of the row, I want to display again.
    But the problem is the last row. Here I must close the
    tag in the last column of the last row. The effect is
    something like a double line at the end of the output.
    (I think, I see here another time the first column of
    a row, because I cannot close the tag properly)
    As a result, I have problems with the print manager, we use to enhance the web printing.
    Can someone give me the information, how to close the tag
    in a proper way at the last row.
    Many thanks for your help.
    Regards
    Ralph

    Hi,
    I don't think this is possible. I would try to use c_cell_extend to extend the style of each <td>-Tag with style="visibility:hidden; display:none" This should have the same affect (for all cells which have to be hidden) (depending on your table styles there might be some padding or spacing effects; you have to try this out).
    Heike

  • How to get the last row in a resultset or query

    Hi All
    Say If I have a complex query which returns a resultset say 15 rows. Now I want to limit the output showing only the last row.
    How can we do this

    Keep in mind Oracle does not keep "row" order as such. Unlike a graphical type db like Access, Oracle will not always give you back the results in order.
    Even if you were to use a sequence, your query is never guaranteed to give back the results in the order you are expecting. You must then give an order by statement to all queries expecting the order.
    Your definition of last row too is vague - if it is in fact the greatest amount, use the inline view suggestion. If you simply want to see the last inserted row, consider adding a last_update_date column inserting the sysdate (by a trigger perhaps). This would then allow you to see the last inserted row.
    Enjoy!

  • How to get the last row

    I have 10 rows in my table and I have to retrive last row using rownum.
    For this I use
    SELECT * from <table_name>
    where rownum<=10
    minus
    SELECT * from <table_name>
    where rownum<=9
    The result is no rows selected
    In the same case if I use
    SELECT rownum from <table_name>
    Where rownum <= 10
    minus
    SELECT rownum from <table_name>
    where rownum <=9
    The result is 10
    Why this happend.
    If the result is 10, then why the row whose rowid is 10 is not retrived

    All
    Please bear in mind that ROWNUM is an attribute of the query NOT the table. The last row returned by an unORDERed SELECT statement may be the most recently inserted row but is not guaranteed to be so.
    The only way of assuring yourself of returning the most recent row is either to timestamp all your tables with a date_created column or to use a primary key with an ascending value.
    rgds, APC

  • Get rows where the last row finish off

    Hi, i have two tables AND would LIKE TO get data BY combining both.
    here IS my data
    WITH hist AS
      SELECT To_Date('4/23/2010','mm/dd/yyyy') dt, 999 alias, 'PROC' dom FROM dual UNION ALL
      SELECT To_Date('4/27/2010','mm/dd/yyyy') dt, 999 alias, 'LON' dom FROM dual UNION all
      SELECT To_Date('4/1/2010','mm/dd/yyyy') dt, 111 alias, 'SOC' dom FROM dual UNION all
      SELECT To_Date('4/10/2010','mm/dd/yyyy') dt, 111 alias, 'NAO' dom FROM dual UNION ALL
      SELECT To_Date('3/23/2010','mm/dd/yyyy') dt, 222 alias, 'PSE' dom FROM dual
    final AS
      SELECT To_Date('2/26/2010','mm/dd/yyyy') dt, 999 alias FROM dual UNION ALL
      SELECT To_Date('4/22/2010','mm/dd/yyyy') dt, 999 alias FROM dual UNION all
      SELECT To_Date('4/26/2010','mm/dd/yyyy') dt, 999 alias FROM dual UNION ALL
      SELECT To_Date('4/30/2010','mm/dd/yyyy') dt, 999 alias FROM dual UNION ALL
      SELECT To_Date('2/25/2010','mm/dd/yyyy') dt, 111 alias FROM dual UNION ALL
      SELECT To_Date('2/26/2010','mm/dd/yyyy') dt, 222 alias FROM dual UNION ALL
      SELECT To_Date('4/22/2010','mm/dd/yyyy') dt, 222 alias FROM dual UNION all
      SELECT To_Date('4/26/2010','mm/dd/yyyy') dt, 222 alias FROM dual
    the output should be as follow(without the extra blank line of course)
    DT           ALIAS   DOM
    2/26/2010     999     PROC
    4/22/2010     999     PROC
    4/26/2010     999     LON
    4/30/2010     999     LON
    4/27/2010     999     LON
    4/23/2010     999     PROC
    2/25/2010     111     SOC
    4/1/2010     222     SOC
    4/10/2010     222     NAO
    2/26/2010     222     PSE
    4/22/2010     222     PSE
    4/26/2010     222     PSEso what i am doing here is as follow, take one row in hist table (4/23) and join with final table and give me all rows in final table
    where dt <= to the row in hist table and include the row from hist table.
    this logic will give me rows 2/26/2010,4/22/10 4/23/2010
    then the second row in hist table (4/27/2010) wiill get all rows
    in final table that is <= to the current row and pick up the rows starting from the row > than the last row where the 4/23/2010 finished off
    in this case the output will be 4/26/10, 4/27/2010(we need to include row from hist)
    since there is no row in hist that is greater than 4/30/2010, this date will still be display and dom column value should be taking from the max date in hist
    which is 4/27/2010. see output above
    this sound a little confusing to explain but look at output of what to expect as output. the other ids should follow the same logic
    can someone help write a query for this? thanks

    Hi,
    Devx wrote:
    Frank, thanks again, i ran the query in oracle 11g and oracle 9i. 11g runs ok but 9i doesnt. it looks like the ignore null option is not supported in 9i. That's right: IGNORE NULLS was new in Oracle 10. You should always mention your Oracle version whenever you ask a quiestion, especially if it's as old as Oracle 9.
    i will be running this query in 9i. is there any alternative to re-write this query without using last value since ignore null is not supported and the output is not as i expected when i take that keyword out.
    i really appreciate your help. please let me know how would i re-write the query. thanksOne work-around is to use LEAD or LAG instead of LAST_VALUE. This means you have to know exactly where (how many rows away) the most recent non-NULL value is, which in turn requires other analytuic funtions, such as ROW_NUMBER, and more sub-queries:
    WITH     combined_tables        AS
         SELECT     dt, alias, NVL (dom, '_?_') AS dom     FROM hist
         UNION
         SELECT     dt, alias, NULL          AS dom      FROM final
    ,     got_r_num     AS
         SELECT     dt, alias, dom
         ,     ROW_NUMBER () OVER ( PARTITION BY  alias
                                   ORDER BY          dt
                           )               AS r_num
         ,     COUNT (*)     OVER ( PARTITION BY  alias
                           )               AS alias_cnt
         FROM    combined_tables
    ,     got_skip_cnts     AS
         SELECT     dt, alias, dom, r_num
         ,     r_num - MAX (CASE WHEN dom IS NOT NULL THEN r_num END)
                                 OVER ( PARTITION BY  alias
                               ORDER BY          r_num
                             )                    AS skip_before
         ,     MIN (CASE WHEN dom IS NOT NULL THEN r_num END)
                                 OVER ( PARTITION BY  alias
                               ORDER BY          r_num     DESC
                             ) - r_num               AS skip_after
         FROM    got_r_num
    ,     got_next_dom     AS
         SELECT     dt, alias, dom, r_num, skip_before
         ,     LEAD (dom, skip_after) OVER ( PARTITION BY  alias
                                                ORDER BY      r_num
                                 ) AS next_dom
         FROM    got_skip_cnts
    SELECT       dt
    ,       alias
    ,       NULLIF ( COALESCE ( next_dom
                            , LAG (dom, skip_before) OVER ( PARTITION BY  alias
                                                         ORDER BY         r_num
               )     AS dom
    FROM       got_next_dom
    ORDER BY  alias
    ,            dt
    ;You should be able to calculate bot LEAD and LAG in the same query, but there seems to be a bug that only calculates one of them correctly in this case. The sub-query got_next_dom gets around that, by doing the LEAD in a separate sub-query.

  • I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    click and hold on one cell, then drag to select the range, then release, then type the delete key.  Only inlude cells in the range you do not want to keey the contents of the cell.  You can remove one-off cells by holding the command key and clicking cells to add or remove as needed.
    You can download the Numbers users guide here:
    http://support.apple.com/manuals/#productivitysoftware

  • How to get the last row of a database table.

    HI ,
    I want to get record exactly from the last row of a database table.
    How is that possible?

    Hi,
    To fetch last record from an internal table, just do find the number of records in it and read using index.
    DESCRIBE TABLE ITAB LINES L_LINES.
    READ TABLE ITAB INDEX L_LINES.
    You can also use LOOP .. ENDLOOP but the above method is better (performance wise).
    using LOOP .. ENDLOOP.
    LOOP AT ITAB.
    **do nothing
    ENDLOOP.
    **process ITAB (Header record of ITAB).
    **after ENLOOP, ITAB will have the last record of the internal table.
    [here ITAB is internal table as well as header record.]
    But what is the requirement?
    If you are looking for the current record of an employee then you can use ENDDA = HIGH_DATE.
    My advice is to review your requirement again and try to fetch only that record which you need.
    Mubeen

  • I wanted to display the multiple rows in one row but column should be diff

    Hi
    Could any body help me regarding this query how to write to get the multiple rows in one row.
    eg.
    i have one table tab1(eno number,ename varchar2,uid1 varchar2,uid2 varchar2,uid3 varchar4)
    but when i am runing the query I am getting multiple record against one eno number because of uid1,uid2,uid3
    suppose value of table is
    eno ename uid1 uid2 uid3
    1 a u1
    1 a u2
    1 a u3
    when i am quering it is coming same as above but I want in one row
    eno ename uid1 uid2 uid3
    1 a u1 u2 u3
    can any onle help me how to write the query for this requirement.
    thanks
    saif

    which is hard coded in my code? Here another approach, but fail for c as there is no information for the value of a column: does 1 in u1 means col 1, etc.
    /* Formatted on 2012/05/29 16:29 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT 1 col1, 'a' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u3' col3
            FROM DUAL)
    SELECT   xx.col1, xx.col2, MAX (DECODE (xx.rn, 1, col3)) AS uid1, MAX (DECODE (xx.rn, 2, col3)) AS uid2,
             MAX (DECODE (xx.rn, 3, col3)) AS uid3
        FROM (SELECT t.col1, t.col2, t.col3, ROW_NUMBER () OVER (PARTITION BY col1, col2 ORDER BY col3) rn
                FROM t) xx
    GROUP BY col1, col2;output:
    COL1     COL2     UID1     UID2     UID3
    1     a     u1     u2     u3
    1     b     u1     u2     u3
    1     c     u1     u3
    Edited by: ʃʃp on May 29, 2012 2:30 AM

  • How can I delete the last row of a Matrix

    Hi All,
    Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!
    I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):
    ==
    if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))
      if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)
        if (evnt.BeforeAction)
          form = BusinessOne.Application.Forms.Item(formUID);
          mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;
         int numRow = getSelectedRow(mtx);
         if (numRow != -1)
                                            mtx.DeleteRow(numRow);
                                            form.Mode = BoFormMode.fm_UPDATE_MODE;
                                       Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);
                                       btn.Enabled = true;
    ==
    Cheers,
    Marcel Peek
    Alpha One
    Message was edited by: Marcel Peek
    Message was edited by: Marcel Peek

    Yes, there is a problem to delete the last row.
    It is fixed in version 2005.

  • To find out the last row that is updated in a View Object

    Hi OAF Gurus,
    I have requirement like,
    I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
    JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
    JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
    Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
    Just want to know,how to find out the last updated row in a particular VO.
    Any Help would be appreciated as this a immediate requirement.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on May 4, 2011 1:06 AM

    Hi Magesh
    It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean); OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    262
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    Thanks
    Pratap

  • Needs  help to retrive the last row in a  select query without using rownum

    Hi ,
    i need to retrive the last row from the select sub query without using rownum.
    is there any other way to retrive the last row other than the below query.
    is that the ROWNUM=1 will always retrive the 1 row of the select query ?
    select from*
    *(select ename from employee where dept_id=5 order by desc) where rownum=1;*
    Please advise.
    thanks for your help advance,
    regards,
    Senthur

    957595 wrote:
    Actually my problem is ithat while selecting the parents hiearchy of the child data using
    CONNECT BY PRIOIR query
    I need the immediate parent of my child data.
    For example my connect BY query returns
    AAA --- ROOT
    BBB --PARENT -2
    CCC --PARENT-1
    DDD IS my input child to the connect by query
    Immediate parent of my child data "DDD" ---> CCC(parent -1)
    i want the data "CCC" from the select query,for that i am taking the last row of the query with rownum.
    I got to hear that using ROWNUM to retrive the data will leads to some problem.It is a like a magic number.I am not sure what the problem will be.
    So confusing with using this rownum in my query.
    Please advice!!!It's not quite clear what you're wanting, but perhaps this may help?
    you can select the PRIOR values to get the parent details if you want...
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, lpad(' ',(level-1)*2,' ')||ename as ename, prior empno as mgr
      2  from emp
      3  connect by mgr = prior empno
      4* start with mgr is null
    SQL> /
         EMPNO ENAME                                 MGR
          7839 KING
          7566   JONES                              7839
          7788     SCOTT                            7566
          7876       ADAMS                          7788
          7902     FORD                             7566
          7369       SMITH                          7902
          7698   BLAKE                              7839
          7499     ALLEN                            7698
          7521     WARD                             7698
          7654     MARTIN                           7698
          7844     TURNER                           7698
          7900     JAMES                            7698
          7782   CLARK                              7839
          7934     MILLER                           7782
    14 rows selected.(ok, not the best of examples as the mgr is already known for a row, but it demonstrates you can select prior data)

Maybe you are looking for