How to Delete Multiple Records using selectbox in jsf
Hi!
My Senario is I want to delete multiple records using checkbox. After selecting multiple records when i click the delete button the selected
rows shuld be deleted.if am doing like this but the edit ,delete for each row functionality is not working.
<h:selectBooleanCheckbox id ="bcb" value="#{item.empno}">
</h:selectBooleanCheckbox>
But other functionality is not wokring.
Can any one plz tell how to select the multiple records and how to send the id to the serverside.
I want code code for jsp and as well as backingBean how to accaess .
Any Reply shuld be apreciated
You may find this article useful as well: http://balusc.blogspot.com/2006/06/using-datatables.html
Check the chapter "Select multiple rows" for two generic ways to select multiple rows in a datatable.
Similar Messages
-
How to get multiple records using fn-bea:execute-sql()
Hi,
I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
Regards,
Nagaraju
Edited by: user10373980 on Sep 29, 2008 6:11 AMHi,
Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
For example:
fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
Id Name
01 XXX
02 YYY
03 ZZZ
I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
<student>
<Name>XXX</Name>
</student>
I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
Please suggest.
regards,
Venkat -
Deleting multiple records using ibatis framework
The code i am using is
String deleteArray[ ] = request.getParameterValues("sel");
String selected= " " ;
if(deleteArray ! = null){
for(int i = 0; i < deleteArray.length ; i++){
selected += deleteArray [ i ];
if( i < deleteArray.length - 1){
selected += "," ;
I am using sqlMapClient of ibatis for connecting to database
sqlMapClient.delete("deleteMultipleRecords",selected);
In my xml file i use
<delete id="deleteMultipleRecords" parameterClass="java.lang.String">
delete from ADDRESS where id in (#value#)
</delete>
When i execute the above code , the delete query is not executing.Can anyone help me out.I dont think so u can delete multiple recods with a sing line of querey.
Why dont u use a for loop in DAO file and call the query with a single value .... -
How to create multiple records using ADF
Currently working on my first ADF BC and UIX project, and I basically want to create multiple records after a user makes a choice on the screen. I would like to know at what layer should this functionality be implemented?
Would this be more at the Struts/Controller level, where I have a java class to perform the creation as part of a data action? I ask because, I am not sure if this is feasible at the ADF BC level (View objects and Entity Objects) via some sort of customization, and i am new to the different possibilies avail as part of the ADF framework
Regards
Anora
(Jdeveloper 10.1.2.1 build 1913, Oracle DB 10.1.2)I'd put it into the application module. You then can call the method from the controller layer or from an other application module. This way you put it into the business logic, which helps if you ever decide to use a different client approach (like swing).
-
How to update multiple records using for loop
Hi I want to update a particular column of few rows in database i had written followin code after that few lines of code and calling action from the task which having commit return ,still it's not updating particular colum.I had debug the code loop is running fine but still changes are not reflecting to database.Let me know if there is any prob with following code snippet.
RealEstatePropertyUnitDetailsVOImpl realEstatePropertyUnitDetailsVO = RealEstatePropertyUnitDetailsVOImpl)realEstateService.getRealEstatePropertyUnitDetailsVO();
for(Row row : realEstatePropertyUnitDetailsVO.getAllRowsInRange())
if("N".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn"))
|| "false".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn")))
row.setAttribute("RlstdAvlblYn", "Y" );
System.out.println("RlsthId "+row.getAttribute("RlstdRlsthId"));
System.out.println("AvlbYN "+row.getAttribute("RlstdAvlblYn"));
System.out.println("RlstdUnitId "+row.getAttribute("RlstdUnitId"));
}Vishwesh,
I'd start with something along the lines of ...
RowSet vo = (RowSet)getRealEstatePropertyUnitDetailsVO();
vo.reset();
while (vo.hasNext())
Row row = vo.next();
row.setAttribute("Attribute", value);
}getAllRowsInRange() may exclude some rows outside the "range". Also, the vo.reset is needed since your View Object currency may not be at the beginning of your RowSet.
Hope that helps.
Will -
Please Help! Deleting multiple record by using checkbox selected
Hello everybody,
I am a new to JSP. I really don't know how to delete multiple record by using checkbox selected and pressing submit button.
For example, deleting webmailbox letters using checkbox selected and delete button. The mail we checked will delete from the inbox.
I like to use my user account deleting system of my project like above example.
How can I do in JSP? I will very please you if you share you knowledge and code for me.
If you have URL address, could you share me for reference?
Please help me...
With Thanks and Regards,
wtdahlTake a look at this thread, I thing it answers your question quite good:
http://forum.java.sun.com/thread.jsp?thread=516658&forum=45&message=2463505 -
Delete multiple record in tabular with check box.
Hello guys,
I need your suggestion..
I have master detail block. (INSTRUCTOR and SECTION)
At detail block, I add check box item (name: RB_SECTION_ID) with Database Item "No", and value when check :SECTION_ID (on the property).
I make a button DELETE. The trigger was DELETE from SECTION where section_id = :SECTION.RB_SECTION_ID and
instructor_id = :INTRUCTOR.INSTRUCTOR_ID;
but It not work.
How we delete multiple record by check multiple check box then click DELETE button..??
Regard.
Nia..You datablock in the form cannot automaticaly refresh the changes you make with the SQL statements.
For that you need to explicity call certain built-ins to refresh the data
execute_query(no_validate) --> fetches the available data for that session. Here you deleted some records, so those records will not be available until you do a rollback in the same session(i.e, you exit the form without saving). But until you save, those deleted records will be avaiable for the users in other sessions)
Also, your code works only because the records you deleted are all already saved ones.
So it will be a good practice to use built-in of form builder rather than DML stmt.s
Here you can do like this
begin
go_block('TRY_TABLE');
first_record;
loop
if :TRY_TABLE.CCKBOX = 'Y' THEN
delete_record;
END IF;
NEXT_RECORD;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
END LOOP;
END;
If your code is like above one, you can revert your deletion by simply giving a F7 (enter-query) and F8 (xecute query). -
hi all,
Can any tell tell me how to delete multiple records in table control of a screen
i have checked the multiple rows in table control attributed and assigned a name.I needhelp in writing code.
Thankshi,
As you have marked multiple fields in the table control your table control is mulple selection enabled.
<b>PROCESS AFTER INPUT.</b>
loop at IT_CONF.
field X_CONF-CHECK
module TC_CONF_mark on request.
endloop.
module TC_CONF_user_command.
MODULE USER_COMMAND_0102.
*this modifies the internal table with check field as X
module tc_conf_mark input.
data: g_tc_conf_wa2 like line of it_conf.
if tc_conf-line_sel_mode = 1.
clear g_tc_conf_wa2.
loop at it_conf into g_tc_conf_wa2
where check = 'X'.
g_tc_conf_wa2-check = ''.
modify it_conf
from g_tc_conf_wa2
transporting check.
endloop.
endif.
modify it_conf
from x_conf
index tc_conf-current_line
transporting check.
endmodule.
module tc_conf_user_command input.
* write code to handle table control scrolling /pageup/pagedown
endmodule
*Check the ok_code
module user_command_0102 input.
case ok_code.
when 'DEL'.
* Delete from internal table where check = X
endcase.
endmodule.
<b>PROCESS BEFORE OUTPUT.</b>
module TC_CONF_change_tc_attr.
loop at IT_CONF
into X_CONF
with control TC_CONF
cursor TC_CONF-current_line.
module TC_CONF_get_lines.
endloop.
module tc_conf_change_tc_attr output.
describe table it_conf lines tc_conf-lines.
endmodule.
module tc_conf_get_lines output.
g_tc_conf_lines = sy-loopc.
endmodule.
Thus you will delete the marked lines from the internal table in PAI and in PBO you can read the refreshed internal table without the table entries that are marked as deleted in the table control and display the same in the table control. This is another way.
Regards,
Richa -
Delete Multiple Records from Item Master
Hi,
We received wrong master data which has been uploaded and two groups have to be deleted. All the items in those particular groups have also to be deleted. Can anyone suggest how to delete multiple records from Item Master?
Currently I am navigating through each Item and doing a Right Click + Remove. It is very painful given the huge number of records.
Regards
SudattHi Sudatt.....
I recommend you not to run any kind of delete or update SQL query as it harms DB.
You can create your own front end application with the help of any technical consultant which can be
achieved very easily. Else such problems create a big problem during upgradation to next version.......
Regards,
Rahul -
How to pass multiple records to target side using xquery
Hi Everybody,
I am using xquery transformation.
Input: Source payload contains 5 variables.
Target payload contains 5 variables.
I have input with payload with multiple instance like:
<Input>
<payload1>
<a>1<a>
<b>2<b>
<c>3<c>
<d>4<d>
<e>5<e>
</payload1>
<payload1>
<a>6<a>
<b>7<b>
<c>8<c>
<d>9<d>
<e>10<e>
</payload1>
</Input>
So my requirement is to pass above records into target side,
So I am using xquery Transformation.
I have written code as follows.
(:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
(:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
declare namespace ns0 = "http://diversey.com/THRecAdv";
declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
as element(ns1:ShipmentReceiptEBO) {
for $THRecAdvFields in $tHRecAdv1/ns0:THRecAdvFields
return
<ns1:ShipmentReceiptEBO>
<ns4:Identification>
<ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
<ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
<ns4:ApplicationObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:Revision>
<ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
</ns4:Revision>
</ns4:Identification>
<ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
<ns4:InvoiceReference>
<ns4:InvoiceIdentification>
<ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
</ns4:InvoiceIdentification>
</ns4:InvoiceReference>
<ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
<ns4:Identification>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
<ns4:ApplicationObjectKey>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:AlternateObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
</ns4:AlternateObjectKey>
<ns4:Revision>
<ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
</ns4:Revision>
</ns4:Identification>
<ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
<ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
<ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
<ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
<ns4:Status>
<ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
<ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
</ns4:Status>
<ns1:ShipmentReceiptTransaction>
<ns1:ShipmentReceiptTransactionLot>
<ns1:ShipmentReceiptItemLotReference>
<ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
<ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
</ns1:ShipmentReceiptItemLotReference>
</ns1:ShipmentReceiptTransactionLot>
</ns1:ShipmentReceiptTransaction>
</ns1:ShipmentReceiptLine>
</ns1:ShipmentReceiptEBO>
declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
But while importing this code to OSB,and tested it ,
With 1 payload it successfully shows the data in Target side,
But while testing with multiple line items,i am getting an error as follows.
*Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
So please provide me the steps how to pass multiple records to target side using xquery.
Regards,
Jyoti NayakHi Jyoti Nayak,
You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
declare function xf:setToList($set1 as element(ns0:set))
as element(ns0:list) {
<ns0:list>
for $pair in $set1/ns0:pair
return
<ns0:entry>
<ns0:key>{ data($pair/ns0:key) }</ns0:key>
<ns0:value>{ data($pair/ns0:value) }</ns0:value>
</ns0:entry>
</ns0:list>
Cheers,
Vlad
Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points -
How to poll child records using Physical delete
Hi, could anyone please help me how to poll child records using the Physical delete polling strategy?I have one parent table and one child table with foreign key constraint with 'on delete cascade'. I understand that physical delete polling strategy does not poll child records and can be polled by configuring the toplink_mappings.xml. how to confure this file in order to poll the child records.
sample tables are:
student(stud_id,name,gender,age), stud_id beeing the primary key and
stud_marks(stud_id,exam,marks1,marks2,marks3), exam beeing the pk, and stud_id, the foreign key with on delete cascade.
I have set the property DeleteDetailRows="true" in the wsdl.
Getting a warning:
'TopLink found problems in PhyDelChildRecordsPoll. Please ensure that these are corrected before deployment.'
TopLink Map 'PhyDelChildRecordsPoll' -> One of the packages is incomplete.
Package PhyDelChildRecordsPoll -> One of the descriptors in this package is incomplete.
Descriptor Student -> Some mappings are incomplete.
Mapping studMarksCollection -> Method accessors have not been selected.
End TopLink Map 'PhyDelChildRecordsPoll'
Thanks.
Edited by: Help please on Nov 5, 2009 2:39 PMSimple solution is to run the query I have given for all child tables or to try a single query for all child tables withj something like:
select <parent_key>
from <parent_table>
where <parent_key> in
(select <foreign_key_1> from <child_table_1> union
select <foreign_key_2> from <child_table_2> union
... );More complicate solution could be to change the foreign key constraints to cascade DELETE on parent table to child tables:
SQL>
SQL> create table p(x int primary key);
Table created.
SQL> create table c1(x1 int);
Table created.
SQL> create table c2(x2 int);
Table created.
SQL>
SQL> alter table c1 add constraint fk1 foreign key(x1) references p;
Table altered.
SQL> alter table c2 add constraint fk2 foreign key (x2) references p;
Table altered.
SQL>
SQL>
SQL> insert into p values(1);
1 row created.
SQL> insert into c1 values(1);
1 row created.
SQL> insert into c2 values(1);
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL> alter table c1 drop constraint fk1;
Table altered.
SQL> alter table c2 drop constraint fk2;
Table altered.
SQL>
SQL> alter table c1 add constraint fk1 foreign key(x1) references p on delete cascade;
Table altered.
SQL> alter table c2 add constraint fk2 foreign key (x2) references p on delete cascade;
Table altered.
SQL>
SQL> delete p where x=1;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from p;
no rows selected
SQL> select * from c1;
no rows selected
SQL> select * from c2;
no rows selected
SQL>Edited by: P. Forstmann on 27 oct. 2011 14:01 -
How to delete multiple contacts in iphone
how to delete multiple contacts in iphone
To Erase iPhone Contacts, SMS and Photo Permanently,you must to use a iPhone data eraser software.
This use guide about how to deleted iPhone contacts,it can help you erase all contacts from iPhone permanently.
How to Delete iPhone Contacts Permanently
http://www.z0download.com/useg... -
Regarding how to delete the record in internal table
Hi experts ,
how to delete the record in intarnal table after validating the data,
if record contains invalid fields?
i am giving my code see this and give me the answer?
loop at it_data into wa_data .
Validate Cost Center
READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-004.
ENDIF.
Validate source file material ( material number )
loop at it_mara into wa_mara .
read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
if sy-subrc NE 0 .
PERFORM update_error_log USING wa_data
text-002.
delete it_data-objek .
else.
read table it_mara into wa_mara with key matnr = wa_ausp-objek .
if sy-subrc EQ 0 .
wa_data-objek = wa_mara-matnr.
wa_data-matkl = wa_mara-matkl.
ENDIF.
Modify it_data from wa_data .
endif.
*endloop.
Validate unit of measure (unit)
READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-003.
endif.
Validate delivery location ( storage location )
READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-001.
if wa_data-flag ='x' .
delete it_data from wa_data .
endif.
ENDIF.
endloop.Hi Naren,
First get the index number of the IT_data table and store it in one variable whose declaration like this.
data: tabix type sy-tabix.
while reading the internal table it_data set the tabix variable.
tabix = sy-tabix.
Instead of the above use below one.
Delete it_data-objek
Use the Below statement it will delete the row from the internal table.
Delete it_data-objek index tabix
Thanks,
Chidanand -
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 photos at once
Hello 2075,
Thanks for using Apple Support Communities.
To delete multiple photos at once on your iPad, all you need to do is tap on Select while in the Photos app, select the photos you'd like to delete, and then tap on the trash can.
Organize photos and videos - iPad User Guide
Take care,
Alex H.
Maybe you are looking for
-
Make a spry collapsible panel open on hover??
Hi All, I'm trying to play with the Spry Collapsible Panel and would like to have it open on hover but not on the on click, I've attached the standard js code Dreamweaver produces, and would be very grateful if you could highlight what needs to be ch
-
Hi guys. Today after streaming a video on a website (I was watching an episode of GoT), I ran a virus scan with Avira and my mac froze. This has happened 3-4 times tonight alone (although it's the first time I've experienced this problem). Safari has
-
Importing VHS tapes w/ADVC-300 help
Please help, I'm converting a large number of VHS tapes to DVD using a ADVC-300 Analog to Digital Converter and a Sony VCR. Everything imports fine but everytime the signal hits a break in the tape (the old VHS snowstorm) iMovie stops importing. Sinc
-
Oracle Data Loader On Demand on EHA Pod
Oracle Data Loader doesn't work correctly. I downloaded it from Staging(EHA Pod). And I did the following work. 1.Move to "config" folder,and update "OracleDataLoaderOnDemand.config". hosturl=https://secure-ausomxeha.crmondemand.com 2.Move to "sample
-
Mobileme login problems when publishing
When trying to publish my site (both entire site or just the changes) i get a window telling me to log on to mobile me. Klicking <login> opens up the system menu and here it shows that _I already AM logged inn_ at my account. I have tried to repair a