获得“重新渲染”的 a4j:commandButtons 是否存在问题?
下面的代码已被简化为最简单的可能失败的事情。基本上,当有人请求确认某个操作时,我会强制他们登录,然后允许他们确认该操作。这一切都是用ajax完成的。第一个表单提交正确,但第二个表单无法运行所需的 ActionListener。第二种形式正在发布到服务器。
<h:panelGroup id="confirmPanelWrapper">
<h:panelGroup id="loginPanelInner" rendered="#{(!login.authenticated)}">
<a4j:form id="loginForm">
<h:outputText value="Enter your proctor login."/><br/>
<br/>
<h:outputText value="User Name *"/><br/>
<h:inputText size="30" id="username" value="#{login.username}"/><br/>
<br/>
<h:outputText value="Password *"/><br/>
<h:inputSecret size="30" id="password" value="#{login.password}"/><br/>
<br/>
<a4j:commandButton value="Submit" action="#{login.authenticateProctor}" reRender="confirmPanelWrapper"/>
</a4j:form>
</h:panelGroup>
<h:panelGroup id="confirmPanel" rendered="#{(login.authenticated)}">
<a4j:form id="confirmForm">
<a4j:commandButton
value="Yes"
id="confirmTest"
actionListener="#{beanName.confirmTestAssociation}"
reRender="confirmPanelWrapper"
style="padding-right:10px;"/>
<a4j:commandButton
value="No"
id="denyTest"
reRender="confirmPanelWrapper"
actionListener="#{beanName.selectionNotConfirmed}"/>
</a4j:form>
</h:panelGroup>
</h:panelGroup>
The code below has been simplified to the simplest possible thing that is failing. Basically when someone requests to confirm an action, I am forcing them to login, then allowing them to confirm the action. This is all done with ajax. The first form submission happens correctly but the second one fails to run the desired ActionListener. The second form is posting to the server though.
<h:panelGroup id="confirmPanelWrapper">
<h:panelGroup id="loginPanelInner" rendered="#{(!login.authenticated)}">
<a4j:form id="loginForm">
<h:outputText value="Enter your proctor login."/><br/>
<br/>
<h:outputText value="User Name *"/><br/>
<h:inputText size="30" id="username" value="#{login.username}"/><br/>
<br/>
<h:outputText value="Password *"/><br/>
<h:inputSecret size="30" id="password" value="#{login.password}"/><br/>
<br/>
<a4j:commandButton value="Submit" action="#{login.authenticateProctor}" reRender="confirmPanelWrapper"/>
</a4j:form>
</h:panelGroup>
<h:panelGroup id="confirmPanel" rendered="#{(login.authenticated)}">
<a4j:form id="confirmForm">
<a4j:commandButton
value="Yes"
id="confirmTest"
actionListener="#{beanName.confirmTestAssociation}"
reRender="confirmPanelWrapper"
style="padding-right:10px;"/>
<a4j:commandButton
value="No"
id="denyTest"
reRender="confirmPanelWrapper"
actionListener="#{beanName.selectionNotConfirmed}"/>
</a4j:form>
</h:panelGroup>
</h:panelGroup>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论