JSF Ajax没有提交

时间:2013-09-27 15:03:47

标签: ajax jsf

我的页面中有以下JSF代码

<h:panelGroup id="rSelectionPanel" rendered="#{bean.admin}">
                <h4 class="header-line">Admin Panel</h4>
                <h:panelGroup rendered="#{bean.selectionMode=='RS'}">
                <h:form styleClass="registerForm">

                <h:outputLabel value="End Line1?" rendered="#{not bean.endLine2}"></h:outputLabel> 
                                    <h:selectBooleanCheckbox id="endLine1" value="#{bean.endLine1}" rendered="#{not bean.endLine2}">
                                                    <p:ajax event="change" update=":rSelectionPanel"></p:ajax>
                                    </h:selectBooleanCheckbox>

                                    <h:outputLabel value="End Line2?" rendered="#{not bean.endLine1}"/> 
                                    <h:selectBooleanCheckbox id="endLine2" value="#{bean.endLine2}" rendered="#{not bean.endLine1}">
                                        <p:ajax event="change" update=":rSelectionPanel"></p:ajax>
                                    </h:selectBooleanCheckbox>

                                    <h:inputTextarea id="newLine2Name" styleClass="form-poshytip" title="Line2 Name" rows="1" maxlength="50"       
                                    value="#{bean.newLine2Name}" validatorMessage="Too many characters" rendered="#{bean.endLine2}">
                                        <f:passThroughAttribute name="placeholder" value="Line2 Name" />
                                        <f:validateLength maximum="50" />
                                    </h:inputTextarea>

                                    <h:commandButton styleClass="submit" value="Select Line" action="#{bean.confirmLineBy}">

                                    </h:commandButton>
                </h:form>
                </h:panelGroup>
                </h:panelGroup>

使用以下支持bean java代码

public void confirmLineBy(){
    getLog().debug("Entering confirmLineBy....");
    ConfirmLineByRequest request = new ConfirmLineByRequest();
    request.setPage(getPage());
    request.setEndLine1(endLine1);
    if(isEndLine2())request.setNewLine2Name(newLine2Name);
    request.setEndLine2(isEndLine2());
    ConfirmLineByResponse response = LineService.confirmLineBy(request, null);
    nextUnconfirmedLines.removeAll(nextUnconfirmedLines);
    setConfirmedLines(response.getConfirmedLines());
    setLine2s();
    setAddedLine(false);
    getLog().debug("CONFIRMED LINES SIZE: "+confirmedLines.size());
    getLog().debug("Exiting confirmLineBy....");
}

在没有选中任何一个框的情况下单击commandButton时,它提交正常。但是当检查其中一个复选框时,它甚至不会调用bean.confirmLineBy()。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

从使用更改为。现在排序。