How to delete several records by selecting the check box

Hi I am a newbie in oracle forms Builder. I want to delete multiple records at the same time, when I click on the button. I have a 'emp_block' and 'control_block '.

emp_block information: -.

I have all the columns displayed in this block as empno, ename, sal, hiredate, deptno, comm.

Other than that I add a new item of type "checkbox" and his name is "checkbox".

control_block information: -.

I have a "push button" in this control block.

I added trigger "when-button-pressed" and write this line of code: -.

EXECUTE_TRIGGER("ON-DELETE");

COMMIT;

"DELETE" is a trigger of form level. In this trigger, I wrote this code: -.

BEGIN

DELETE FROM EMP WHERE EMPNO =: EMP_BLOCK. CHECKBOX;

END;

Problem: -.

Not one selected record is deleted when I click on the button Delete.

I want to check little matter how much and when I press on delete button it has deleted all records whose box has been checked.

Please help me...

Welcome to the forum.

In your WHEN-BUTTON-PRESS-trigger, just put your entire code and remove this EXECUTE_TRIGGER thing.

To remove all verified records within a block, you must loop through the block and delete each record, something like

BEGIN
  GO_BLOCK('YOUR_DATA_BLOCK');
  FIRST_RECORD;
  LOOP
    EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
    IF :YOUR_DATA_BLOCK.CHECKBOX='Y' THEN
      DELETE_RECORD;
    ELSE
      EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
      NEXT_RECORD;
    END IF;
  END LOOP;
END;

Make sure that you set the property "value when checked" section of box check "Y".

Tags: Oracle Development

