About Navigation Bar Usage
When you create a default master-detail form using JClient, it will create and place a navigation bar on both the master and the detail panel, which permits users to scroll through the data in each panel independently. As an alternative, you can create a single navigation bar which responds to the panel which has current focus.
In JClient UI you you need to move the code for the navigation bar from the individual panels to the layout panel where the navigation event will affect all the child panels. For example, you can move the code from the department and employees data panel to the layout panel.
The code which needs to be removed will be similar to the following:
// The declaration of the navigation bar
private
JUNavigationBar navBar = new JUNavigationBar();
// The code which
binds the navigation bar to the individual panel.
navBar.setModel(JUNavigationBar.getModelInstance(getPanelBinding(),
"DepartmentsView", null, "DepartmentsViewIter"));
//Add the navigation bar to the panel
add(navBar,
BorderLayout.NORTH);
Once you have removed this code you now need to add the control binding to the layout panel which contains both the master and the detail panels.
//The declaration of the navigation bar
private JUNavigationBar
navBar = new JUNavigationBar();
//Bind the model for the navigation bar to the panel
navBar.setModel(JUNavigationBar.getModelInstance(getPanelBinding(),navBar));
//Add the navigation bar to the panel
add(navBar,
BorderLayout.SOUTH);
add(masterScroller, BorderLayout.NORTH);
add(detailViewPanel, BorderLayout.CENTER);
About Tree Navigation Usage
When you add a tree control to your panel you create node-populating rules using the property editor for the JClient node model. The property editor does not allow you to handle node selection. If you want to handle the node-selection event in order to populate controls in a panel, you can use JUTreeDefaultMouseListener to synchronize master and detail panels on the selected node. Here is a sample to show how to add the listener to the tree control:
myTreeControl.addMouseListener(new JUTreeDefaultMouseListener
( panelBindingVar, new String [][] {
{ "NodeType1" , "DepartmentViewIter" }, "NodeType2" , "EmployeeViewIter" } }
)
);
The listener takes an iterator for each node's bound view object (in this example, DepartmentViewIter for the DepartmentView view object and EmployeeViewIter for the EmployeeView view object). Controls that share the same iterator binding as the node, will automatically be populated when the user selects the node. For example, you might create a tree control in a master panel and the listener will set the iterator binding, which the detail panel will obtain and use to display attribute values in its data-bound controls.
Working with ADF JClient Node Control Bindings
Copyright © 1997, 2004, Oracle. All rights reserved.