Monday, September 11, 2006
Search functionallity (like in oracle forms)
From scratch works more or less like this. Drop your view object as ADF table on the form. Add the find and execute operations. Drop the same view object on your form but now as ADF search form. Place the fields form the search form in the corresponding columns. For each #{row} field ,and the find button, set the rendered property #{bindings.testUserIterator.findMode ==false}. For each inputfield, and the execute, set the rendered property #{bindings.testUserIterator.findMode ==true}.
Now it will work.
Monday, September 04, 2006
Select the current row by just clicking on it (and little coding)
- Give your "af:tableSelectOne" an id property for instance “select_id”.
- Give all the columns in your table an onClick property for instance: onclick="makeCurrent(this);"
- Ad javascript to your page with yhe following code:
- document.getElementById(tr.id.substring(0,tr.id.lastIndexOf(":")+1)+"select_id").checked=true;
Try out your page and you'll see it works. Every click on a column in your table will make the current row indead current.
What this code does is working around the ADF coding for your table columns; Adf will generate the following id for an item(inputtext1) residing in the second row in your table("tab_1") on your form ("form_1") ..............(notice: zero based index)
id="form_1:tab_1:1:inputText1"
where ":1:" stands for the current row. You cannot (or do not want to) refer to this directly because it is an automatically generated number. You do not have any control on it. By substringing the entry and then adding the "select_id" to it, you can make the current row current. Just add .checked="true"
Not much code but a lot of thinking..........