Similar Questions

  • Select the check box for the table of the ADF

    Hi all

    I want to add the check box in front of each line. The user will select the row by clicking the box and going to treatment by clicking on a button.

    I just almost all possible discussions on OTN.

    What I've done so now
    1] added a transitional Boolean attribute in my VO. added as a selectBooleanCheckbox in .jspx page.
    [2] a button with backing bean that will do the processing. [He will pick up the attributes of all ranks and be written in a file]
    [* 3] it works fine if I use the default option of line by Ctel selection + A, or by pressing Ctrl + click or SHIFT + arrow key. Backing bean is not the issue.*
    [4] try to intercept the TableSelection Listner also.

    It comes

    When I select the check box, only the last selected line is processed and not all lines. How to make the selectable online by clicking on the checkbox.

    I use JDeveloper 11.1.1.5

    Refered links
    http://www.gebs.ro/blog/Oracle/Oracle-ADF-row-selection-using-checkboxes/
    http://technology.AMIS.nl/2010/07/29/ADF-11g-select-all-rows-in-an-ADF-table/
    http://Sameh-Nassar.blogspot.nl/2009/12/use-checkbox-for-selecting-multiple.html
    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/99-checkbox-for-delete-in-table-1539659.PDF

    Mukesh.
    https://www.dropbox.com/s/1gqsaobgyjycie6/AddDeleteEmployees.rar
    
  • Need me several attempts to select a check box in Windows Live Hotmail.

    Need me several attempts to select a check box in hotmail.
    When I delete a mail, it also deletes one or more under it.

    What browser do you use?  It happens only on one computer or several?

  • By selecting certain records by using the check box

    Hello

    I have a similar problem mentioned in this thread Re: select specific records using the checkbox I got if I have only one primary key value in the work table. I don't know how to handle it when I have several primary keys of the table I want to use for filtering?

    Thank you.

    Hello

    You can use rowid
    First report

    SELECT APEX_ITEM.CHECKBOX(1,e.rowid) chk,
    e.*
    FROM emp e
    

    Use even submit after processes.
    And target page report

    SELECT e.*
    FROM emp e
    WHERE EXISTS(
    SELECT 1
    FROM apex_collections c
    WHERE c.collection_name = 'P46COL'
    AND c.c001 = e.rowid)
    

    Kind regards
    Jari

    Published by: jarola on October 14, 2010 10:50

  • Select all the check box in the grid

    Hello

    Creating dynamic multiple checkbox which are placed in a table format in the grid.

    (a) how to select the check box and clicking a button

    (b) how to find how many check box are selected at the click of a button

    Thanks in advance

    Hi Srinth,

    Have you tested the code... He works for you...?

    His perfectly straight work on my side...

    Thank you

    Jean Claude Chari

  • Reposition the cursor when the check box is selected

    Good day all.

    I'm trying to figure out how I can reposition the cursor in a text field once I've selected a checkbox.

    Example; I have 3 boxes can select use. When the user selects the check box, I want to cursor to move to this box.

    Does anyone know how this could be done?

    Using Adobe LifeCycle Designer 8.0

    Windows XP Pro

    Thank you all

    Chomp

    No Chomp problem, I updated the form that you posted to set focus in the first textfield in the hidden subform (criterion 1). I published the form here:

    https://Acrobat.com/#d=46bhrRPpzUOEN4XI7--W-w

    Notice how the full path should be clearly explained when fields bound, in this case, a check box and a text field, are in different subforms.

    If you never do know what the full path to a field, click a different field, click in the script Manager window, then ctrl + click the field you want the path. If you have this selected field ctrl + click 'this' will return just as he will himself reference in the script manager.

  • Clear the check box according to the value of column DB

    Hello
    My requirement is to disable the check box according to the value of a column DB. Say for example my report displays the following. Check box, the name of the EMP, Dept. If the Department is the checkbox should be disabled and user should not be able to select the check box.
    Ask your help for a solution.
    Thank you
    Prasanth

    You must use the parameter p_attributes of the apex_item.checkbox API to make the boxes off (readonly do not work with the checkboxes)

    SELECT ..
    CASE WHEN  THEN APEX_ITEM.CHECKBOX(1,)
                         ELSE APEX_ITEM.CHECKBOX(1,,'disabled="disabled"')
              END 
      ..
    
  • To access the check boxes in the user interface programmatically

    Hi all
    I have the following usecase.
    1. I have a table that has 3 columns, first two columns are read only output of the label component and the third column is a checkbox.
    2. I have three lines in the table.

    Now:
    1. when a user selects the check box and click on a "submit" button I want to check that it should have selected at least one checkbox.
    2. for which I tried to access the table from the user interface programmatically, but it does not work.
    Is there a way I can access the values?

    Thanks in advance,

    Hello

    The box must be bound to an attribute line in the table is related to data collection. If yes then simply loop through the lines and check if the attribute has been set. For example, if each line has a "checked" property, so you can ensure at least a line "checked = true' in your action. To access the collection, you can use something like:

    Object initialRowKey = table.getRowKey();
    try
    {
        int count = table.getRowCount();
        for (int i = 0; i < count; i++)
        {
            table.setRowIndex(i);
            MyObject row = (MyObject)table.getRowData();
            if (row.isChecked())
            {
                // do something, set a flag to true, etc.
            }
        }
    }
    finally
    {
        table.setRowKey(initialRowKey);
    }
    

    The code above assume that you linked the table to your managed bean using the "required" attribute in the table.

    Kind regards

    ~ Simon

  • delete several doc both on the android Tablet

    Frustrating! It seems that the only way to delete documents is to open it so it appears in the list of recently accessed. Then you hold your finger on a single document may appear in the trash. Then you can delete it. There must be a better way, but I'm unable to find and most of the people answering in the Forum does not understand the questions. In other words, they answer the question to which they know the answer!

    Currently, the latest version of Adobe Acrobat DC does not remove documents in storage of local files in the application. You will need a third file (available on the Google game shop) Manager to do the same. However, you can delete several recent documents of the player application by long pressing a file name, then by selecting several files you want to delete.

    We regret the inconvenience caused to you and we are actively seeking to bring the functionality of removal of the documents directly from the local file listing as in earlier versions of Adobe Reader. You can see it in a future release.

  • How to find the previous mouse clicked the check box

    Hello

    In my form with detail and header boclk

    For example: in a canvas
    Header 
    -----------
    item1                    item2                    item3
    item4                    item5                    item6
    
    Detail
    ---------
    
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    item7                    item8                    item9     checkbox1
    My requirement is now knowledge/capture when the user clicks the check boxes.
    If he clicks on the 1st record or record of 5th or 3rd I wants to get these values and that it must handle
    further...

    Thank you.

    Hello

    When you click anywhere in a recording, it becomes the current record, and you can get/set values using domain names.
    When the user clicks a control checkbox, its trigger raises the when-box-change and you know its value (if it is selected or deselected).

    François

  • Conditionally Enable and Disable select any check box in the report position only?

    4.2.1

    THM: 2

    Hello

    I have a classic report with an apex_item.checkbox2 as the first column. I also had to add a "Select all" check box in the header. I did it by adding this to the column header

    < input type = "checkbox" onclick = "$f_CheckFirstColumn (this)" / > "

    However, there is a requirement where in I need to disable this "topic" check all (line remain) when a certain field is not filled.

    For example: P2_fLAG which is a page element is null, then select it title all the checkbox should be disabled.

    Is this possible?

    Thank you

    Ryan

    ryansun wrote:

    This bump. Wondering if anyone has done this before?

    A took a look yesterday. May have the time to finish today.

    In this page if F1 and F2 are null and the user has selected "Select all" and click on the button. A message to standard error or alert apex must be indicated, asking the user to fill something in the fields F1 or F2.

    I think that the idea first of activation and deactivation of select box everything is the best approach. Always better to prevent the user from doing something than to allow them to do it and then tell them they can't.

  • How to disable the check box (line selector) in a tabular report of APEX

    I have a report in tabular form with checkboxes which is filled by a SQL query.  For some lines, I want to disable (or not) the box according to the value of one of the columns of that particular line (if the value of a column defined as Date is less than sysdate, I don't want to display the checkbox for that rank).  I tried to use the conditional display in the section of the column attribute of the checkbox, but I can't access this Date column that is currently selected in a view in the SQL source.  I used variables such as: name-of_column, V(':name-of_column'), but always get a NULL value for this column in the SQL code I'm trying code in conditional display section.  For this reason, my condition does not work correctly.

    What I am doing wrong?  Exceeds my correct approach?

    Hi Ajay,

    I don't think you can handle this with a conditional display, as that works on the column rather than level level line.

    The way I see it, there are two things you can do:

    (1) approach to sql, where youo make the checkbox in your query using apex_item.checkbox, see the documentation of oracle for detailed information on the use of the APEX_ITEM

    You'll end up with a query like

    Select case when YOUR_DATE_COLUMN<>

    then null

    else apex_item.checkbox2 (p_idx-online 1

    p_value-online YOUR_DATE_COLUMN

    )

    ,

    from YOUR_TABLE

    (2) an approach JavaScript in which you create a dynamic action check your date column in a table and when the need hides and disables the check box for that rank.

    First option is more robust, but it will take a little more work. Second option is faster to develop, but may have different effects on various browsers and browser versions.

    Regads,

    Vincent

    http://vincentdeelen.blogspot.com

  • If choose something lower down then the check box is selected

    I want to choose from a list in the drop-down menu.  According to what is selected, then a box will be checked automatically.  This

    is what I have so far for the script.

    If (list == 'blah') then this.rawValue = 1

    I do not know if it to JavaScript or FormCalc... I guess JavaScript because there is no calculation.  I'm also not sure whether to put the script on the drop-down list or checkbox.  Also in which should case I use?

    Thank you

    Him == is used to compare two values. then you use it properly in the case. When yo want to assign a value to an object, then a unique sign = is used. So, your code should be CheckTwo.rawValue = 1.

    You can use an OR condition to check multiple values of th FEI statement. So if the box should be checked if they choose blah, blah2 or blah1 then you might do this:

    If ((this.rawValue == "blah") |) (this.rawValue == "blah1"). (this.rawValue is "blah2")) {

    CheckTwo.rawValue = 1;

    } else {}

    CheckTwo.rawValue = 0;

    }

    Make sure to uncheck the checkbox if none of these options are chosen. That way if they choose one of these options (the check box is selected), and then they change their mind and choose a different value it should be disabled.

    Make sense?

    Paul

  • By selecting the text box to change the text field

    I worked on a form to allow suppliers to fill their reports of endoscopy online.  I'm trying to do something very simple.  If a user selects a check box change the value in a text field.  Either we allow the code to run once.  It will change the value once - even if I think it's to set an incorrect value in the code - but that is neither here nor there at this point.

    Here's the code that should work in my opinion.

    Form1. EndoscopyPage1.TestChkBox::click - (JavaScript, client)

    If (this.rawValue == 1)

    {

    TestTxt1.rawValue = "ON"; the user cannot enter field

    }

    on the other

    {

    TestTxt1.rawvalue = "off"; the user can enter the field

    }

    I tried the following as well

    If (TestChkBox.value = 0) then

    TestTxt1.editValue = 'Off ';

    endif;

    If (TestChkBox.value = 1) then

    TestTxt1.editValue = "ON";

    endif;

    I have attached the file as well.  My trial fields are in the middle of the first page.

    It's just a typo. You typed rawvalue rather than rawValue "V" must be upper case.

    See the attahed to the snap.  It works for me after you change this property.

    Nith

  • How to filter datagrid flex with 3 three check boxes?

    Hi guys,.

    I'm new to flex.

    I need your help. Can someone help me please.

    My requirement:
    Flex Datagrid should be filter based on the 3 checkboxes. (The check boxes can be checked with several combinations).

    * My Code: *.

    * Boxes: *.

    < mx:CheckBox id = 'done' label = click "Done" = "" / >

    < mx:CheckBox id = 'onhold' label = click on "Pending" = "" / >

    < mx:CheckBox id = 'inprogress' label = click 'In progress' = "" / >

    * Data provider: *.

    < mx:ArrayCollection id = "arrColl" >
    < mx:source >
    < mx:Array >
    < mx:Object Status = "In progress" title = 'java' grade = 'A' / >
    < mx:Object Status = "Completed" title = 'c' grade 'B' = / >
    < mx:Object Status = 'Suspended' title = 'c++' grade 'C' = / >
    < mx:Object Status = 'pending' title = 'flex' rank = "D" / >
    < mx:Object Status = "Completed" title = "cobol" grade = 'E' / >
    < mx:Object Status = "In progress" title = "python" grade = 'F' / >
    < mx:Object Status = "Completed" title = "SAP" grade = 'G' / >
    < mx:Object Status = "In progress" title = 'Oracle' grade = 'H' / >
    < mx:Object Status = 'pending' title = 'Sybase' grade = 'I' / >
    < mx:Object Status = "In progress" title = "HTML" grade = 'J' / >
    < mx:Object Status = "In progress" title = "JSP" grade = 'K' / >
    < mx:Object Status = 'pending' title = "Servlets" grade = 'L' / >
    < / mx:Array >
    < / mx:source >
    < / mx:ArrayCollection >


    * MXML code: *.
    < mx:DataGrid dataProvider = "{arrColl}" id = "dg" / >

    Here I have to filter datagrid when I check various combinations of 3 boxes.
    The checkbox values come from Staus arraycollection collection column.
    When I select the checkbox 'complete' and 'onhold' box, datagrid should display only the records that have the status as 'Complete' and 'pending '.
    The same for all combinations of selection boxes.

    Can anyone give simple solution please?

    Thank you
    Anand.k

    I don't understand.

    I tried flex 3.5 and it worked. Code:

    
    
        
            
        
    
        
    
        
    
        
    
        
            
            
            
            
            
            
            
            
            
            
            
            
        
    
        
    
    

    Could you try to run this code on a new application and see if it works?

Maybe you are looking for