Sunday, October 7, 2012

OAF Multiple Selection on Table to delete / update rows

OAF Multiple Selection on Table

For Advanced Table
1)Create Transient Attribute On View Object on which Advanced Table/Classic Table is based.
   Name      SelToDel
   Type       String
   Updatable  Always



2)In structure Right Click on Advanced Table --> New --> Multiple Selection
Under default   multipleSelection1   update below .
View Attribute       SelToDel
Text                       Actions   (Optional)




3) Right Click multipleSelect1 --> New --> rowLayout
4) Right Click region1 --> New --> Item
Update below details
Id                       DelBtn
Item Style           submitButton
Prompt               Delete




You can add below piece of code in Controller(You need to Import your custom VORowImpl in CO)
 or Best Practice is to add method in AM and call AM method from Controller.

      if (pageContext.getParameter("DelBtn") != null)
        {
            System.out.println("Proceed Delete");
            OAViewObject vo = (OAViewObject)am.findViewObject("XxFileBlobsVO1");
            Row row[] = vo.getAllRowsInRange();
            for (int i=0;i<row.length;i++)
              {
              XxFileBlobsVORowImpl rowi = (XxFileBlobsVORowImpl)row[i];
                if (rowi.getSelToDel()!= null && rowi.getSelToDel().equals("Y"))
                {
                  oracle.jbo.domain.Number vFileId = (oracle.jbo.domain.Number)rowi.getFileId();
                  rowi.remove();   // Here you can call updates if reqd
                  System.out.println("Selected To Delete File Id "+vFileId);
                }
              }
             
            am.invokeMethod("apply");
       }



For more information



5 comments:

  1. Hai can we write Multiple update code in processFormRequest

    ReplyDelete
  2. Hi Vamshi,
    Yes. You can get handle of view object in process form request. Iterate and condi t ionally update rows.

    ReplyDelete
    Replies
    1. Hi
      How can we create lov's for Advance table? i had created manual search and
      normal table i had given parameters also but it was not updating

      which was already exit in d2k form in d2k they called blocks i am struck at block values are not there at table but they use those blocks for logic purpose how can we call those in OAF?

      Delete
    2. hi i am new to OAF

      can i Share my Form Code with you if are free it self.

      Delete
  3. ERPTREE is a leading oracle fuison HCM Training Institute. we offer this course through online we have great experience in succeeding students through online courses. we can calculate our performance through their honest comments in our sites in supporting our services. we have referral program so candidates can earn money through referral. you can share your live experience with other can generate you some money.


    Oracle Fusion HCM Online Training

    ReplyDelete