2013-09-27 67 views
0

我已經在我的網頁JSF的Ajax沒有提交

<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> 

以下JSF代碼用下面的支持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...."); 
} 

當單擊命令按鈕既不的箱子檢查,它提交精細。但是在檢查任一複選框時,它甚至不會調用bean.confirmLineBy()。

任何想法?

回答

0

從使用改爲使用。現在排序。