2012-11-23 111 views
0

伙计!我想通过以下方式来创建确认对话框:模式面板块Richfaces确认对话框

<h:form> 
    <a4j:commandButton id="declareNewStatusCbt" image="/img/buttons/save.png" 
    styleClass="hoverable rich-panel-button" 
    onclick="#{rich:component('confirmation')}.show();return false"> 
    </a4j:commandButton> 
    <a4j:jsFunction name="doSubmit" action="#{customerService.action}"/> 
</h:form> 

按钮的下面(富:modalPanel有id="confirmation"):

<h:commandButton image="img/buttons/proceed.png" styleClass="hoverable"  
onclick="#{rich:component('confirmation')}.hide();doSubmit();return false;"/> 

所以,基本上我需要得到与a4j:commandButton action="#{customerService.action}"效果相同,但是当我按下模式窗口上的“继续”按钮时,我在FireFox控制台中收到TypeError: this._form is null,并且页面重新加载。有任何想法吗?

谢谢!

回答

0

我已经找到了我自己的解决方案 - 这工作相当好,问题是在附上<h:form>。显然a4j:jsFunction调用表单提交是不可取的,这是一个耻辱,不要注意到这一点。所以,你可以简单地删除<h:form> :)