Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:20:24 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

September 2006
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Aug   Oct

Get Firefox!

Sunday, September 03, 2006

I've added example #80 to my examples page illustrating a simple popup List of Values dialog for selecting a department for an employee using JSF and ADF Business Components. Examples like this are described in more detail in section 19.3.1 "How to Create Popup Dialogs" in the ADF Developer's Guide for Forms/4GL Developers.


8:43:34 AM    



A customer wrote in to ask:

In a JSF page, using an <af:table> component, the current row selection works independently of the table paging display. That is, if the user scrolls to see the "Next 5", for example, the current row remains unchanged. How can I cause the first row shown in the new current page of the table to be set to be the current row automatically?

The simplest way to achieve this involves three steps:

  1. Edit the view object providing data for the <af:table>, visit the Tuning panel, and set its "Fill last page of rows when paging through rowset?" property to false/unchecked.
  2. Set the RangeChangeListener property of the table using the (...) button in the Property Inspector. This allows you to create a new JSF backing bean for the page and name its range change listener method. For example, you can call the method "onRangeChanged". The RangeChangeListener property will get set to the EL-expression #{TestPage.onRangeChanged} that identifies this listener method in the backing bean.
  3. Code the backing bean onRangeChanged() method, which will fire whenever the user interacts with the table's navigation "Previous N" / "Next N" links, to set the iterator binding's range to start at the new starting index position, and then to set the first row (zero-based!) in the new range to be the current row. The backing bean method would look like this:
    • /* Backing Bean for page "TestPage.jspx" */
      public class TestPage {
        public void onRangeChanged(RangeChangeEvent rangeChangeEvent) {
          DCIteratorBinding empViewIter = (DCIteratorBinding)EL.get("#{bindings.EmpViewIterator}");
          empViewIter.setRangeStart(rangeChangeEvent.getNewStart());
          empViewIter.setCurrentRowIndexInRange(0);
        }
      }

I've added Example #79 to my examples page with a working version of this tip you can download and try.


7:04:27 AM    


If you select an application module in the Application Navigator, and use the Structure Window to select the name of one of its view object instances, view link instances, or application module instances, then you can see that instance's name property in the Property Inspector. If you update the value of that instance's name property using the Property Inspector, you can easily rename the data model instance without having to open the modal Application Module editor.

Not the easiest thing to discover yourself, but since it comes in handy for me from time to time, I figured I'd share the tip.


5:50:47 AM    


© Copyright 2008 Steve Muench.