RF4: rich:toolbar with rich:menuitem(s) appears in plain text only
cschlaefcke Sep 29, 2011 11:45 AMHi All,
I have a problem implementing a simple xhtml page with a rich:toolbar containing a rich:dropDownMenu and some rich:menuitem(s).
I have a login page that uses a loginBean to redirect to a welcome page. When I enter some valid credentials the welcome pages is loaded but the toolbar on it only appears in plain text. The menu items are there as defined in my xhtml and the dropDownMenu somehow opens its entries in an ajax way (some more plaintext appears with the items I also defined in the xhtml when I move the mouse over). When I load the welcome.xhtml page directly (http://myhost/myapp/views/welcome.xhtml) the menu looks like it should.
The relevant content of my faces-config.xml:
<navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>login</from-outcome> <to-view-id>/views/login.xhtml</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/views/login.xhtml</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/views/welcome.xhtml</to-view-id> </navigation-case> </navigation-rule>
The login.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head></h:head>
<body>
<f:view contentType="text/html">
<h:form id="loginForm">
<rich:panel header="#{msgs.label_loginPrompt}">
<h:panelGrid columns="3">
<h:outputText value="Name:" />
<h:inputText value="#{loginBean.name}" />
<br />
<h:outputText value="Password:" />
<h:inputSecret id="password" value="#{loginBean.password}" />
<br />
<a4j:commandButton id="loginButton" value="login" action="#{loginBean.loginAction()}" />
</h:panelGrid>
</rich:panel>
</h:form>
</f:view>
</body>
</html>
And the welcome.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head></h:head>
<body>
<h:form>
<rich:toolbar>
<rich:dropDownMenu mode="ajax">
<f:facet name="label">
<h:panelGrid>
<h:outputText value="Administration" />
</h:panelGrid>
</f:facet>
<rich:menuItem label="Search" action="#{globalNavigationDataBean.backToEmptySearch}" />
<rich:menuItem label="Edit" action="postedit" />
</rich:dropDownMenu>
<rich:menuItem label="Reports" action="reportview" />
<rich:toolbarGroup location="right">
<rich:menuItem label="Change Password}" action="changePass" />
<rich:menuItem label="Llogout" action="#{loginBean.logoutAction()}" />
</rich:toolbarGroup>
</rich:toolbar>
</h:form>
</body>
</html>
I have searched the RF-Docs and this forum with no luck - any help or hint would be very appreciated!
Best Regards,
Christian




