Hello List,
i have a question, regarding the navigation from a tomahawk tree(1)
component to another page.
If I see everything right is the body of such an tree empty, except an
treeSelectionListener!.
In my controller for this page I implemented the TreeSelectionListener
in this way.
public class OeDetailsController{
private String selectedRole;
public void valueChanged(TreeSelectionEvent event) {
HtmlTree tree = (HtmlTree) event.getSource();
TreePath selection = tree.getSelectionPath();
if (selection != null) {
Object node = selection.getLastPathComponent();
String navigationOutcome = getNavigationOutcome(node);
if (navigationOutcome != null) {
NavigationHandler navigationHandler =
FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
navigationHandler.handleNavigation(FacesContext.getCurrentInstance(),
null, navigationOutcome);
}
}
System.out.println("ValueChanged");
}
private String getNavigationOutcome(Object node) {
String navOutCome;
RoleNode desNode;
try {
desNode = (RoleNode) node;
} catch (ClassCastException e) {
navOutCome = "back";
return navOutCome;
}
System.out.println("Gefundene Description = " +
desNode.getDescription());
setSelectedRole(desNode.getDescription());
return "showRole";
}
So everything is OK and I will be redirected to another page if I click
a node in the tree.
BUT, the "dependency injection" will not be executed. We specified in
the faces-config, that we want to take this attribute into the other
controller
<managed-bean>
<description>
Controller for role details site
</description>
<managed-bean-name>RoleDetailsController</managed-bean-name>
<managed-bean-class>com.vw.ais.sra.controller.orgstructure.RoleDetailsController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>selectedRole</property-name>
<value>#{OeDetailsController.selectedRole}</value>
</managed-property>
</managed-bean>
But
<managed-property>
<property-name>selectedRole</property-name>
<value>#{OeDetailsController.selectedRole}</value>
</managed-property>
is ignored!!!
We had a previous version with the tree2 component and there it worked,
but we had to switch to tree(1). The only thing that "really" changed
were these lines.
if (navigationOutcome != null) {
NavigationHandler navigationHandler =
FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
navigationHandler.handleNavigation(FacesContext.getCurrentInstance(),
null, navigationOutcome);
}
Why this faces config "dependency injection" is ignored if I use the
NavigationHandler?????
Thx for suggestions