我想提交一个弹出式面板中提交/操作事件的另一个面板中的值。但在打开弹出式面板之前,我需要调用托管bean上的一个函数来创建一个新的实体对象。外板只有h:表格,因为你不能嵌套它们。我已将弹出式面板封装在a4j:区域中,以便在使用提交弹出式面板中的值时仅提交此部分。这可以工作,但不能执行弹出式面板执行时需要调用的准备功能。我试过a4j:commandLink但该组件不能与rich:popupPanel(奇怪,因为它们都是Richfaces组件?!)。所以我必须在h:commandLink上继续并使用ajax。提交弹出式面板内容,丰富:popupPanel
当打开/渲染弹出面板的链接触发时,如何调用托管bean上的函数?
(什么是这个正确的方式?)
PS。最初的问题已经改变,但不是弹出式面板中提交值的问题。在XHTML文件的
部分:
<h.form>
...
<a4j:region>
<rich:popupPanel id="popup_sys_user_req" modal="false" autosized="true" resizeable="false">
<f:facet name="header">
<h:outputText value="Request New Sector/Category" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('popup_sys_user_req')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<h:panelGrid columns="2">
<h:outputLabel value="Request New:" />
<h:selectOneMenu id="sys_req_type" value="#{userController.selectedSysUserRequest.sysrequesttype}" required="true" >
<f:selectItems value="#{userController.getSysRequestTypeItems('SECTOR_CATEGORY')}">
</f:selectItems>
</h:selectOneMenu>
<h:outputLabel value="Description:" />
<h:inputTextarea id="user_req_desc" value="#{userController.selectedSysUserRequest.description(desc)}" required="true" requiredMessage="Decription is missing" />
</h:panelGrid>
<a4j:commandButton action="#{userController.CreateSysUserRequest()}" value="Send Request" execute="sys_user_req_form" oncomplete="#{rich:component('popup_sys_user_req')}.hide(); return false;"/>
</rich:popupPanel>
</a4j:region>
</h:form>
的commandLink(重新编辑)
<h:commandLink actionListener="#{userController.prepareCreateSysRequest}" value="Request New Sector/Category">
<f:ajax execute="popup_sys_user_req @this" render="popup_sys_user_req">
<rich:componentControl id="popup_ctr" event="click" target="popup_sys_user_req" operation="show"/>
</f:ajax>
</h:commandLink>
----------------------------
//Managed Bean:
public void prepareCreateSysRequest(ActionEvent event) {
selectedSysUserRequest = new Sysuserrequest();
JsfUtil.log("Prepare Create System User Request");
}
This post continues the dicussion有关弹出面板。 问候克里斯。
我使用richfaces 4,并且没有用于commandbutton的limitToList。想想这就是为什么有地区,但不知道。将尝试第二个建议。谢谢。 – Chris
后续问题,我尝试通过使用execute = @ form来限制处理。页面上的第二个表单,但它接缝,它试图提交另一个。富有:地区的路要走? – Chris
当我将弹出面板移动到其自己的窗体中时,弹出面板的标题消失。 JSF是不是因为我想的那么虚弱? – Chris