在我的应用程序中,如果<pm:view id="mobileLogin">
在下一个视图中登录成功是<pm:view id="mobileTree">
. 在 mobileTree 视图中,我想要一个 commandButton 来调用一个注销方法,该方法将返回 String 'pm:mobileTree?reverse=true'
。问题是这不起作用。有任何想法吗?
我的代码:
<!-- Login View -->
<pm:view id="mobileLogin">
<pm:header title="LiteDoc" />
<pm:content>
<h:form id="mobileLoginForm">
<p:outputPanel id="container">
<h:panelGroup rendered="#{not loginManager.loggedIn}" >
<p:inputText id="username" value="#{loginManager.username}" />
<p:watermark for="username" value="Login" />
<p:password id="password" value="#{loginManager.password}" />
<p:watermark for="password" value="Senha" />
<p:separator />
<p:commandButton value="Login" icon="refresh" process="@form" update=":mobileTreeForm" action="#{loginManager.loginMobile}" />
</h:panelGroup>
</p:outputPanel>
</h:form>
</pm:content>
</pm:view>
<!-- Tree View -->
<pm:view id="mobileTree">
<pm:header title="LiteDoc">
<!-- Here's the problem --><p:commandButton value="Go" action="pm:mobileLogin?reverse=true" />
</pm:header>
<pm:content>
<h:form id="mobileTreeForm">
<p:dataList value="#{cabinetManager.cabinets}" var="cabinet" rendered="#{loginManager.loggedIn}">
<p:column>
<h:outputText value="#{cabinet.name}" />
</p:column>
</p:dataList>
</h:form>
</pm:content>
</pm:view>