JSF 代码:
<rich:popupPanel modal="true" id="editPanelUser">
<h:form>
<h:panelGrid columns="2">
<h:outputLabel value="first name (*)" />
<h:inputText value="#{usersBean.currentItem.firstName}" />
</h:panelGrid>
<h:panelGrid>
<a4j:commandButton value="save"
oncomplete="if(#{facesContext.maximumSeverity==null}) #{rich:component('editPanelUser')}.hide()"
action="#{usersBean.runAction('saveUser')}"/>
</h:panelGrid>
</h:form>
</rich:popupPanel>
支持 bean 代码:
public void setRunAction(String action){
if("saveUser".equals(action)){
...
}
}
我在 setRunAction 方法中放了一个断点,但它从来没有在这里。想法?
奇怪的是,打开此弹出窗口的 a4j:commandLink 代码工作正常并调用 runAction 方法:
<h:form>
<rich:dataTable value="#{usersBean.dataList}" var="singleUser"
rowClasses="row1,row2" rowKeyVar="row" id="singleUserTable"
ajaxKeys="#{usersBean.keys}">
<rich:column>
<a4j:commandLink id="editlink"
oncomplete="#{rich:component('editPanelUser')}.show();return false;">
<f:setPropertyActionListener value="editUser"
target="#{usersBean.runAction}" />
</a4j:commandLink>
</rich:column>
</rich:dataTable>
</h:form>