Saturday, January 31, 2015

Preselected CheckBox - SelectBooleanCheckBox in ADF Table

In this post, I will be extending the application from the post CheckBox in ADF Table and retrieve selected rows .

The use case is very common. When the table with checkbox (SelectBooleanCheckBox) in the rows is rendered, there should be preselected checkbox in the rows depending on some condition. To make it simple to understand in this post ,when the Departments Table is loaded on the page, the checkbox should be ticked for Departments IT and Marketing.


Lets get into the implementation.

For this use case, lets add a method in AMImpl class which has the logic to tick or pres elect the checkboxes for rows having department name as IT and Marketing. Below is the code in AMImpl class. Note that VOImpl and VORowImpl classes has been generated for DepartmentsVO.





This code iterates over the Department Rows and check for the condition. If the condition is met, it just sets the Transient Boolean SelectRow variable to true. This makes it checked.

Note the condition here is very simple. This can be any complex condition based on requirement where the checkbox in the row needs to be checked.

Now expose this method as client interface in AM. Thats all in Model .

In ViewControllerProject, Created a simple task flow with one view activity. This task flow has a default activity as method activity which is the method from our AMImpl class which has the logic to preselect the checkbox based on condition.




In the preselected page fragment, the DepartmentsVO is dragged to create a readonly table.

Created a simple test page and created a region out of the task flow.

Thats it, if we run the test page, below is how it looks.



Thanks !!









2 comments:

  1. In case you are interested in generating cash from your websites by popunder advertisments - you can try one of the highest paying networks: PopAds.

    ReplyDelete
  2. last month he share is herbal medicine in some medical hospital and now he is well recognize as one of the best in West Africa, you don’t have to be sad any more or share your tears any more on this virus when the cure have already be find in 2013 if you want to get in touch with him in private contact him on his email dr.chalaherbalhome@mail.com Or you can visit his website on https://
    drchalaherbalhome.godaddysites.com or https://mywa.link/dr.chalaherbalhome

    ReplyDelete