How to delete multiple rows
hello
i want to delete selected multiple rows in sigle shot? can i have steps, very urgent?
Thanks
krish
Krish,
Normally the multiple selection delete will come from a table,
In that case call a AM method
and in a while/for loop traverse through the VO records and check the Checked Value(chexbox value to delete)
and if the value is Y , do row.Remove()
At the end commit,
Eg.
XXPODskOrdLnsVORowImpl lineRow = (XXPODskOrdLnsVORowImpl)lineVO.first();
while(lineRow !=null)
//check the checkbox value
if("Y".equals(lineRow.getSelected))
lineRow.remove();
XXPODskOrdLnsVORowImpl lineRow = (XXPODskOrdLnsVORowImpl)lineVO.next();
Hoe this helps.
Thanks,
With regards,
Kali.
OSSI.
Similar Messages
-
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 -
How to delete multiple row in classic report.
Dear Friends,
i am using 4.1 ve.
i have created classic report.i want to delete row .
How can i do it.
i need check box in classic report and if i select multiple check box then row should delete and before delete pop up should be pop up to confirmation to delete.
How can i do it.
ThanksHi Vedant,
here you have one advanced example:
http://www.talkapex.com/2009/01/apex-report-with-checkboxes-advanced.html
But you can do it easier using only apex_item.checkbox (creating one column in report query with this function).
After you submit this page the value will be stored to apex_application.g_f0X variable where X is equal to p_idx param of function apex_item.checkbox.
Note: only checked values will be stored.
Br,
Marko Goricki
http://apexbyg.blogspot.com -
How to delete multiple rows in a table of web dynpro for abap?
hi,
Experts ,
I want to delete the selected multiple records from a table from that i have inserted a check box ui element in a first column of a table what ever checkbox ix checked i want to delete those selected records from table .
please suggest me on
Thanks in advanceHi,
If you have DELETE button, in that action you write this code -
DATA lr_node type ref to if_wd_context_node.
lt_set = lr_node->get_elements( ).
loop at lt_set into ls_set.
ls_set->get_staitc_attributes
importing
static_attirbutes = ls_row.
if ls_row-check = 'X'.
lr_node->remove_element( ).
endif.
endloop.
Check the methods and thier types.
Regards,
Lekha. -
How do i delete multiple rows in JTable
hello
how i delete multiple rows in JTable
when i selected multiple rows from the jtable and delete its give the error ArrayIndexOutOfBoundException
e.g.
int rows[]=jtable.getSelectedRows();
for(int i=0;i<rows.length;i++)
DefaultTableModel model=(DefaultTableModel)jtable.getModel();
model.removeRow(rows);
like this
please help me
merajYou are trying to remove the rows an equal times to the amount of rows selected.
You should remove one row at a time:
model.removeRow(rows);
Change your code into this.
for(int i=0;i<rows.length;i++)
DefaultTableModel model=(DefaultTableModel)jtable.getModel();
model.removeRow(rows[i]); -
Deleting multiple rows in a report ?
db11gxe , apex 4.0 , firefox 24 ,
how to delete multiple rows in a report at one time ?
thanksHi newbi_egy,
Here is a small demo with few steps that can be used in your scenario-
1) Below is the query of a report on emp table which has empno column with unique values-
SELECT APEX_ITEM.CHECKBOX(1,empno) " ", ename, job FROM emp ORDER by 1
2) A Delete button is created that submits the page.
3) An on-submit process is created with Process point On Submit - After Computation and Validations with condition that the below process runs when Delete button clicked.
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
delete from emp where empno=APEX_APPLICATION.G_F01(i);
END LOOP;
END;
I hope this might help you.
Regards,
Das123 -
Best practice for deleting multiple rows from a table , using creator
Hi
Thank you for reading my post.
what is best practive for deleting multiple rows from a table using rowSet ?
for example how i can execute something like
delete from table1 where field1= ? and field2 =?
Thank youHi,
Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
Hope this helps.
Thanks,
RK. -
Updating and deleting multiple rows
Hi!
I have a form on a table with report page where I can filter data through columns.
1. Is it possible to create a button that will delete all the filtered data?
2. Also, I would like to be able to update any column of the filtered dataset to a certain value (that needs to be input somehow). Is that possible?
So far I can only update or delete one row at a time, which isn't useful as I sometimes need to change 100 rows at a time with the same value or delete them.
When I use tabular form, I can't filter rows, but I can delete multiple rows...
Also if there are similar examples, could you please send me a link; I can't seem to find any.
I'm using Apex 4.2.2.
Best Regards,
IvanDeleting multiple rows - [url https://forums.oracle.com/forums/thread.jspa?threadID=2159983]common question
Best answered with Martin's example
http://www.talkapex.com/2009/01/apex-report-with-checkboxes-advanced.html
Depends how you filter your data. You could identify all your limiting variables, and reverse the where clause in a delete process.
As for point 2, you can define a button that redirects to the page, and you can defined all the item values you like using the Action link.
There is likely an example in the supplied package applications.
Scott -
Deleting Multiple Rows From Multiple Tables As an APEX Process
Hi There,
I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
BEGIN
UPDATE tblDebitNotes d
SET d.Paid = 0
WHERE 1=1
AND d.DebitNoteID = :P7_DEBITNOTEID;
INSERT INTO tblDeletedPayments
( PaymentID,
DebitNoteID,
Amount,
Date_A,
SupplierRef,
Description
VALUES
( :P7_PAYMENTID,
:P7_DEBITNOTEID,
:P7_PAID,
SYSDATE,
:P7_SUPPLIERREF,
:P7_DESCRIPTION
DELETE FROM tblPayments
WHERE 1=1
AND PaymentID = :P7_PAYMENTID;
END;
The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
However this process is not doing anything!! Any insights greatly appreciated.
Many thanks,
Gary....the "button" is using a page level Target,...
I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
Scott -
Delete multiple rows in a JTable ADF Swing.
hi guys,
Would anyone know tell me how do I delete multiple rows in a JTable ADF Swing?
JDeveloper.Hi,
I would configure the table for multi row selection. Then get the selected row index, access the iterator in the PageDef file (through the panelBinding reference you have in ADF Swing) and then iterate over the selected row indexes, make an index to become the current row and call remove() on it
Frank -
Adding and Deleting Multiple Rows or Columns
How do you add or delete more than one row or column at a time.
Robby! wrote:
That's a great finding!
I just wrote a feedback requesting a shortcut like this.
It is a pity though that they desing it to work only if you select the header of the row/column. It should be enabled to work from within any cell in the table.
Who wrote such an error ?
These interesting shortcuts behave flawlessly even if the cursor was in D18 for instance.
(a) I never saw them in the delivered resources.
(b) they aren't responding to the OP's question which was about "Adding and Deleting Multiple Rows and Columns"
Yvan KOENIG (from FRANCE vendredi 3 octobre 2008 18:39:01) -
Delete Multiple Rows of JTable by selecting JCheckboxes
Hi,
I want delete rows of JTable that i select through JCheckbox on clicking on JButton. The code that i am using is deleting one row at a time. I want to delete multiple rows at a time on clicking on Button.
This is the code i m using
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableTest extends JFrame implements ActionListener
JButton btnAdd;
BorderLayout layout;
DefaultTableModel model;
JTable table;JButton btexcluir;
public static void main(String[] args)
TableTest app = new TableTest();
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public TableTest()
super("Table Example");
btnAdd = new JButton("Add");
btnAdd.addActionListener(this);
model = new DefaultTableModel()
public Class getColumnClass(int col)
switch (col)
case 1 :
return Boolean.class;
default :
return Object.class;
table = new JTable(model);
table.setPreferredSize(new Dimension(250,200));
// Create a couple of columns
model.addColumn("Col1");
model.addColumn("Col2");
JCheckBox cbox = new JCheckBox();
// Append a row
JPanel painel = new JPanel();
model.addRow(new Object[] { "v1",new Boolean(false)});
model.addRow(new Object[] { "v3", new Boolean(false)});
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.createVerticalScrollBar();
btexcluir= new JButton("Excluir");
btexcluir.addActionListener(this);
painel.add(btexcluir);
painel.add(btnAdd);
getContentPane().add(scrollPane, BorderLayout.NORTH);
getContentPane().add(painel, BorderLayout.SOUTH);
setSize(600, 600);
setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnAdd)
model.addRow(new Object[] { "Karl", new Boolean(false)});
if (e.getSource()==btexcluir){
for (int i=0; i <=model.getRowCount(); i++){
if (model.getValueAt(i,1)==Boolean.FALSE)
JOptionPane.showMessageDialog(null, "No lines to remove!!");
else if(model.getValueAt(i,1)==Boolean.TRUE)
model.removeRow(i);
}Please reply me with code help.
Thanks
NitinHi,
Thanks for ur support. My that problem is solved now. One more problem now . Initially i want that delete button disabled. When i select any checkbox that button should get enabled. how can i do that ?
Thanks
Nitin -
How to get multiple rows from database table?
hello !
I need to get multiple rows from a OLEDB database table and display them on a table object.
I did "Wrap in subfrom" on the table, set subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
But I can get only one row on the table object.
I need your help.
ThanksHi,
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 -
How to select multiple row in ALV report
Hi friends,
1. How to select multiple row in ALV report
( How to set tab in ALV report and want to select multiple line.)
Thanking you.
SubashHi Sahoo,
If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
in layout structure you will find field SEL_MODE
pass :
LS_LAYOUT-SEL_MODE = 'A'.
In PAI.
CALL METHOD GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = T_ROWS
ET_ROW_NO = T_ROWID.
Hope these will solve your problem.
Regards,
Kumar M. -
How to update multiple rows in one query using php
i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page
Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
In such a situation, you need four database tables as follows:
students (student_id, student_name, etc.)
courses (course_id, course_name, etc.)
students_courses (student_id, course_id)
attendance (student_id, course_id, dater)
A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one.
Maybe you are looking for
-
Why is contact sync from iphone or ipad to local iMac address book gone?
An option for syncing contacts from iphone or ipad to iMac seems to be gone. From searching other posts on this topic, I see where contact sync is now "through iCloud" but is this the EXCLUSIVE choice for syncing contacts? In other words, there is
-
Cache Management in OBIEE 11g(11.1.1.5)
Hi All, I have got a Dashboard with a prompt Year. In the prompt I have got 3 years (2010, 2011, 2012). Users will select one of the years from prompt. I have created an Agent to execute this dashboard before the business hours selecting "All Column
-
Hi there, I'm having trouble connecting a Kodak 3.2 printer to my Mac (Lion OS 10.7.4) - I've tried it on Wifi but no success and the same with usb. The mac is saying Printer not responding. I've followed troubleshoot on the kodak support site and al
-
Couldn't I use Chinese language in properties stream ?
Hi , everyone ! Couldn't I use Chinese language in properties ? I use properties manage program attributes , but the value which I type in Chinese language can not load correctly ! Why ?
-
Hello All, I want to make the header of the Tables in BOLD. So I was hoping that I can make use of web dynpro themes. Is it possible to make the table header bold using web dynpro themes? If it is the case ten will this web dynpro theme affect all th