I Need Help In Deleting Table row by clicking on "Delete" button inside the

Dear all,
first i'm new to Swing
i have created table with customized table model, i fill this table using 2d array, this table rows contains JButtons rendered using ButtonRenderer.java class and action listeners attached by the AbstractButtonEditor.java
what iam trying to do is when i click on a specified button in table row i want this row to be deleted, i found some examples that uses defaultTableModelRef.removeRow(index), but iam using customized table model and the following is my code
JTable tblPreview = new JTable();
          DbExpFormTableModel model = new DbExpFormTableModel();               
          tblPreview.setModel(model);
//adding the edit button          
          tblPreview.getColumn("Edit").setCellRenderer(new ButtonRenderer());
          tblPreview.getColumn("Edit").setCellEditor(new AbstractButtonEditor(new JCheckBox()));
          //adding the delete button
          tblPreview.getColumn("Delete").setCellRenderer(new ButtonRenderer());
          tblPreview.getColumn("Delete").setCellEditor(new AbstractButtonEditor(new JCheckBox()));
and here is the code of the code of my customized table model ( DbExpFormTableModel )
public class DbExpFormTableModel extends GeneralTableModel
     public DbExpFormTableModel()
          setColumnsNames();
          fillTable();          
     private void setColumnsNames()
          columnNames = new String [5];
          columnNames[0] = "ID";
          columnNames[1] = "Database ID";
          columnNames[2] = "Prestatement";
          columnNames[3] = "Edit";
          columnNames[4] = "Delete";
     private void fillTable()
          int numOfRows = 2;     // = getNumberOfRows();
          data = new Object[numOfRows][5];          
          data[0][0] = "1"; //we must get this value from the database, it is incremental identity
          data[0][1] = "AAA";
          data[0][2] = "insert into table 1 values(? , ? , ?)";
          data[0][3] = "Edit";
          data[0][4] = "Del";
          data[1][0] = "2"; //we must get this value from the database, it is incremental identity
          data[1][1] = "BBB";
          data[1][2] = "insert into table2 values(? , ? , ? , ?)";
          data[1][3] = "Edit";
          data[1][4] = "Del";
and this is the GeneralTableModel class
public class GeneralTableModel extends AbstractTableModel implements Serializable
     public static Object [][] data;
     public static String[] columnNames;
     //these functions should be implemented to fill the grid
     public int getRowCount()
          return data.length;
     public int getColumnCount()
          return columnNames.length;
     public String getColumnName(int col)
return columnNames[col];
     public Object getValueAt(int row , int col)
          return data[row][col];
     //i've implemented this function to enable events on added buttons
     public boolean isCellEditable(int rowIndex, int columnIndex)
          return true;
     public Class getColumnClass(int c)
return getValueAt(0, c).getClass();
public void setValueAt(Object value, int row, int col)
//fireTableDataChanged();          
data[row][col] = value;          
fireTableCellUpdated(row, col);     
And Now what i want to do is to delete the clicked row from the table, so please help me...
thank you in advance

Hi Sureshkumar,
1. Create a value attribute named <b>select</b> of type boolean.
2. Bind the <b>checked property</b> of all the checkboxes to this attribute.
3. Create an action called <b>click</b> and bind it to <b>OnAction</b> event of the button(whose click will check all the checkboxes) and write this code in that action.
<b>wdContext.currentContextElement().setSelect(true);</b>
Warm Regards,
Murtuza

