Selecting rows from a JTable using keys

Hi all, be very grateful for some help on this.
I want to provide functionality in an application where the user will be able to select multiple rows from a JTable by using the page up/ page down button.
Anybody know how this can be done?
Thanks

Just add a KeyListener to the table which does what you want on pressing the relevant key.
it seems a bit odd though. If I pressed page up/down in a table I'd expect it to scroll and would be somewhat confused if it started selecting stuff. Generally it's best not to muck around with the default behaviour of UI components.

Similar Messages

  • Getting the Selected Row from a JTable

    hi,
    how Can i get the Selected row from a JTable
    thanks...

    You know that JTable class? Well, you see those methods in it called "getSelectedRow()" and "getSelectedRows()"...?

  • Deleting rows from a JTable using DefaultTableModel

    First of all, is it possible to remove a row of information from a table that uses the DefaultTableModel?
    I have created a table using the default table model as follows:
              tblPhoneNumbers = new JTable(new DefaultTableModel(
                        new Object[][]{{"",""}},
                        new Object[]{"Number", "Type"})
    I then have a button that when clicked is supposed to remove the selected row from the table:
         protected void btnRemovePhoneActionPerformed(ActionEvent evt) {
              DefaultTableModel phoneDm = (DefaultTableModel) tblPhoneNumbers.getModel();
              int selectedRow = tblPhoneNumbers.getSelectedRow();
              int numRows = tblPhoneNumbers.getRowCount();
              if(selectedRow >= 0 && selectedRow < numRows-1)
                   phoneDm.removeRow(selectedRow);
    By calling the removeRow() method it is updating the table in the dialog just fine, and shifting all of the information up to where it belongs. But if for example I remove the first row, and then try to access the information in the first row, the information I supposedly just removed is still there.
    Am I supposed to be firing an event on removing that row to manually update the data in the table? If so, how would I do that?
    It seems like this should be really easy to do I just can't for the life of me figure out what I'm doing wrong.
    Thanks

    But if for example I remove the first row, and then try to access the
    information in the first row, the information I supposedly just removed is still there.Never seen that before.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Deleting a row from a JTable using AbstractTableModel

    Hi,
    Can someone please help me on how should i go about deleting a row in a jtable using the AbstractTableModel. Here i know how to delete it by using vector as one of the elements in the table. But i want to know how to delete it using an Object[][] as the row field.
    Thanks for the help

    Hi,
    I'm in desperate position for this please help

  • Deleting a row from a JTable using a custom TableModel

    Before I waste any of your time I would like to go ahead and just say that I have searched through the forum using "delete row from Jtable" as the search keywords and while I have found very closely related issues, they have not solved my problem. I have found code postings by carmickr and his arguments as to why we should use DefaultTableModel instead of having created our own custom TableModel, and while I do agree, I just am not quite confident enough in applying it to my scenario. See I am reading from a file a bunch of Contractor objects and I am stuffing it into an arraylist which I am using in the following code posting to populate my TableModel which the JTable object in the gui then uses.
    My problem is that everything works except when I delete and when I delete I understand that the index is changing because I just removed a row from the arraylist object. Suppose I have 33 rows displaying in the GUI. Now after I delete say row #23, the delete function works and dutifuly the row disappears from the table, but if I try to delete a row say...the last row, it does not work and throws me an IndexOutOfBoundsException which totally makes sense. My question is how do I go about fixing it? Do I have to do something with the setRowCount method?
    Any help is appreciated.
    Cheers,
    Surya
    * ContractorTableModel.java
    * Created on January 12, 2006, 11:59 PM
    package code.suncertify.gui;
    import java.util.ArrayList;
    import java.util.logging.Logger;
    import javax.swing.table.AbstractTableModel;
    import code.suncertify.db.Contractor;
    * @author Surya De
    * @version 1.0
    public class ContractorTableModel extends AbstractTableModel {
         * The Logger instance. All log messages from this class are routed through
         * this member. The Logger namespace is <code>sampleproject.gui</code>.
        private Logger log = Logger.getLogger("code.gui");
         * An array of <code>String</code> objects representing the table headers.
        private String [] headerNames = {"Record Number", "Contractor Name",
        "Location", "Specialties","Size", "Rate",
        "Owner"};
         * Holds all Contractor instances displayed in the main table.
        private ArrayList <Object> contractorRecords = new ArrayList<Object>(5);
         * Returns the column count of the table.
         * @return An integer indicating the number or columns in the table.
        public int getColumnCount() {
            return this.headerNames.length;
         * Returns the number of rows in the table.
         * @return An integer indicating the number of rows in the table.
        public int getRowCount() {
            return this.contractorRecords.size();
         * Gets a value from a specified index in the table.
         * @param row An integer representing the row index.
         * @param column An integer representing the column index.
         * @return The object located at the specified row and column.
        public Object getValueAt(int row, int column) {
            Object [] temp = (Object[]) this.contractorRecords.get(row);
            return temp[column];
         * Sets the cell value at a specified index.
         * @param obj The object that is placed in the table cell.
         * @param row The row index.
         * @param column The column index.
        public void setValueAt(Object obj, int row, int column) {
            Object [] temp = (Object []) this.contractorRecords.get(row);
            temp [column] = obj;
         * Returns the name of a column at a given column index.
         * @param column The specified column index.
         * @return A String containing the column name.
        public String getColumnName(int column) {
            return headerNames[column];
         * Given a row and column index, indicates if a table cell can be edited.
         * @param row Specified row index.
         * @param column Specified column index.
         * @return A boolean indicating if a cell is editable.
        public boolean isCellEditable(int row, int column) {
            return false;
         * Adds a row of Contractor data to the table.
         * @param specialty
         * @param recNo The record number of the row in question.
         * @param name The name of the contractor.
         * @param location Where the contractor is located
         * @param size Number of workers for the contractor
         * @param rate The contractor specific charge rate
         * @param owner Name of owner
        public void addContractorRecord(int recNo, String name,
                String location, String specialty,
                int size, float rate, String owner) {
            Object [] temp = {new Integer(recNo), name,
            location, specialty, new Integer(size),
            new Float(rate), owner};
            this.contractorRecords.add(temp);
            fireTableDataChanged();
         * Adds a Contractor object to the table.
         * @param contractor The Contractor object to add to the table.
        public void addContractorRecord(Contractor contractor) {
            Object [] temp = {new Integer(contractor.getRecordNumber()),
            contractor.getName(), contractor.getLocation(),
            contractor.getSpecialties(), new Integer(contractor.getSize()),
            new Float(contractor.getRate()), contractor.getCustomerID()};
            this.contractorRecords.add(temp);
            fireTableDataChanged();
         * Deletes a row of Contractor data to the table.
         * @FIXME Now that I deleted a row then I will have to reset the internal structure so that I can delete again
         * @param recNo The record number of the row in question.
        public void deleteContractorRecord(int recNo) {
            contractorRecords.remove(recNo - 1);
            fireTableRowsDeleted(recNo -1, recNo - 1);
    }

    Wow that was a very quick response. Thanks camickr. I am only trying to delete a single row. I do not know how to go about posting a test program for the code I have posted above because honestly the gui itself is 800 lines of code, and then the file reading class is quite funky in itself. I can maybe email you the entire Netbeans project including code so if you are using Netbeans 5 RC2 you can run the code and see for yourself, but that would not be considerate of me.
    See I am trying to delete any row at any time...but only one at a time not multiple rows...so if a user decides to delete row 23 and then tries to delete the last row which happens to be row 33 in my case, my setup should be smart enough to still allow to delete the row.

  • Delete operation is not working to delete selected row from ADF table

    Hi All,
    We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
    <af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
    rows="#{bindings.EventCalendarVO.rangeSize}"
    emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.EventCalendarVO.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
    >
    To perform delete operation i have one delete button.
    <af:commandToolbarButton
    text="Delete"
    disabled="#{!bindings.Delete.enabled}"
    id="ctb3" accessKey="d"
    actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
    As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
    public void deleteCurrentRow (ActionEvent actionEvent) *{*               DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    // Get an object representing the table and what may be selected within it
    ViewObject eventCalVO = dcItteratorBindings.getViewObject();
    // Remove selected row
    eventCalVO.removeCurrentRow();
    it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
    We have tried the below code as well in deleteCurrentRow() method
    RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    rowData.getRow().remove();
    The same behavior still.
    Thanks in advance.
    Rechin
    Edited by: 900997 on Mar 7, 2012 3:56 AM
    Edited by: 900997 on Mar 7, 2012 4:01 AM
    Edited by: 900997 on Mar 7, 2012 4:03 AM

    JDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
    as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
    Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
    This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
    Anyway you can try to remove the iterator row you get
    public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    dcItteratorBindings.removeCurrentRow();Timo

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How to delete the selected rows in a JTable on pressing a button?

    How to delete the selected rows in a JTable on pressing a button?

    You are right. I did the same.
    Following is the code where some of them might find it useful in future.
    jTable1.selectAll();
    int[] array = jTable1.getSelectedRows();
    for(int i=array.length-1;i>=0;i--)
    DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
    model.removeRow(i);
    }

  • To change the font of a selected row in a Jtable

    Hello,
    Is it possible to change the font of a selected row in a jtable?
    i.e. if all the table is set to a bold font, how would you change the font of the row selected to a normal (not bold) font?
    thank you.

    String will be left justified
    Integer will be right justified
    Date will be a simple date without the time.
    As it will with this renderer.Only if your custom renderer duplicates the code
    found in each of the above renderers. This is a waste
    of time to duplicate code. The idea is to reuse code
    not duplicate and debug again.
    No, no, no there will be NO duplicated code.
    A single renderer class can handle all types ofdata.
    Sure you can fit a square peg into a round hole if
    you work hard enough. Why does the JDK come with
    separate renderers for Date, Integer, Double, Icon,
    Boolean? So that, by default the rendering for common classes is done correctly.
    Because its a better design then having code
    with a bunch of "instanceof" checks and nested
    if...else code.This is only required for customization BEYOND what the default renderers provide
    >
    And you would only have to use instanceof checkswhen you required custom
    rendering for a particular classAgreed, but as soon as you do require custom
    renderering you need to customize your renderer.
    which you would also have to do with theprepareRenderer calls too
    Not true. The code is the same whether you treat
    every cell as a String or whether you use a custom
    renderer for every cell. Here is the code to make the
    text of the selected line(s) bold:
    public Component prepareRenderer(TableCellRenderer
    renderer, int row, int column)
    Component c = super.prepareRenderer(renderer, row,
    , column);
         if (isRowSelected(row))
              c.setFont( c.getFont().deriveFont(Font.BOLD) );
         return c;
    }It will work for any renderer used by the table since
    the prepareRenderer(...) method returns a Component.
    There is no need to do any kind of "instanceof"
    checking. It doesn't matter whether the cell is
    renderered with the "Object" renderer or the
    "Integer" renderer.
    If the user wants to treat all columns as Strings or
    treat individual columns as String, Integer, Data...,
    then they only need to override the getColumnClass()
    method. There is no change to the prepareRenderer()
    code.
    Have you actually tried the code to see how simple it
    is?
    I've posted my code. Why don't you post your solution
    that will allow the user to bold the text of a Date,
    Integer, and String data in separate column and then
    let the poster decide.Well, I don't see a compilable, runnable demo anywhere in this thread. So here's one
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Arrays;
    import java.util.Date;
    import java.util.Vector;
    public class TableRendererDemo extends JFrame{
        String[] headers = {"String","Integer","Float","Boolean","Date"};
        private JTable table;
        public TableRendererDemo() {
            buildGUI();
        private void buildGUI() {
            JPanel mainPanel = (JPanel) getContentPane();
            mainPanel.setLayout(new BorderLayout());
            Vector headerVector = new Vector(Arrays.asList(headers));
             Vector data = createDataVector();
            DefaultTableModel tableModel = new DefaultTableModel(data, headerVector){
                public Class getColumnClass(int columnIndex) {
                    return getValueAt(0,columnIndex).getClass();
            table = new JTable(tableModel);
    //        table.setDefaultRenderer(Object.class, new MyTableCellRenderer());
            table.setDefaultRenderer(String.class, new MyTableCellRenderer());
            table.setDefaultRenderer(Integer.class, new MyTableCellRenderer());
            table.setDefaultRenderer(Float.class, new MyTableCellRenderer());
            table.setDefaultRenderer(Date.class, new MyTableCellRenderer());
            JScrollPane jsp = new JScrollPane(table);
            mainPanel.add(jsp, BorderLayout.CENTER);
            pack();
            setLocationRelativeTo(null);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        private Vector createDataVector(){
            Vector dataVector = new Vector();
            for ( int i = 0 ; i < 10; i++){
                Vector rowVector = new Vector();
                rowVector.add(new String("String "+i));
                rowVector.add(new Integer(i));
                rowVector.add(new Float(1.23));
                rowVector.add( (i % 2 == 0 ? Boolean.TRUE : Boolean.FALSE));
                rowVector.add(new Date());
                dataVector.add(rowVector);
            return dataVector;
        public static void main(String[] args) {
            Runnable runnable = new Runnable() {
                public void run() {
                    TableRendererDemo tableRendererDemo = new TableRendererDemo();
                    tableRendererDemo.setVisible(true);
            SwingUtilities.invokeLater(runnable);
        class MyTableCellRenderer extends DefaultTableCellRenderer{
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                 super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                if ( isSelected){
                    setFont(getFont().deriveFont(Font.BOLD));
                else{
                    setFont(getFont().deriveFont(Font.PLAIN));
                if ( value instanceof Date){
                    SimpleDateFormat formatter =(SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.MEDIUM);
                    setText(formatter.format((Date)value));
                if(value instanceof Number){
                   setText(((Number)value).toString());
                return this;
    }Hardly a "bunch of instanceof or nested loops. I only used the Date instanceof to allow date format to be specified/ modified. If it was left out the Date column would be "18 Apr 2005" ( DateFormat.MEDIUM, which is default).
    Cheers
    DB

  • Getting error while deleting rows from the database using the View Object

    Hi All,
    I am using jdev 11.1.1.4.0. I am removing the rows from the database using viewobject( quering the viewobject to find the records i want to delete).
    I am using vo.removeCurrentRow(0). Before this statement I am able to get the rows I want to delete.
    after that i am doing am.transaction.commit(). But I am getting the error..
    javax.faces.el.EvaluationException: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1117)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8134)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5863)
         at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6369)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6551)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3275)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3078)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2088)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2369)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         ... 53 more
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:869)
    Please give suggestions...
    Thanks
    Kanika

    Hi,
    First Run Application module and confirm whether model project is OK,Cause for the Error is Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
    check:
    Issues with table/column name length
    identifier is too long
    I guess following error occurred because above issue
    JBO-26080: DMLException
    Cause: An unexpected exception occurred while executing the SQL to fetch data for an entity instance or lock it.
    Action: Fix the cause for the SQLException in the details of this exception.
    See:
    http://download.oracle.com/docs/cd/A97337_01/ias102_otn/buslog.102/bc4j/jboerrormessages.html#26080Hope you will helpful

  • Removing rows from a JTable

    How can i remove a row from a JTable??

    You need to extends AbstractTableModel rather than use DefaultTableModel as I think from memory this just uses an array to store data.
    If you use a vector in your subclass to store your rows, then you can do something like this:
        public boolean delete(int rowIndex)
            if (rowIndex < 0 || rowIndex >= rowVector.size())
                return false;
            else
                int day = 0;
                MyRowClass row = rowVector.get(rowIndex);
                rowVector.remove(rowIndex);
                rowCount--;
                fireTableRowsDeleted(rowIndex, rowIndex);
                return true;
        }HTH
    Paul C.

  • Deleting rows from a JTable

    Hello,
    I've got a JTable which is based on a 2-dimensional array, which contains my data. Now I want to delete several rows from the JTable. There's the possibility to modify my data-array by creating a new array which doesn't contain anymore the datasets I want to delete. Afterwards I can redraw the table and my rows are deleted. But I think that's a very complicated way to delete rows from a JTable. Can anybody tell me whether ther's an easier way to do so ? I'd really be pleased...
    Thanx,
    Findus

    When you create a TableModel using a two-dimensional array or a Vector of Vectors, a DefaultTableModel is created and it stores the data in its own Vector of Vectors. The DefaultTableModel supports methods for adding/removing rows of data. To remove the first row in the table you would do something like:
    DefaultTableModel model = (DefaultTableModel)table.getModel();
    model.removeRow( 0 );
    Note: once you create the TableModel you should set your array to null as it is not used anymore.

  • How to select rows from database like 10 to 20 etc

    Hi Experts,
    I want to select rows from database like row number 10 to row number 20.How could it be done?

    HI,
       First get the data into the INTERNAL TABLE from the FLAT FILE and read the internal table using the index.
        ex: 1) Read table ITAB index 10.
              2) Read table ITAB index 20.
    or use as said by  Srinivas Gurram, to get the range of records using where condition to the loop.
    <REMOVED BY MODERATOR>
    Edited by: Ravi Kumar on Jun 9, 2008 4:01 PM
    Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:16 PM

  • Filter rows from 2 fields using OR statement

    New to Power Query M language.
    have the following query that will select rows from a view:
    let
        Source = Sql.Database("JOHNSQLD53", "EnterpriseAnalytics"),
        dbo_vFactEngrgServiceLocMonthlyAsOfSnapshot = Source{[Schema="dbo",Item="vFactEngrgServiceLocMonthlyAsOfSnapshot"]}[Data],
        #"Filtered Rows" = Table.SelectRows(dbo_vFactEngrgServiceLocMonthlyAsOfSnapshot, each [BeProspectClientOrgId] = 4624),
        #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [IsLastMonthOfYear] = "Y"),
        #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [IsLatestSnapshot] = "Y")
    in
        #"Filtered Rows2"
    Right now, it is saying where BeProspectClientOrgId = 4624 AND IsLastMonthOfYear = Y AND IsLatestSnapshot = Y.  What I need is:
    BeProspectClientOrgId = 4624 AND (IsLastMonthOfYear = Y ORIsLatestSnapshot = Y)
    is there a way to do this in M?
    thanks
    Scott

    thanks Tristan,
    that was easy enough.  I had the same but i had the "Each" keyword in front of both fields, which wasn't working.
    I have another filter that is a bit more tricky:
    SnapshotYear BETWEEN  
    (Select top 1 SnapshotYear-4 from dbo.vFactEngrgServiceLocMonthlyAsOfSnapshot where IsLatestSnapshot = 'Y') 
    AND 
    (Select top 1 SnapshotYear from dbo.vFactEngrgServiceLocMonthlyAsOfSnapshot where IsLatestSnapshot = 'Y')  
    basically trying to get a rolling 5 years of SnapShotYear field but only for records where IsLatestSnapshot = 'Y"
    any ideas using "M"?
    thanks
    Scott

Maybe you are looking for

  • Day 1 - problems and feedback

    Hi everyone, before I list the problems on my imac let me first give ou the specs & config: 20" 2ghz duo core 250gb 2gb (factory installed) 256 vram and yes, the dreaded build #8G1171 Here are the problems: 1 - front row doesn't work (app not respond

  • In Lion, Safari 5.1 no longer plays .m3u files

    In Lion, Safari 5.1 no longer plays .m3u files - it just downloads them, and dragging the file back into the browser doesn't do anything. This functionality used to work in 10.6 - the .m3u file would play directly in the browser. The .m3u files still

  • Using SQL in froms Builder!!!!

    I´am having problems using the SQL commands in Forms Builder. can anyone help me!! show me who can i attribute a selection to an item??

  • Source system compounded

    Hi Guys, At my client we need to make certain Info objects system compounded. The problem, when activating the Infoobjects an error message appears saying that the Infoobject contains data in the Infosource and ODS. Does anyone know how to bypass thi

  • Loading an image in an applet

    I am trying to load and display an existing image to my applet and break the image up into segments to allow the pieces to be moved into their correct position. However it is only getting as far as cutting the image up but it does not complete loadin