h:selectBooleanCheckbox valueChangeListener nicht funktioniert

Ich bin mit Probleme mit der valueChangeListener von h:selectBooleanCheckbox. Ich habe den folgenden code-block:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
    <link href="../css/profile.css" rel="stylesheet" type="text/css" />
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/twt.css" rel="stylesheet" type="text/css" /> 
    <script language="JavaScript" src="../js/custom-form-elements.js"></script>
    <a4j:form id="userList">
        <a4j:outputPanel id="userListPanel" rendered="#{popupController.iIndex >= 0}">          
            <div id="listPopup_#{popupController.iIndex}" 
                style="width: 202px; height: 235px; position: absolute; right: 0%; display: none; z-index: 10000; 
                background-image: url('../images/Alert/createNewListBack.gif'); background-repeat: no-repeat;">
                <table width="180" cellpadding="0" cellspacing="0" height="100%" style="margin-top: 6px; margin-left: 10px;">
                    <a4j:repeat id="userListRepeat" value="#{popupController.userList}" rowKeyVar="i" var="listByUser">
                        <tr>
                            <td valign="middle" align="center" width="35" style="padding-left: 8px;">                               
                                <h:selectBooleanCheckbox id="listCheckbox_#{i}" name="listCheckbox_#{i}"                                                                        
                                valueChangeListener="#{popupController.addUserListMember}" immediate="true">

                            </h:selectBooleanCheckbox>
                            </td>
                            <td valign="middle" align="left" class="alertSelect" width="145">
                                <div style="width: 170px; height: auto; word-wrap: break-word; white-space: pre-wrap;">
                                    <h:outputText style="padding-right: 8px;" value="#{listByUser.name}" />                                 
                                </div>                              
                            </td>
                        </tr>                                           
                    </a4j:repeat>                   
                </table>    
            </div>          
        </a4j:outputPanel>
    </a4j:form>

</ui:composition>

Und die addUserListMember von PopupController ist

public void addUserListMember(ValueChangeEvent event) throws Exception {
    System.out.println("=========================== PopupController.addUserListMember() ==================");
    Boolean isChecked = (Boolean) event.getNewValue();
    if(isChecked) {
        System.out.println("===== Checked =====");                                              
    } else {
        System.out.println("===== Un Checked =====");
    }                
}

Aber die valuechangelistner funktioniert nicht. Ich kann nicht mit this.form.submit() da passt es nicht in den code. Ich bin in jsf 1.2.

Was ist das Heilmittel? Danke.

InformationsquelleAutor Tapas Bose | 2011-08-01
Schreibe einen Kommentar