Similar Messages

  • [SOLVED :)] Need help with adf table row selection

    Hi,
    In my application I am displaying results in a table. The DisplayRow property of table is set to Selected
    There are Next and Back buttons which help user to view details associated to the next/previous rows.
    I am using ADF 11g
    When user clicks Next or Previous button, then the selection of the row should also gets updated
    To achieve this i wrote below piece of code:
    this.tblS.getSelectedRowKeys().clear();+
    this.tblS.setRowIndex(count);+
    RowKeySet rks =  tblS.getSelectedRowKeys();+
    rks.add(tblS.getRowKey());+
    rks =  tblS.getSelectedRowKeys();+
    ISSUE:_
    When i run application and click Next/Previous Button, all functionalities do take place properly, but a null pointer exception is also thrown._+
    If i remove DisplayRow property of table from Selected to Default, every thing works good and no Exception is thrown_+       
    But as records in my table are going to be around 50-60 everytime, i need to set DisplayRow property of table to Selected.
    Is there any way to achieve this? Solve this problem?
    Some more details:_
    I am using a POJO class to create DataController. This DataController is having a view Object which is used to create results table.
    I have defined Primary key for my POJO Data Controller.
    Here is code of xml file:*
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<JavaBean xmlns="http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.52.5"+
    id="ProductListBean" Package="xxadf.mm.resources"
    BeanClass="xxadf.mm.resources.ProductListBean"
    isJavaBased="true">
    +<Attribute Name="Product" Type="java.lang.String" PrimaryKey="true"/>+
    +<Attribute Name="Stock" Type="java.lang.String"/>+
    +<Attribute Name="Rate" Type="java.lang.String"/>+
    +<Attribute Name="Accuracy" Type="java.lang.String"/>+
    +<Attribute Name="Details" Type="java.lang.String"/>+
    +<ConstructorMethod IsCollection="true"+
    Type="xxadf.mm.resources.ProductListBean"
    BeanClass="xxadf.mm.resources.ProductListBean"
    id="ProductListBean"/>
    +</JavaBean>+
    Error Log:*
    SEVERE: Server Exception during PPR, #1
    java.lang.NullPointerException
    at oracle.adfinternal.view.faces.model.binding.RowDataManager.getRowIndex(RowDataManager.java:200)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.getRowIndex(FacesCtrlHierBinding.java:506)
    at org.apache.myfaces.trinidad.component.UIXIterator._fixupFirst(UIXIterator.java:414)
    at org.apache.myfaces.trinidad.component.UIXIterator.__encodeBegin(UIXIterator.java:392)
    at org.apache.myfaces.trinidad.component.UIXTable.__encodeBegin(UIXTable.java:168)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:517)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeHorizontalChild(PanelGroupLayoutRenderer.java:458)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$100(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:618)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:392)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:641)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.access$100(ShowDetailItemRenderer.java:31)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:491)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:464)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer._encodeChildren(ShowDetailItemRenderer.java:406)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.encodeAll(ShowDetailItemRenderer.java:114)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:1523)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.access$500(PanelTabbedRenderer.java:38)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:969)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:920)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer._renderTabBody(PanelTabbedRenderer.java:519)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.encodeAll(PanelTabbedRenderer.java:233)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:221)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:820)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1494)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:685)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:261)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:193)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    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:292)
    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:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    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.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Please Help I have been struggling with this issue for long.
    Thanks and Regards
    Manav Ratra
    Edited by: user11255144 on Feb 8, 2010 5:33 AM

    Hi Arun,
    Thanks for replying.
    Actually in my application there is one result table and a section that is displaying complete details of the product selectd in result table.
    The next/previous buttons are not binded with result table.
    What I am doing is, I am puuliing data from VO and displaying it on form, whenever any of these buttons is clicked.
    As soon as these buttons are clicked data is coming up, but selection state of table is not getting updated.
    So to update selection state i wrote piece of code described in my previous post.
    Everything works fine if displayRow property of table is not set to selected.
    If i set display row property of table to selected, then i get a null pointer exception with message log defined in previous post.
    Although NPE is thrown, yet all data is properly fetched and table selection is also updated. But am not able to get how this NPE is coming and hpw to fix it .
    (I need to keep displayRow = selected, for all other cases NPE is not thrown)
    Please help..
    Thanks and Regards
    Manav Ratra

  • Hey guys I seriously need help... I just got my iPad 3 delivered the before yesterday and yesterday i was going though the AppStore and found some app called "performamce test and I ran the test and that apps tell me I have poor 3d perfoamce. *worried* :(

    Hey guys I seriously need help... I just got my iPad 3 delivered the before yesterday and yesterday i was going though the AppStore and found some app called "performamce test and I ran the test and that apps tell me I have poor 3d perfoamce. *worried* :( I've been up since tomorrow. Could you install that app and tell me what scores do you guys get? :(

    http://www.google.com.pk/url?sa=t&rct=j&q=performance%20test%20mobile%20itunes&s ource=web&cd=2&ved=0CGYQFjAB&url=http%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Fperf ormancetest-mobile%2Fid494438360%3Fmt%3D8&ei=cOf_T-r2AuzT4QSpv4zBCA&usg=AFQjCNGi c8vn6zl8AINqrYuNc2RYobSiVA
    Here's the link.

  • Need help connecting my iPhone 6 to my MacBook Pro to stream the internet

    Need help connecting my iPhone 6 to my MacBook Pro to stream the internet

    Turn on Personal Hotspot on your iPhone, select WiFi, set a password. Then select your hotspot on your MacBook Pro and sign in.

  • I need help please. I have 6 apps updates shown on on the upper right corner of the app store icon. When i tried to open the apps store and go to updates, the apps that need to be updated were not appearing therefore i have no idea what those apps

    I need help please. I have 6 apps updates shown on on the upper right corner of the app store icon. When i tried to open the apps store and go to updates, the apps that need to be updated were not appearing therefore i have no idea what those apps are so that i can update them. Please give some solutions please

    isthisonetaken wrote:
    I'm having this problem. It started yesterday. I have 2 updates, but when I open the App Store, they won't appear.
    Do you have apps purchased with a differnt AppleID?
    For example, mine shows 12 updates but only 2 show up as being available.
    The others are on my daughters account.
    I log out of my iTunes account and log in with hers and those updates show up.

  • Need help! I can't listen music by my headset and the loudspeaker works well, what should i do ?

    Need help! I can't listen music by my headset and the loudspeaker works well, what should i do ?

    if you mean that you can't listen to music from the headset and from the phone speaker at the same time then that is by design works the same with all things really such as computer and the likes too
    if you mean that the device does not play out of a connected headset only out of the speaker then you have a hardware issue with the headset detector you can read more about it here even though most have the opposite issue but it's the same issue really
    iPhone stuck in "headphones" mode

  • How can i delete Record when i click on Delete Link in a report

    hi,
    i have to create report
    select S_NO,BILL_NO,LED_NAME,PUR_LED,VAT,BILL_DATE,ST_GRP_UND,GODOWN_NAME,
    ITEM_NAME,UNIT,QTY,RATE,PER,DIS,AMOUNT,'Delete' from DUMY_AC_LED_PURASEI want to delete corressponding record when i click on Delete Link.
    Here S_NO is P.k.
    How can i delete Record when i click on Delete Link.

    Manoj,
    If something does not work then you should report back on the same thread so that there is continuity to the whole episode. Be as lucid as you can be so that people know whats the scenario. E.g. is not working is not enough. What happens? Does is show error , go blank, goes to another page... all that is important.
    Its for posterity, down the line others will also visit the thread (may be).
    Regards,

  • Need help with disappearing header row in tables

    Hey guys.
    I'm working on a large document with tables (annual report). I have set up table styles with header and body cell styles. When I apply the table style to a table, then convert the first row to header row, the entire header row disappears...!
    If I leave the row as body row and just apply the header cell style to it, it won't disappear. The row will only disappear if I convert it to header row in Indesign.
    I checked the Word doc I imported the text from, the first row of the tables is just normal body row.
    I dunno where to look so I have no idea how to fix this problem. It happens to all the tables. I was supplied this file. I don't particularly want to recreate the file. The original file was created in Creative Clouds and exported to idml for me as I have CS6.
    Has anyone experienced the same problem or know what's the solution? I really need help.
    Thanks in advance.

    It may be on the Table Options dailog box on the section of Headers and Footers> Header: Repeat Header the Skip First is check on.

  • Need help in quering table in loop

    I have following scenario and need some help:
    I have Table A from there I need to select NAME in LOOP and query Table B with each name.
    Table B can give me more than one record per call and then I have to select the best record and update the Table A with Table B values (best row).
    I have created a global temp table and insert the table B results in that table and then loop through Temp table to decide which record is best. Then update the Table A.
    This solution is working but is very slow. I have created indexes on all the tables but still very slow. Is there any solution to make it fast?
    Thanks

    skas wrote:
    I have following scenario and need some help:
    I have Table A from there I need to select NAME in LOOP and query Table B with each name.
    Table B can give me more than one record per call and then I have to select the best record and update the Table A with Table B values (best row).
    I have created a global temp table and insert the table B results in that table and then loop through Temp table to decide which record is best. Then update the Table A.
    This solution is working but is very slow. I have created indexes on all the tables but still very slow. Is there any solution to make it fast?
    ThanksDon't use PL/SQL loops, don't use GTT's, do it in plain sql. If you post the table descriptions and some sample data (preferrably in the form of cretate table and insert statement) and explain how you determine "the best record" in table B I'm sure that someone here could help you with the requirements.
    John

  • Need help creating Vector table for specific class

    I am trying to create a Vector table of class Node and I think I understand the concept but in practice I am not
    sure why the compiler complains about non-static reference on statement mv.table.add(new Node(names[n]). Please help. I can not get this thing to work.
    import java.util.*;
    class MyVector {
    Vtable table;
    public static void main(String[] args){
    MyVector mv = new MyVector();
    String names[] = {"one","two","three","four","five"};
    for (int n;n<names.length;n++)
    mv.table.add(new Node(names[n])); //<-ERROR
    table.list();
    if (table.del("de")) System.out.println("deleted");
    table.list();
    public MyVector(){
    System.out.println("MyVector_C");
    table = new Vtable();
    public class Node {
    private String name;
    public Node(){name=new String("Null");}
    public Node(String s){name=s;}
    public void setName(String s){name=s;}
    public String getName(){return name;}
    public String toString(){return "[Node:"+name+"]";}
    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    public void list(){
    Iterator i=v.iterator();
    while (i.hasNext()){System.out.println((Node)i.next());}
    public Boolean del(String s) {
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n = (Node)i.next();
    if (s.equals((String)n.name)) {
    v.remove(n);
    return(true);
    return(false);
    }

    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    I get ur problem...
    When VTable extends Vector all u have to do is...
    VTable table=new VTable();
    table.add(new node(..));
    There is no need to get the Vector obj in picture as VTable extends Vector...
    I guess, this helps u.

  • Need Help with Unusual Table Behavior

    I've been asked to create a table with unusual behaviors, and I'm a little stuck on how to implement it. The table has cells with dates and blanks in it. The following rules need to work:
    1. If the cell has a date in it, then:
    a. If the user single-clicks on the cell, the cell should be selected. At most, the date could be highlighted and copied, but not changed
    b. If the user double-clicks on the cell, a popup window should appear that allows entry of detailed data about the date. This overrides the default behaviors of entering edit mode on double-click.
    c. If the user presses F2, the cell should enter edit mode and allow the user to edit or remove the date. This prevents the user from accidently changing an existing date, which is supposed to be a rare occurance anyway.
    2. If the cell has no date, then:
    a. If the user single-clicks a cell, double-clicks a cell, or uses the keyboard to navigate to a cell and then begins typing, the cell should enter edit mode and allow the user to enter a date. Once a valid date has been entered, the rules for #1 apply.
    Optional:
    The user can remove a date by clearing the date, but it would be nice if they could select multiple dates for deletion.
    Any ideas would be appreciated. Right now, I'm stuck on how to make the cell editable with a single click depending on whether there is a date already in it.

    Torgil wrote:
    PatrickRThomas wrote:
    Fair enough, but in all the topics I've seen on this site, I almost never see someone respond once they've been given an answer to their question. Why call me out on it and not everyone else?It's not just you. It's becoming more and more common actually. Here's an example from only yesterday (reply 3):
    [http://forums.sun.com/thread.jspa?threadID=5340766]
    Now, you may not like this, but the fact remains that this is how this particular forum works, and if you want help from the regulars here it's in your best interest to stick to the forum rules. Arguing about it almost never helps your case. (Personally I don't care much either way, but that's just me and as you can see from my posting history I'm not here very often so my opinion doesn't matter much.)
    Finally, if you want help on JTables in particular, camickr is your man, so you might want to stay on his good side :-)In that thread you cited, it's fair to point out that the person never responded, but calling him a louse, etc. was uncalled for and unprofessional. If someone had politely said that I should reply to my other threads, I would have apologized and moved on. However, that's not what happened. I was called out in a way intended to humiliate me for 2 instances, not for my failure to reply, but for failing to reply quickly enough. That's what I found to be so ridiculous, and hence, my sarcasm. In the third instance, perhaps I should have responded with a "thank you" to the second response that I received. I'll take my lumps for that one. I also took offense to the suggestion that I only replied to my previous thread because I wanted help on this one. That was just a baseless accusation.
    And for the record, the reason that I'm responding to this topic so quickly is that my email notifications are working this time. I do check my watchlist when I have a question that needs answering, but if I get pulled off onto another task, I may not check it for a while. I can't help that.

  • WebDynpro : Delete Table Row

    HI All,
    Im developing a webdynpro application in which I have a table in which the data is fetched form the backend (Function module) and displayed.
    The Function Module takes in paramaters:
    1, Case_ID (for identifying wether to delete, insert or update a record)
    2. EMP ID
    3. First name
    4. Lastname
    5 Gender
    and returns the following :
    1. EMP ID
    2. First name
    3. Lastname
    4 Gender
    I have been able to insert the data in the table, now my requirement is that I should be able to select a row from the table and on click of the delete button, that row should get deleted.
    Simple.
    Please suggest how to work !!
    regards
    Saurabh

    Hi Bhardwaj,
    Consider you table node is DataNode. Then u get your current selected row as follows:
    wdContext.currentDataNodeElement().getLeadSelection().getEmpID() to get empid.
    Hope this helps you.
    You can get more help at :
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/87b941d25ae434e10000000a1550b0/frameset.htm
    Thanks,
    Shiva

  • Need help with a Table with one image in it.

    I am attempting to design a site in Dreamweaver CS 4, I have Master Suite.  I would like to use a header Logo already created in photoshop and made web ready in .jpg format.
    I  am looking at inserting a single cell table across the top of page set at a percentage so it appears uniform on more browsers.
    The only problem is that there is no way to make (link) the picture to the tables scalibility feature. The table scales up or down, but
    the picture remains the set size of the image.
    Do I need to attempt to create this some other way?
    I like the essence of the above, I created it in Flash and would like to use it or something close in the design and creation of my web site.
    A Veteran, Thank You for any help or suggestions.      Ken

    Images are static.  They don't resize.
    Put image in a table cell or CSS division with a compatible Background-Color to fill in the empty regions on super wide displays.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • Need help in SQL table creation

    Hi All,
    I created a table a month back.Now i need to create another table of the same structure.
    Is there any way so dat i can get the script of the table which i created earlier and use the same to create another.
    Or is there another way so that we can create a table with same structure of the existing table.
    Please help.
    Regards,
    Mohan

    Check out the [DBMS_METADATA.GET_DDL|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1019414] function.
    Example:
    SQL> SET LONG 5000
    SQL> SELECT DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') FROM DUAL;
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"Edited by: Centinul on Jan 11, 2010 8:01 AM

  • Need help referencing expanding table data in vBody.

    I have a form that I created in LiveCycle that has an expanding table with 7 columns of data. Once the form has been completed by the user they will click a button that will trigger a mailMsg event and will send form data as a plain text email. Everything works great except for the loop that is supposed to write the table data.
    This is what the table data should look like in Outlook message.
    Column1: rawValue
    Column2  rawValue
    and so on
    Column1: rawValue
    Column2  rawValue
    and so on
    script:
    var i=0;
    for (i=1;i<=vRowCount;i++)
    vBody +="***********************************\r\n";
    vBpdy += "Column1: " + xfa.resolveNode(form.form1.ReportFields.Table1.Row1[" + (i-1) + "].Column1").rawValue + "\r\n";
    vBody +="***********************************\r\n";
    That is all I have written for the loop right now until I figure out why it is not executing.

    If you want insert and delete the same data you only have to use the same where
    Sth like th
    CTH@>create table demo
    2 ( n number,
    3 c varchar2(1),
    4 d date );
    Table created.
    CTH@>insert into demo (n,c) values (1, 'a');
    1 row created.
    CTH@>insert into demo (n,c) values (2, 'e');
    1 row created.
    CTH@>insert into demo (n,c) values (3, 'i');
    1 row created.
    CTH@>insert into demo (n,c) values (4, 'o');
    1 row created.
    CTH@>insert into demo (n,c) values (5, 'u');
    1 row created.
    CTH@>create table demo1
    2 ( n number,
    3 c varchar2(1),
    4 d date default sysdate);
    Table created.
    CTH@>begin
    2 insert into demo1
    3 select *
    4 from demo
    5 where d is null;
    6
    7 delete demo where d is null;
    8
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    CTH@>select * from demo1;
    N C D
    1 a
    2 e
    3 i
    4 o
    5 u
    5 rows selected.
    CTH@>select * from demo;
    no rows selected
    CTH@>insert into demo (n,c) values (1, 'a');
    1 row created.
    CTH@>insert into demo (n,c) values (2, 'e');
    1 row created.
    CTH@>insert into demo (n,c) values (3, 'i');
    1 row created.
    CTH@>insert into demo (n,c) values (4, 'o');
    1 row created.
    CTH@>insert into demo (n,c) values (5, 'u');
    1 row created.
    CTH@>
    CTH@>begin
    2 insert into demo1 (n,c,d)
    3 select n,c, sysdate d
    4 from demo
    5 where d is null;
    6
    7 delete demo where d is null;
    8
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    CTH@>select * from demo1;
    N C D
    1 a
    2 e
    3 i
    4 o
    5 u
    1 a 19-09-2007 13:38:07
    2 e 19-09-2007 13:38:07
    3 i 19-09-2007 13:38:07
    4 o 19-09-2007 13:38:07
    5 u 19-09-2007 13:38:07
    10 rows selected.
    CTH@>select * from demo;
    no rows selected

Maybe you are looking for

  • Bluetooth drivers for thinkpad x200

    it appears my windows 7 32bit thinkpad x200 has question marks at bluetooth adapters in device manager. I have installed the drivers that are available on the website of lenovo producer, but no change is observable.  The device seems to work well, th

  • Account determination is not happening with Cancel. Invoice (S1)

    Hi friends, Please can any one solve this error, When i create a original invoice using billing doc type(F2) account determination happens and system automatically creates accounting document as well. If i cancle the orignal invoice using billing doc

  • RMAN status=ORPHAN

    What is the meaning of status=ORPHAN, when i execute the command RMAN> list incarnation of database merlinp; List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time 1142887 1142888 MERLINP 3538586174 ORPHAN 1 06-APR-07

  • Favicons in address bar not updating

    My apologies in advance for not being all that computer literate. I updated to version 28 yesterday. Everything seemed fine until we experienced an internet outage in my service area. I received the notification from NetGear that there were problems

  • [SOLVED] Problem with adding package update count to dwm's status bar

    Following http://www.andreascarpino.it/blog/posts - s-part-ii/, I added: $ crontab -l */10 * * * * ~/bin/tempdb Along with #!/bin/bash # ~/bin/tempdb fakedb=/dev/shm/fakepacdb realdb=/var/lib/pacman [[ ! -d $fakedb ]] && { mkdir -p "$fakedb/sync" ||