Consider the following scenario: on a single JSP page called contents.jsp, there are two ItemsGrid
components and a Path
component (a corresponding backing bean exists called Contents.java). The Path
component, named path
, and one of the ItemsGrid
components, named foldersGrid
, are both bound to the same EnterpriseItems
bean, named folders
. This EnterpriseItems
bean represents a folder hierarchy within the BusinessObjects Enterprise system that the user can navigate through using path
and foldersGrid
. Because the two components are both bound to the same EnterpriseItems
bean, they are automatically synchronized so that when the user navigates with one component, the other component reflects these changes.
However, the second ItemsGrid
component, named reportsList
, is bound to a second EnterpriseItems
bean called reports
, which represents a set of Crystal reports in any given folder. How can reportsList
be made to work with the other components on the page? The solution is to synchronize the components in the correct order.
To have the second ItemsGrid
component, reportsList
, work together with the other components in a meaningful way within the page, the components must be synchronized so that when the user navigates to a certain folder level within foldersList
or path
, the reportsList
displays reports that are present at that same folder level. That is, the parentItemID
property of the reports
EnterpriseItems
bean must be set to the current value of the parentItemID
property of the folders
bean each time the user clicks a folder in the folders grid or Path
component. The result is that the reports grid always shows the same level of information. To enable that cocomponents
.
path
component to the reportsList
component:public void synchronizeWithPath() {
reports.setParentItemID(folders.getParentItemID());
}
foldersList
component to the reportsList
component:public void synchronizeWithFoldersList() {
reports.setParentItemID(folders.getParentItemID());
}
path
component tag:actionListener="#{Contents.synchronizeWithPath}"
foldersList
component tag:actionListener="#{Contents.synchronizeWithFoldersList}"
Now, when users navigate through their folders using the path
or foldersList
component, the reportsList
component will automatically display any reports in that folder.
Note: Ensure that the autoHandleEvents
attribute of foldersList
and path
components are set to true
(default value).
As you can see, the order of synchronization matters. In our example, we synchronized foldersList
to reportsList
and path
to reportsList
. So when foldersList
or path
is clicked, reportsList
is synchronized. However, the opposite is not true. You did not synchronize reportsList
to foldersList
, therefore actions in reportsList
do not affect foldersList
. When you decide which component to synchronize, always keep in mind the behavior you wish to accomplish in your application.
Business Objects http://www.businessobjects.com/ Support services http://www.businessobjects.com/services/support/ |