Sunday 24 November 2013


Multi Delete in OAF


1. Create Item Under rowlayout Region Style SubmitButton Id&Prompt: MultiDelete
2. Create Transist Attribute in XXSearchVO Name:XXMDelete, Type:String
3. Rt Click on Table Region_MultipleSelection_InProperties
     View Instance: XXSearchVO
     View Attribute: XXMDelete(TransistAttribute)
4. Write Code SearchCO in ProcessFoamRequest
    if(pageContext.getParameter("MultiDelete")!=null)
{
OAViewObject vo=(OAViewObject)am.getXXSearchVO1();
for (XXSearchVORowImpl row=(XXSearchVORowImpl)vo.first();
row!=null;row=(XXSearchVORowImpl)vo.next())
{
if(row.getAttribute("XXMDelete")!=null && row.getAttribute("XXMDelete").equals("Y"))
{
String hid=row.getAttribute("HeaderId").toString();
String query="delete from XXCUSTOMER_REBATELINE where HEADER_ID="+hid;
try
{
PreparedStatement
ps=am.getOADBTransaction().getJdbcConnection().prepareStatement(query);
ps.executeUpdate();
}
catch (Exception e)
{
e.printStackTrace();
}
row.remove();
am.getOADBTransaction().commit();
} } }

No comments:

Post a Comment