One of the feature which existed in JDeveloper 10g but not found in JDeveloper 11g is using checkbox for selecting multiple rows from af:table.
This is my workaround for achieving this feature in JDeveloper 11g. Follow this steps:
1- Make a new ADF fusion web Application.
2- choose your database connection. (assume we are using HR Schema)
3- Make one viewObject based on entity (assume Employees viewObject based on Employees Entity)
4- Open your Employees ViewObject and make a new transient attribute with type boolean and make it always updatable (assume the transient Attribute name is 'TransientAttr').
5- Make a new page and drag your employee view as a table and don't check on Row Selection checkbox.
6- In your Structure Palette goto your inputText Transient attribute and right click and choose Convert to.
7- From opening dialog choose Select Boolean Checkbox ---> Ok ----> Ok.

8- Make the selectBooleanCheckbox component AutoSubmit with true and put its Id in the table partialTrigger and clear its lable and text.
This is my workaround for achieving this feature in JDeveloper 11g. Follow this steps:
1- Make a new ADF fusion web Application.
2- choose your database connection. (assume we are using HR Schema)
3- Make one viewObject based on entity (assume Employees viewObject based on Employees Entity)
7- From opening dialog choose Select Boolean Checkbox ---> Ok ----> Ok.
8- Make the selectBooleanCheckbox component AutoSubmit with true and put its Id in the table partialTrigger and clear its lable and text.
this #{(row.TransientAttr)?"background-color: #ffaaaa":""};
where #ffaaaaa is the color of the selected row (you can change this color as you want).
10-Now any row has its transient Attribute with true value, this row will be selected row.
where #ffaaaaa is the color of the selected row (you can change this color as you want).
Great post, and very nice simple Idea
ReplyDeleteHello Sameh,
ReplyDeleteGreat post and very nice simple idea
regards
Karim
Good idea, but how do you identify which row has been selected in code?
ReplyDeleteHi Samson,
ReplyDeleteas I said in point 10 "any row has its transient Attribute with true value, this row will be selected row", so you can loop in the iterator and check the value of the transient attribute:
BindingContainer bindings = getBindings();
DCIteratorBinding dciter =(DCIteratorBinding) bindings.get("YourView1Iterator");
for (int i=0 ;i<dciter.getViewObject().getEstimatedRowCount ;i++ ) {
Row r=dciter.getRowAtRangeIndex(i);
r.getAttribute("TransientAttr");// if it is true then this is a selected row
}
Hi, Sameh please provide your email... thanks
ReplyDeletemasood_pk_lhr@yahoo.com
samehnassar39@gmail.com
ReplyDeleteHi,Sameh Thank you very much for sharing real world experience.very useful for me.
ReplyDeleteRegards
KT
Hi Sameh,
ReplyDeleteThank you for this post.
Please take into consideration to improve this solution by preventing the transaction state to be set to modified status.
This happens even when the user doesn't make any selection, f.e. when the user navigates to another page (see oracle.adf.model.binding.DCDataControl.setTransactionModified()).
Regards,
Virgil
Thanks Virgil
Deletebut,
There is no modification here I just read the selected rows I don't modify anything. It is just transient attribute.