Deleting a row from a Row Repeater

Hi All,
How could i delete a row from a row repeater??????
I am using REMOVE_ELEMENT method from IF_WD_CONTEXT_NODE interface... Is this the correct way!!!!!!.
Is there anyother way to do the same?????
Best Regards.
Shafiq Ahmed Khan.

Hi
first u get the index from the context element. with the help of the index u can get that particular element using get element.
then u remove the element .
check this code.
CALL METHOD context_element->get_index
  receiving
    my_index = lv_index.
CALL METHOD lo_nd_rcf_edu_det->get_element
  EXPORTING
    index        = lv_index
  receiving
    node_element = lo_el_rcf_edu_det .
CALL METHOD lo_nd_rcf_edu_det->remove_element
  EXPORTING
    element          = lo_el_rcf_edu_det
receiving
   has_been_removed =
Declare a parameter context_element in the method of type if_wd_context_element
regards
chythanya

Similar Messages

  • Delete overlapping requests from cube not working in processchain.

    In a process chain, 'deletion of overlapping requests from the cube ' step is used.
    Before this step a DTP step runs with a full update to load the cube. This process chain is scheduled every day.
    Issue is, the process chain failed at the DTP step and after correcting and repeating, the step got executed.
    However, the next step after the DTP,'delete overlapping requests from the cube'
    gets executed but without deleting the previous day's request.
    In the step details a message that 'No request for deletion were found' can be seen.
    Then next day when the DTPstep is executed without any problem the 'delete overlapping requests from cube' step is successful
    and the previous requests from cube are deleted.
    the deletion selections in the step ' delete overlapping request from infocube' is
    Delete existing requests
    Conditions:
    only delete requests from same DTP
    Selections
    Same or more comprehensive
    Because of this issue on a particular day because of the presence of 2 days requests the data is getting aggregated and shown as double in the reports.
    Please help.

    Hi Archana,
    When you delete the bad request from target and before repeating your DTP in PC, make sure the bad request deleted from table RSBKREQUEST also.
    If you find the same request in table, first delete the request from table and repeat the DTP in PC.
    Now Delete overlapping step should work.
    As this is not the permanent solution, please raise an OSS for SAP
    Regards,
    Venkatesh

  • Error while deleting a row from the Entity Object

    Hi OAF Guys,
    i am unable to delete the newly created row from the entity object.
    let me explain my scenario.
    1. i have a table of which some of the columns are mandatory.
    2. I am writing the code in the validateEntity to check wether the user really enter anything into the fields.
    3. My problem is, when the user creates row and wanted to delete the row without entering any details, the validate entity of the EO gets fired which will not allows to delete the row.
    Is there any workaround for this problem.
    Regards,
    Nagesh Manda.

    Hi Tapash,
    I am very sorry for not providing you the complete details of my scenario. Here i am explaining
    1. what code you have placed while creating the row and in validation method on EOImpl.
    while creating a new row i am initializing the primary key of the EO with the sequence value.
    2.When you say, you are unable to delete the row, are you getting a error message ? if yes, custom message or fwk error ?
    its not the fwk error, its the custom message which wrote in my validateEntity method of EO to check whether the user had entered all the necesary columns or not.
    3.How are you trying to delete the row ?
    while the user clicks on the delete switcher i am getting the primary key of the row and searching for the row in the vo and finally deleting it.
    The problem arises when the user creates a row, and later doesnt want to enter the details and delete it. Here while deleting the row the validateEntity method of the EO gets fired and doesnt allow me to do so :(.
    Any way appreciate your help tapash.
    Regards,
    Nagesh Manda.

  • Deleting 1 row from a table takes too long...why?

    We are running the following query...
    delete gemdev.lu_messagecode where mess_code ='SSY'
    and it takes way too long as there is only 1 record in this table with SSY as the mess_code.
    SQL> set timing on;
    SQL> delete gemdev.lu_messagecode where mess_code ='SSY';
    1 row deleted
    Executed in 293.469 seconds
    The table structure is very simple as you can see below.
    CREATE TABLE GEMDEV.LU_MESSAGECODE
    MESS_CODE VARCHAR2(3) NOT NULL,
    ROUTE_CODE VARCHAR2(4) NULL,
    REPORT_CES_MNEMONIC VARCHAR2(3) NULL,
    CONSTRAINT SYS_IOT_TOP_52662
    PRIMARY KEY (MESS_CODE)
    VALIDATE
    ORGANIZATION INDEX
    NOCOMPRESS
    TABLESPACE IWORKS_IOT
    LOGGING
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE(BUFFER_POOL DEFAULT)
    PCTTHRESHOLD 50
    NOPARALLEL
    ALTER TABLE GEMDEV.LU_MESSAGECODE
    ADD CONSTRAINT LU_ROUTECODE_FK3
    FOREIGN KEY (ROUTE_CODE)
    REFERENCES GEMDEV.LU_ROUTECODE (ROUTE_CODE)
    ENABLE
    ALTER TABLE GEMDEV.LU_MESSAGECODE
    ADD CONSTRAINT MSGCODE_FK_CESMNEMONIC
    FOREIGN KEY (REPORT_CES_MNEMONIC)
    REFERENCES GEMDEV.SYS_CESMNEMONIC (CES_MNEMONIC)
    ENABLE
    My explain reads as follows.
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | DELETE STATEMENT | | | | 1 (100)| |
    | 1 | DELETE | LU_MESSAGECODE | | | | |
    | 2 | INDEX UNIQUE SCAN| SYS_IOT_TOP_52662 | 1 | 133 | 1 (0)| 00:00:01 |
    Also in my AWR Sql Report I see this as well
    Plan Statistics DB/Inst: IWORKSDB/iworksdb Snaps: 778-780
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
    into the Total Database Time multiplied by 100
    Stat Name Statement Per Execution % Snap
    Elapsed Time (ms) 521,102 N/A 12.0
    CPU Time (ms) 73,922 N/A 5.1
    Executions 0 N/A N/A
    Buffer Gets 2,892,144 N/A 3.4
    Disk Reads 2,847,609 N/A 8.6
    Parse Calls 1 N/A 0.0
    Rows 0 N/A N/A
    User I/O Wait Time (ms) 475,882 N/A N/A
    Cluster Wait Time (ms) 0 N/A N/A
    Application Wait Time (ms) 0 N/A N/A
    Concurrency Wait Time (ms) 2 N/A N/A
    Invalidations 1 N/A N/A
    Version Count 1 N/A N/A
    Sharable Mem(KB) 45 N/A N/A
    Now, since the table only has 150 rows, and I am only try to delete 1 row, why is there so much disk read and why does it take 5 minutes to delete? This just weird. Does this have something to do with the Child tables?

    Any triggers on the table?
    If you trace the session, what statement(s) seem to
    be taking all that time?
    JustinWell I traced my session and I noticed that my query does take a while, but I also noticed several other queries that I was not running. Not too sure where it came from. Have a look below. It is a sample from my TKPROF utility report.
    delete gemdev.lu_messagecode
    where
    mess_code ='SSY'
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.01 0.04 0 2 23 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.01 0.04 0 2 23 1
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 57
    Rows Row Source Operation
    1 DELETE LU_MESSAGECODE (cr=3446672 pr=3442028 pw=0 time=309363335 us)
    1 INDEX UNIQUE SCAN SYS_IOT_TOP_52662 (cr=2 pr=0 pw=0 time=35 us)(object id 52663)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 35.87 35.87
    select /*+ all_rows */ count(1)
    from
    "GEMDEV"."TBLCLAIMCHARGE" where "CONTRACT_FEE_MESS_CODE" = :1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 10.53 44.95 381779 382893 0 1
    total 3 10.53 44.95 381779 382893 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=382893 pr=381779 pw=0 time=44953436 us)
    0 TABLE ACCESS FULL TBLCLAIMCHARGE (cr=382893 pr=381779 pw=0 time=44953403 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 47795 0.03 37.87
    db file sequential read 101 0.00 0.02
    select /*+ all_rows */ count(1)
    from
    "GEMDEV"."TBLCLAIMCHARGE" where "FEE_INEL_MESS_CODE" = :1

  • How to delete a row from a SQL Server CE Table with multiple JOINs?

    I want to delete a record from a SQL Server CE table.
    There are 3 tables scripts, options and results. I would like to remove a record from the results table. The where clause contains dynamic information which retrieved via other queries to different tables in the same database. These queries work fine and deliver
    the desired data.
    The Compact server is a clone of a remote table created using the sync framework. The same query to the remote table works fine.
    The error I get is:
    There was an error parsing the query. [ Token line number = 1,Token line offset = 10,Token in error = from ]
    The code that throws the exception is as follows:
    Dim connLoc As SqlCeConnection = New SqlCeConnection(My.Settings.ConnectionString)connLoc.Open()     Dim strDel As String = "Delete r from ResultsTable r inner join OptionsTable o ON o.TestName=r.TestName inner join ScriptTable c ON r.TestName=c.TestName WHERE r.TestName = '" & ds1Loc.Tables(0).Rows(0)(1) & "' AND [Index] = '" & lstIndex & "'"Dim cmdDel As SqlCeCommand = New SqlCeCommandcmdDel.CommandText = strDelcmdDel.Connection = connLoccmdDel.ExecuteNonQuery()
    The values held in ds1Loc.Tables(0).Rows(0)(1) and lstIndex are
    correct so should not be the problem.
    I also tried using parameterised queries
    Dim strDel As String = "Delete r from [ResultsTable] r inner join [OptionsTable] o ON o.TestName=r.TestName inner join [ScriptTable] c ON r.TestName=c.TestName WHERE r.TestName = @TestName AND [Index] = @lstIndex"
    Dim cmdDel As SqlCeCommand = New SqlCeCommand        cmdDel.CommandText = strDel       
    With cmdDel.Parameters           
    .Add(New SqlCeParameter("@TestName", ds1Loc.Tables(0).Rows(0)(1)))           
    .Add(New SqlCeParameter("@lstIndex", lstIndex))       
    End With 
    cmdDel.Connection = connLoc        cmdDel.ExecuteNonQuery()
    I have tried replacing the "=" with "IN" in the the WHERE clause but this has not worked.
    Is it the join that is causing the problem? I can do a select with the same search criteria and joins from the same database.
    Also this query works with SQL Server. Is it perhaps that SQL CE does not support the Delete function the same as SQL Server 2008? I have been looking at this for a while now and cannot find the source of the error. Any help would be greatly appreciated.

    Hello,
    In SQL Server Compact, we can use join in FROM clause. The DELETE statement fail may be caused by the FOREIGN KEY constraint.
    Please refer to:
    DELETE (SQL Server Compact)
    FROM Clause (SQL Server Compact)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • HOW TO DELETE THE ROW FROM DATABASE

    hI,
    Iam pasting my code below.My problem isi retrieve rows from database and display them in jsp page in rows.For each row there is delete hyperlink.Now when i click that link i should only delete the row corresponding to that delete link temporarily but it should not delete the row from database now.It should only delete the row from database when i click the save button.How can i do this can any one give some code.
    thanks
    naveen
    [email protected]
    <%@ page language="java" import="Utils.*,java.sql.*,SQLCon.ConnectionPool,java.util.Vector,java.util.StringTokenizer" %>
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Item Details</title>
    <script>
    function submitPage()
    document.details.action = "itemdetails.jsp" ;
    document.details.submit();
    </script>
    </head>
    <body>
    <form name="details" action="itemdetails.jsp" method="post">
    <%
    ConnectionPool pool;
    Connection con = null;
    Statement st;
    ResultSet rs =null;
    %>
    <table border="0" cellpadding="0" cellspacing="0" width="328">
    <tr>
    <td width="323" colspan="4"><b>Reference No :</b> <input type="text" name="txt_refno" size="14">
    <input type="submit" value="search" name="search" ></td>
    </tr>
    <tr>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item Code</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item No</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Amount </b></font></td>
    <td width="80" bgcolor="#000099"> </td>
    </tr>
    <%
    pool= new ConnectionPool();
    Utils utils = new Utils();
    double total =0.00;
    String search =utils.returnString(request.getParameter("search"));
    if(search.equals("search"))
    try
    String ref_no =utils.returnString(request.getParameter("txt_refno"));
    String strSQL="select * from ref_table where refno='" + ref_no + "' ";
    con = pool.getConnection();
    st=con.createStatement();
    rs = st.executeQuery(strSQL);
    while(rs.next())
    String itemcode=rs.getString(2);
    int item_no=rs.getInt(3);
    double amount= rs.getDouble(4);
    total= total + amount;
    %>
    <tr>
    <td width="81"><input type=hidden name=hitem value=<%=itemcode%>><%=itemcode%></td>
    <td width="81"><input type=hidden name=hitemno value=<%=item_no%>><%=item_no%></td>
    <td width="81"><input type=hidden name=hamount value=<%=amount%>><%=amount%></td>
    <td width="80"><a href="delete</td>
    </tr>
    <%
    }catch(Exception e){}
    finally {
    if (con != null) pool.returnConnection(con);
    %>
    <tr>
    <td width="323" colspan="4">
    <p align="right"><b>Total:</b><input type="text" name="txt_total" size="10" value="<%=total%>"></td>
    </tr>
    <tr>
    <td width="323" colspan="4">                   
    <input type="button" value="save" name="save"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    You mean when you click on the hyperlink you want that row to disappear from the page, but not delete the row from the database until a commit/submit button is pressed?
    Personally, I think I'd prefer that you have a delete checkbox next to every row and NOT remove them from the display if I was a user. You give your users a chance to change their mind about their choice, and when they're done they can see exactly which rows will be deleted before they commit.
    You know your problem, of course, so you might have a good reason for designing it this way. But I'd prefer not removing them from the display. JMO - MOD

  • How to delete the row from the ADF table using popup box

    Hi,
    I have one requirement like need to delete a record from the table, but that time need to show one popup window for confirmation of the deletion. I am using Delete buttom from the vo operations. I am able to delete the row with out popup but when i used the popup that time deletion is not happening.
    Can any one help me in this.
    Regards,

    Issue was resolved.

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • Deleting the Row from the table is not refreshing the contents in the form

    Hi,
    We developed a table and form in the same UI based on the following suggestion.
    Display and edit currently selected row of ADF Table in ADF Form
    1. Created one view object based on the employees table.
    2. dragged the view object to the UI as table.
    3. dragged the view object as form.
    4. set partial triggers on the form's container (panelformlayout) as tableId.
    Tested the application with the edit options and everything is working fine. But the problem comes when we delete the record from table. it is not refreshing the form based on the newly selected row after deleting the record. If we commit the data the form contents are updated to the selected row (which is not desired).
    Can you please suggest how to fix the issue, refreshing the form with the selected row after deleting the records.
    Thanks and Regards,
    S R Prasad

    The Code snippet looks fine. I think, the issue is in the partial trigger setting
    4. set partial triggers on the form's container (panelformlayout) as tableId.In order to the table to get refreshed, the table's partialTriggers property should be set to id of the delete Button.
    Go to table, select partialTriggers in the Property Inspector, Click on Expression Builder at the right and select the delete Button.
    Can you set this and check?
    Sample Code:
    <af:panelHeader text="panelHeader 1" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar">
    <af:commandButton text="Delete" id="cb1"/>
    </f:facet>
    <f:facet name="legend"/>
    <f:facet name="info">
    <af:table var="row" rowBandingInterval="0" id="t1"
    partialTriggers="::cb1">
    <af:column sortable="false" headerText="col1" id="c1">
    <af:outputText value="#{row.col1}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="col2" id="c4">
    <af:outputText value="#{row.col2}" id="ot3"/>
    </af:column>
    <af:column sortable="false" headerText="col3" id="c3">
    <af:outputText value="#{row.col3}" id="ot4"/>
    </af:column>
    <af:column sortable="false" headerText="col4" id="c5">
    <af:outputText value="#{row.col4}" id="ot2"/>
    </af:column>
    <af:column sortable="false" headerText="col5" id="c2">
    <af:outputText value="#{row.col5}" id="ot5"/>
    </af:column>
    </af:table>
    </f:facet>
    </af:panelHeader>
    Thanks,
    Navaneeth

  • Deleting A Row From Datagrid

    Hai
        I have pasted the mxml below, because i am unable to attach the mxml, pl copy this below file into flex and run the application.
      1. Run the application.
      2. Enter values in the textbox and click add, values will be added to the datagrid.
      3. now click AND or OR and then change the values in the second and thrid combobox and again click add.
      4.Like wise change the combobox values and add five rows to the datagrid.
    5.now if u delete the last row u can see the curent last row in the combobox, so that the AND or Or can be added to it
    6. now if u delete a row in between, the deleted row's value oly maintains in the combobox,so i am unable to add AND or Or to the grid
      7.I need the last row data in the datagrid to be in the second and third combobox, which ever row is deleted.
    Can anyone help me....
    Thanks in advance.
    This is the mxml for sample
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
    <![CDATA[
      // ActionScript file
    import mx.rpc.events.FaultEvent;
    import mx.controls.Alert;
            import mx.managers.CursorManager;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var adhoc:ArrayCollection = new ArrayCollection();
    [Bindable]
    public var serverString = "" ; 
          private function initImage(event:MouseEvent):void {
                  if(adhoc.length > 0){
                CursorManager.setBusyCursor();
              private function onChange():void{
          if(comboBox.selectedIndex == 0){
        }else{
              private function onChange1():void{
              if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
                datepick.visible = true
                txt.visible = false
              }else{
              txt.visible = true
                datepick.visible = false
        private function add():void{
        var str:String = txt.text;
        if(str.length == 0 && txt.visible == true){
            Alert.show("Value Can Not Be Empty");
            return;
          if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
              if(txt.visible == true){
                  var temp:Object = new Object();
        temp.fname = combo2.selectedItem;
        temp.opera = combo1.selectedItem;
        temp.val = "'"+txt.text+"'";
            adhoc.addItem(temp);
              txt.text = "";
          var str1:String = datepick.text;
          if(comboBox.selectedIndex == 1){
            if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
            if(str1.length == 0 && datepick.visible == true){
            Alert.show("Date Cannot Be Empty");
            }else{
            var temp:Object = new Object();
        temp.fname = combo2.selectedItem;
        temp.opera = combo1.selectedItem;
        temp.val = datepick.text;
              adhoc.addItem(temp);
              datepick.text = "";                   
        addbutton.enabled = false;
        addopenbracket.enabled = false;
        combo2.enabled = false;
        combo1.enabled = false;
        private function querydelete():void{
            if (AdHoc.selectedIndex > 0) {
                if(AdHoc.selectedIndex == (adhoc.length-1)){
              adhoc[AdHoc.selectedIndex-1].cond = "";
              addopenbracket.enabled = false;
              addclosebracket.enabled = false;
              addbutton.enabled = false;
              combo2.enabled = false;
              combo1.enabled = false;
              combo2.selectedItem = adhoc[adhoc.length-2].fname
              combo1.selectedItem = adhoc[adhoc.length-2].opera
                adhoc.removeItemAt(AdHoc.selectedIndex);
          //  adhocdetailgridcompilance.dataProvider = null ;
        //    adhocdetailgrid.dataProvider = null ;
            }else if (adhoc.length == 1) {
                adhoc.removeItemAt(AdHoc.selectedIndex);
          //  adhocdetailgridcompilance.dataProvider = null ;
        //    adhocdetailgrid.dataProvider = null ;
                addopenbracket.enabled = true;
              addclosebracket.enabled = true;
              addbutton.enabled = true;
              combo2.enabled = true;
              combo1.enabled = true;
            }else{
                Alert.show("Select The Rows To Delete");
          private function andSubmit():void{
            for each(var obj:Object in adhoc){
                if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
                  if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = and.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + "'"+txt.text+"'");             
              }else if(obj.fname == addclosebracket.label){
                if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = and.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + "'"+txt.text+"'");             
              if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
                if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
            if(datepick.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = and.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + datepick.text);             
                }else if(obj.fname == addclosebracket.label){
                if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = and.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + datepick.text);             
          addbutton.enabled = true;
          addopenbracket.enabled = true;
          combo2.enabled = true;
          combo1.enabled = true;
        private function orSubmit():void{
          for each(var obj:Object in adhoc){
                if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
                  if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = or.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
              }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + "'"+txt.text+"'");             
              }else if(obj.fname == addclosebracket.label){
                if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = or.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + "'"+txt.text+"'");             
              if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
                if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
            if(datepick.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = or.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
          }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + datepick.text);             
                }else if(obj.fname == addclosebracket.label){
                if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
                if(txt.visible == true){
                  trace("2 equals");
                  var temp:Object = new Object();
                  obj.cond = or.label
                  adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
                }else{
                  trace(obj.fname + ":" + combo2.selectedItem);
                  trace(obj.opera + ":" + combo1.selectedItem);
                  trace(obj.val + ":" + datepick.text);             
          addbutton.enabled = true;
          addopenbracket.enabled = true;
          combo2.enabled = true;
          combo1.enabled = true;
          public function addOpenBracket():void{
                var temp:Object = new Object();
              temp.fname = addopenbracket.label
          adhoc.addItem(temp);
          addopenbracket.enabled = false
          addclosebracket.enabled = true
                if(adhoc.length > 1 && addopenbracket.enabled == false){
                    addbutton.enabled = true
        public function addCloseBracket():void{
              var temp:Object = new Object();
              if(adhoc.length > 1){
            temp.fname = addclosebracket.label
            adhoc.addItem(temp);
            addopenbracket.enabled = true
            addclosebracket.enabled = false
          if(adhoc.length > 1 && addclosebracket.enabled == false){
                    addbutton.enabled = true
        private function dateChange(date:Date):void{
            if (date == null){
              }else{
                    txt.text = date.getDate() + '/' + (date.getMonth()+1).toString() + '/' +
                              date.getFullYear().toString() ;
        public function saveadhoc(event:Event):void {
                var AdhocRows:String = "";
        var i:int ;
              var selectedType = comboBox.selectedItem;
              if(adhoc.length == 0){
              Alert.show("Enter The Query");
              }else{
        for(i = 0; i < adhoc.length;i++) {
          if(adhoc[i].fname != null){
          AdhocRows = AdhocRows +adhoc[i].fname+" ";
          if(adhoc[i].opera != null){
          AdhocRows = AdhocRows + adhoc[i].opera+" ";
          if(adhoc[i].val != null){
          AdhocRows = AdhocRows + adhoc[i].val+" ";
          if(adhoc[i].cond != null){
          AdhocRows = AdhocRows + adhoc[i].cond+" ";
            var parameters:Object = {adhocquery:AdhocRows,FlexActionType:"ADHOCQUERYSUBMIT",adhocType:selectedType};
              //  adhocClick.send(parameters);
            private function retrieve():void{         
                datepick.visible = false
              txt.visible = true
    ]]>
    </mx:Script>
            <mx:Array id="comp">
                <mx:String>TYPE</mx:String>
            <mx:String>AUDITRESULT</mx:String>
            <mx:String>CATEGORY</mx:String>
            <mx:String>CHILDRULE</mx:String>
            <mx:String>PARENTRULE</mx:String>
            <mx:String>AUDITGROUP</mx:String>
            <mx:String>LOCATION</mx:String>
            <mx:String>VENDOR</mx:String>
            <mx:String>DEVICECATEGORY</mx:String>
        </mx:Array>
        <mx:Array id="inven">
      <mx:String>VENDOR</mx:String>
      <mx:String>DEVICETYPE</mx:String>
      <mx:String>SERIES</mx:String>
      <mx:String>MODEL</mx:String>
      <mx:String>SUP/CPU</mx:String>
      <mx:String>CODEVERSION</mx:String>
      <mx:String>IMAGENAME</mx:String>
      <mx:String>DATEDEPLOYED</mx:String>
      <mx:String>LOCATIONNAME</mx:String>
      <mx:String>ADDRESS1</mx:String>
      <mx:String>ADDRESS2</mx:String>
      <mx:String>CITY</mx:String>
      <mx:String>STATE</mx:String>
      <mx:String>COUNTRY</mx:String>
      <mx:String>FLOOR</mx:String>   
      <mx:String>CABINET</mx:String>
      <mx:String>CATEGORYNAME</mx:String>
      <mx:String>DEPARTMENT</mx:String>
      <mx:String>CONTACTNAME</mx:String>
      <mx:String>CONTACTNUMBER</mx:String>
      <mx:String>VERSION</mx:String>
      <mx:String>FILENAME</mx:String>
      <mx:String>DATEUPLOADED</mx:String>
    </mx:Array>
    <mx:Accordion x="13" y="55" width="230" height="492">
    <mx:Form label="AdHoc Query Analyzer"  width="100%"  creationComplete="retrieve()" height="100%" color="#F2F8F9" backgroundColor="#020202">
      <mx:Canvas label="Query" width="204" height="440" backgroundColor="#020202">
      <mx:ComboBox x="66" y="287" width="134"  id="comboBox" dataProvider="[COMPLIANCE , INVENTORY]" change="onChange()" color="#050505">
      </mx:ComboBox>
      <mx:ComboBox x="5" y="344" width="109.25" id="combo1" dataProvider="[=,!=,>,>=,&lt;,&lt;=,LIKE]" color="#010101"></mx:ComboBox>
      <mx:TextInput x="119.25" y="344" width="77.75" id="txt" color="#050505"/>
        <mx:Button x="3" y="401" label="Add" width="59" click="add()" id="addbutton" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Button x="66" y="401" label="Delete" width="63.25" click="querydelete()" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Button x="2" y="373" label="("  id="addopenbracket" click="addOpenBracket()"  width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Button x="51" y="373" label=")" id="addclosebracket" click="addCloseBracket()"  width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Button x="134.25" y="401" label="Submit" click="saveadhoc(event);initImage(event)" color="#FFFEFE" fillAlphas="[1.0, 0.69, 0.75, 0.65]" fillColors="[#77B97A, #77B97A, #EEEEEE, #EEEEEE]" borderColor="#77B97A" themeColor="#009DFF"/>
      <mx:ComboBox x="66" y="317" width="134" id="combo2" change="onChange1()" dataProvider="{comp}" color="#010101">
      </mx:ComboBox>
      <mx:DateField x="122.25" y="344" width="74.75" initialize="dateChange((event.target).selectedDate)" id="datepick" color="#050505"/>
      <mx:DataGrid x="1" y="1" width="203" height="282" id="AdHoc" dataProvider="{adhoc}" allowMultipleSelection="true" color="#020202">
      <mx:columns>
        <mx:DataGridColumn headerText="Name" dataField="fname" id="fnam"/>
        <mx:DataGridColumn headerText="Operator" dataField="opera" id="ope"/>
        <mx:DataGridColumn headerText="Value" dataField="val" id="valu"/>
        <mx:DataGridColumn headerText="Condition" dataField="cond" id="condt"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:Button x="99" y="373" label="AND" width="52" click="andSubmit()" id="and" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Button x="154" y="373" label="OR" width="49" click="orSubmit()" id="or" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
      <mx:Label x="7" y="291" text="TYPE" width="59" fontWeight="bold"/>
      <mx:Label x="5" y="319" text="DISPLAY" width="59" fontWeight="bold"/>
        </mx:Canvas>
      </mx:Form>
    </mx:Accordion>
    </mx:Application>

    Ok... but I am a little confused (sorry to be a nuisance ),
    my delete function within my webService requires an ID to be
    passed from the Flex application, thus when a row is selected, the
    ID of the selected row is taken, so when the Delete button is
    pressed it sends this ID to the webService where it is taken and
    used - and therefore deleting the row etc.....
    Do you mean to define the result handler for the deleteOPG
    operation in the main webService tag, i.e. :
    <mx:WebService id="wsData" wsdl=http://...?wsdl>
    <mx:operation name="getRes" result="handleWSR(event)"/>
    <mx:operation name="deleteOPG"
    result="handleWSR_deleteOPG(event)"/>
    </mx:WebService>
    and then call it in my delete function, passing the ID from
    my delete function to my new result handler function ??? :
    Thanks,
    Jon.

  • Deleting a row from a Procedure

    Hi All
    Can one of you tell me how to delete a row from a Procedure
    It is created with
    CREATE OR REPLACE PROCEDURE report.NAMEOFTABLE
    (nPutId IN Report.ID%TYPE,
    cArea IN Report.Area%TYPE,
    cSubject IN Report.Subject%TYPE,
    nUserId IN Report.EngineerID%TYPE,
    cDesc IN Report.Description%TYPE,
    cSide IN Report.SideEffects%TYPE,
    cImpact IN Report.Impact%TYPE,
    cNotes IN Report.Notes%TYPE,
    nValid IN Report.Valid%TYPE) AS
    -- Add or update Report
    -- If nId < 1 then a record is added, otherwise updated.
    BEGIN
    IF nId < 1 THEN
    INSERT INTO Report
    (Area, Subject, EngineerID,
    Description, SideEffects, Impact,
    ReportNotes, Valid)
    VALUES
    (cArea, cSubject, nUserId, cDesc, cSide, cImpact, cNotes, nValid);
    ELSE
    UPDATE Report
    SET ReportArea = cArea,
    ReportSubject = cSubject,
    ReportDescription = cDesc,
    ReportSideEffects = cSide,
    ReportImpact = cImpact,
    ReportNotes = cNotes,
    ReportValid = nValid
    WHERE ReportID = nPutId;
    END IF;
    COMMIT;
    END;
    CREATE SYNONYM Admin.NAMEOFTABLE
    Report.NAMEOFTABLE;
    But I need to make 1 field of the impact and the sideEffect called the ImpactEffect
    So how do i delete the field of Side effect and change the name of the Impact field.
    Sould I make a new Procedure?

    If you want to delete a row, you'd need a DELETE statement. It is not obvious to me, though, that you really want to delete a row. It sounds like you're trying to update a row, and there is an UPDATE statement in the procedure. Unfortunately, I'm very unsure exactly what you're trying to accomplish and how this procedure relates to that goal. Perhaps if you could post the starting state of the row, the procedure call you're trying to make, and the end state of that row, things might be much clearer.
    As an aside, do you really have a schema and a table named REPORT? That seems rather confusing.
    Justin

  • Deleting a row from a table control through right-clic​k menu

    I have a table control. I want to delete a row from it when a user right clicks on a particular row and selects "Delete row" menu item. I have managed the creation of menu item but have not been able to delete the row which is right clicked and the menu item "Delete row" is selected. Guidance required! Thanks!

    smercurio_fc wrote:
    It's irrelevant whether the table is a control or indicator. See attached VI.
    Hi smercurio,
    please see the attached picture. In my previous post i mean the different in the menu. The red marked function is not available, if the table is an indicator. LV8.5!
    Mike
    Message Edited by MikeS81 on 04-18-2008 05:19 PM
    Attachments:
    Unbenannt.PNG ‏22 KB

  • Deleting a row from matrix by context menu

    Hi all
    does anyone know how can i cause right click on mouse button. on a certain row within a matrix to show a context menu with the option to delete the row. and when pressing the menu item handling the event of deleting the row from the matrix?
    appreciate the help
    Yoav

    Hi Yoav,
    Simply, 'context menu' have to be handled with 'menu event' object.
    It can be done by 'flushToDataSource' method and some tricks.
    Basically, method delete the row without any clause of addon code.
    But it's only can be done in display side.
    If you're using DBDataSource, you have to flush to the datasource.
    I mean, you have to update datasource with the data displayed in the matrix.
    and then, delete the last row of the datasource.
    FlushToDataSource doesn't affect to the number of rows in the datasource.
    You have to delete a row with a method of DBDatasource.. I can't remember the name.
    If, the matrix uses userdatasource, you don't need to delete a row in datasource.
    Because userdatasource doesn't have a concept of 'row', actually.
    Hope this helpful for you.
    Regards,
    Hyunil Choi

  • Deleting a row from JTable

    I am trying to delete a row from a JTable whenever the button on the last column is pressed. I know to do this, I can use the removeRow(int) method of the tableModel. But the odd thing is when I try to get a handle to the TableModel from the JTable to use that function, i.e. table.getModel().removeRow(int) it doesn't work. But if I explicitly pass in the tableModel into my class it does work. Here's the code below:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.UIManager;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableCellEditor;
    import javax.swing.AbstractCellEditor;
    import javax.swing.table.DefaultTableModel;
    public class tester4 extends JFrame
         protected final int BUTTON_COL = 2;
         private TableCellRenderer defaultRenderer;
         private TableCellEditor defaultEditor;
         private JTable workingTable;
         private String[] transactionCols = {"Qty", "Product", "Cancel"};
         private Object[][] data = {{5, "prod1", "Cancel"},
                   {6, "prod2", "Cancel"},
                   {7, "prod3", "Cancel"}};
        public tester4()
              workingTable = new JTable(tableModel);
              workingTable.setName("Working Table");
              defaultRenderer = workingTable.getDefaultRenderer(JButton.class);
              defaultEditor = workingTable.getDefaultEditor(Object.class);
              StatusTableRenderer testRenderer = new StatusTableRenderer(defaultRenderer, defaultEditor, workingTable, tableModel);
              workingTable.setDefaultRenderer(Object.class, testRenderer);
              workingTable.setDefaultEditor(Object.class, testRenderer);
            JScrollPane scrollPane = new JScrollPane( workingTable );
            getContentPane().add( scrollPane );
         private DefaultTableModel tableModel = new DefaultTableModel(data, transactionCols){
              // Only allow button column to be editable, if there is an actual
              // button in that row          
              public boolean isCellEditable(int row, int col){
                   return (col == BUTTON_COL && data[row][col] != "") ? true : false;
              // Overriden getColumnClass method that will return the object
              // class type of the first instance of the data type otherwise
              // returns the Object.class
              public Class getColumnClass(int column){
                for (int row = 0; row < getRowCount(); row++){
                    Object o = getValueAt(row, column);
                    if (o != null){ return o.getClass(); }
                return Object.class;
        public static void main(String[] args)
            tester4 frame = new tester4();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setVisible(true);
        public class StatusTableRenderer extends AbstractCellEditor
                                                implements TableCellRenderer,
                                                               TableCellEditor,
                                                               ActionListener{
             private TableCellRenderer defaultRenderer;
             private TableCellEditor defaultEditor;
             private JButton cancelButton;
             private JButton editButton;
             private String text;
             private int buttonColumn;
             private int selectedRow;
             private JTable table;
             private DefaultTableModel tableModel;
             public StatusTableRenderer(TableCellRenderer renderer,
                                           TableCellEditor editor,
                                           JTable table,
                                           DefaultTableModel tableModel){
                  defaultRenderer = renderer;
                  defaultEditor = editor;
                  this.table = table;
                  this.tableModel = tableModel;
                  buttonColumn = table.getColumnCount() - 1;
                cancelButton = new JButton();
                editButton = new JButton();
                editButton.setFocusPainted(true);
                editButton.addActionListener(this);
             public StatusTableRenderer(TableCellRenderer renderer,
                                                TableCellEditor editor,
                                                JTable table,
                                                DefaultTableModel tableModel,
                                                int _buttonColumn){
                  this(renderer, editor, table, tableModel);
                  buttonColumn = _buttonColumn;
             public Component getTableCellRendererComponent(JTable table, Object value,
                       boolean isSelected, boolean hasFocus, int row, int column) {
                  if (column == buttonColumn){
                       if (hasFocus){
                            cancelButton.setForeground(table.getForeground());
                            cancelButton.setBackground(UIManager.getColor("Button.background"));
                       else if (isSelected){
                            cancelButton.setForeground(table.getSelectionForeground());
                            cancelButton.setBackground(table.getSelectionBackground());
                       else{
                            cancelButton.setForeground(table.getForeground());
                            cancelButton.setBackground(UIManager.getColor("Button.background"));
                       cancelButton.setText( (value == null) ? "" : value.toString() );
                       return cancelButton;
                return defaultRenderer.getTableCellRendererComponent(
                            table, value, isSelected, hasFocus, row, column);
             public Component getTableCellEditorComponent(JTable table, Object value,
                       boolean isSelected, int row, int column){
                  if (column == buttonColumn){
                       text = ((value == null) ? "": value.toString());
                       editButton.setText(text);
                       selectedRow = row;
                       return editButton;
                  return defaultEditor.getTableCellEditorComponent(
                            table, value, isSelected, row, column);
            public Object getCellEditorValue()
                return text;
            public void actionPerformed(ActionEvent e)
                fireEditingStopped();
                // This works
                tableModel.removeRow(selectedRow);
               // This does not work
              //  table.getModel().removeRow(selectedRow);
    }Take a look at the actionPerfformed method. One way of doing it works, one doesn't. Just trying to understand why me getting a handle to the tableModel through the table doesn't work.
    Message was edited by:
    deadseasquirrels

    It gives me a run-time error Well then your question should be "why do I get this run-time error" and then you would quote the error. Be more descriptive. "It doesn't work" is not descriptive.
    table.getModel().removeRow(selectedRow);I don't use JDK1.5 either. But if you are saying that the above line compiles cleanly with JDK1.5 (because of the auto-boxing feature, or whatever its called), then I see no reason why the code wouldn't work since it recognizes the class as a DefaultTableModel.
    Presumably you commented out the other line so you don't try to delete the row twice. Otherwise you might be getting a indexing error.

  • Deleting a row from a database...

    Here is the method I am calling to delete a row from a database. I keep getting this error, but I am not sure why.
    Error: "Too few parameters. Expected 1."
    //To delete a row
      public void removeRow(String x, String y) {
       try {
       Statement stmt = con.createStatement();
       //delete row with same x and y
    //first is a string and second is a number
       String query = "DELETE * FROM table WHERE first = '" +x+ "' AND " +
       "second = " +Integer.parseInt(y);
       int result = stmt.executeUpdate(query); //runs delete query, ERROR HERE *************
       System.out.println("Test"); //debug statement, never gets here
       //deletion confirmation message
       JOptionPane.showMessageDialog(null, "Row deleted",
       "Delete Reservation", JOptionPane.INFORMATION_MESSAGE);
          catch (Exception e) { System.out.println(e); }

    Additionally, in the future you might want to use:
    catch(SQLException sqlx) {
      System.out.println( sqlx.getSQLState()
                                       +"\t"+sqlx.getMessage()
                                       +"\t"+sqlx.getErrorCode() );... It'll help with diagnostics.
    &#9786;Bill

Maybe you are looking for

  • Create Disc - Burn a Blu-Ray (or any disc) without re-encoding possible?

    In short, I burned my first Blu-Ray recently using the compressor template job action. I noticed it used an app called Create Disc, but I also noticed that I have to re-encode my file every time I want to burn a new disc (after quitting compressor).

  • Data not getting transffered from SRM system to BW

    Hi All, We have an issue where in the data is not getting transferred from SRM to BW. If i see in RSA 3 of SRM system, the datasource is pulling around 3000 records and in WE02, the idoc is generated and passed without any errors. Whereas in BW the i

  • Detection d'un port USB pour une communication série

    Bonjour à tous, J'ai développer une application qui recepionne des données texte d'une communication série 422. Cette communication est configuré par l'utilisateur de l'application qui choisit le prot série sur lequel les données sont receptionnée et

  • Additinal tab B in sales Order header not displayed after EHP5 upgrade

    Hello Everyone,                           I am facing an issue that the 'Additional data B' in the sales order header is not getting displayed after we ugraded to EHP5.       We found the issue , that the screen '8309' provided by SAP for the additio

  • Flash Player 9 just stopped working and won't reinstall

    I am running Firefox on a MacBook (Intel Core 2 Duo, OS X v. 10.4.9). One minute, my Flash Player was working just fine and the next minute I start getting messages that I need to install the plug-in. I have repeatedly tried installing, uninstalling,