Ajax p:selectOneRadio第一次不工作

Ajax p:selectOneRadio第一次不工作,ajax,jsp,primefaces,click,selectoneradio,Ajax,Jsp,Primefaces,Click,Selectoneradio,我的代码id=idEsito的selectOneRadio有问题。事实上,我第一次单击它时,在listener属性中指定的java方法没有被调用,而是连续多次正确调用 <h:form id="switchForm"> <pf:panelGrid id="SRInfoPanel" styleClass="gridNoBorder centered" style="width:100%;" rendered="#{switchUfficioService.s

我的代码id=idEsito的selectOneRadio有问题。事实上,我第一次单击它时,在listener属性中指定的java方法没有被调用,而是连续多次正确调用

<h:form id="switchForm">
    <pf:panelGrid id="SRInfoPanel" styleClass="gridNoBorder centered" style="width:100%;"
        rendered="#{switchUfficioService.selectedSub != null}">
        <pf:row>
            <pf:column colspan="10" styleClass="fondoGreenDark">
                <pf:outputLabel id="titoloRiepilogo" styleClass="captionMaschera" value="RIEPILOGO DATI SWITCH" />
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column>
                <pf:panelGrid id="infoCedPanel" styleClass="gridNoBorder centered" style="width:100%;">
                    <pf:row>
                        <pf:column colspan="4">
                            <br />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column colspan="4" styleClass="fondoGreenDark">
                            <pf:outputLabel id="cedTitle" style="margin-bottom:10px; text-align:center;" styleClass="captionMaschera"
                                value="ANAGRAFICA CEDENTE" />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column colspan="4">
                            <br />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Codice Fiscale:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText styleClass="testoInput" disabled="true" value="#{switchUfficioService.selectedCed.coFis}" />
                        </pf:column>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Partita Iva:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText styleClass="testoInput" disabled="true" value="#{switchUfficioService.selectedCed.piva}" />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Ragione Sociale:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText styleClass="testoInput" disabled="true" value="#{switchUfficioService.selectedCed.ragSoc}" />
                        </pf:column>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Tipo Soggetto Responsabile:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText styleClass="testoInput" disabled="true" style="width:75%;"
                                value="#{switchUfficioService.selectedCed.tipologiaGiuridica}" />
                        </pf:column>
                    </pf:row>
                </pf:panelGrid>
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column>
                <pf:panelGrid id="infoSubPanel" rendered="#{switchUfficioService.visualizzaInfoSRSub}"
                    styleClass="gridNoBorder centered" style="width:100%;">
                    <pf:row>
                        <pf:column colspan="4" styleClass="fondoGreenDark">
                            <pf:outputLabel id="subTitle" style="margin-bottom:10px; text-align:center;" styleClass="captionMaschera"
                                value="ANAGRAFICA SUBENTRANTE" />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column colspan="4">
                            <br />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Codice Fiscale:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText disabled="true" styleClass="testoInput" value="#{switchUfficioService.selectedSub.codiceFiscale}" />
                        </pf:column>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Partita Iva:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText disabled="true" styleClass="testoInput" value="#{switchUfficioService.selectedSub.partitaIva}" />
                        </pf:column>
                    </pf:row>
                    <pf:row>
                        <pf:column style="width:20%;">
                            <pf:outputLabel styleClass="testoDati" value="Ragione Sociale:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText disabled="true" styleClass="testoInput" value="#{switchUfficioService.selectedSub.ragSoc}" />
                        </pf:column>
                        <pf:column style="width:20%;">
                            <pf:outputLabel disabled="true" styleClass="testoDati" value="Tipo Soggetto Responsabile:" />
                        </pf:column>
                        <pf:column style="width:30%;">
                            <h:inputText disabled="true" styleClass="testoInput" style="width:75%;"
                                value="#{switchUfficioService.selectedSub.descrTipo}" />
                            <br />
                        </pf:column>
                    </pf:row>
                </pf:panelGrid>
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column>
                <pf:panelGrid styleClass="gridNoBorder centered" style="width:100%;">
                    <pf:row>
                        <pf:column style="width:30%;">
                            <pf:outputLabel styleClass="testoDati" value="Inserire la tipologia di Soggetto Responsabile: " />
                        </pf:column>
                        <pf:column>
                            <pf:selectOneRadio id="idEsito" style="width: 190px" value="#{switchUfficioService.tipologiaSubentrante}">
                                <f:selectItems value="#{switchUfficioService.tipologicaSubentrante}" />
                                <pf:ajax event="click" listener="#{switchUfficioService.loadSoggettoData}" update="inputSRPanel" />
                            </pf:selectOneRadio>
                        </pf:column>
                    </pf:row>
                </pf:panelGrid>
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column>
                <pf:panelGrid id="inputSRPanel" style="width:100%;" styleClass="gridNoBorder centered">
                    <pf:row id="soggettoNazionaleRow" rendered="#{switchUfficioService.tipologiaSubentrante == 'N'}">
                        <pf:column>
                            <ui:include src="SoggettoNazionalePanel.xhtml">
                                <ui:param name="suffisso" value="Int" />
                            </ui:include>

                        </pf:column>
                    </pf:row>
                    <pf:row id="soggettoEsteroRow" rendered="#{switchUfficioService.tipologiaSubentrante == 'E'}">
                        <pf:column>
                            <ui:include src="SoggettoEsteroPanel.xhtml">
                                <ui:param name="suffisso" value="Ext" />
                            </ui:include>
                        </pf:column>
                    </pf:row>
                </pf:panelGrid>
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column>
                <ui:include src="../../frags/contratti/SwitchNoteDoc.xhtml"></ui:include>
                <br />
                <br />
            </pf:column>
        </pf:row>
        <pf:row>
            <pf:column align="center">
                <pf:commandButton id="eseguiSwitch" value="Esegui Switch" type="button" styleClass="commandButton"
                    onclick="updateConfirm();">
                    <pf:remoteCommand name="updateConfirm" actionListener="#{switchUfficioService.verificaPreInvio}"
                        update="confermaSwitch, :messageBox" />
                </pf:commandButton>

                <pf:confirmDialog message="#{switchUfficioService.confirmMessage}" id="confermaSwitch" widgetVar="confermaSwitch"
                    header="Conferma Switch" severity="alert" dynamic="true" showEffect="fade" hideEffect="explode" width="400px">

                    <h:panelGroup layout="block" style="text-align: center;">
                        <pf:commandButton value="Si" process="@this" immediate="true" type="submit" ajax="false"
                            action="#{switchUfficioService.eseguiSwitch}" oncomplete="alert('Switch effettuato con successo')"
                            onclick="massivePublishConfirmation.hide();" onstart="PrimeFaces.monitorDownload(start, stop)"
                            styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                        <pf:commandButton value="No" type="button" onclick="confermaSwitch.hide()" styleClass="ui-confirmdialog-no"
                            icon="ui-icon-close" />
                    </h:panelGroup>
                </pf:confirmDialog>

                <pf:commandButton value="Pulisci" type="submit" ajax="false" id="idPulisciTutto"
                    action="#{switchUfficioService.clearSwitchAll}" onclick="PrimeFaces.monitorDownload(start, stop)" />
                <pf:commandButton value="Indietro" type="submit" ajax="false" id="idIndietro"
                    action="#{switchUfficioService.indietroSwitch}" onclick="PrimeFaces.monitorDownload(start, stop)" />
            </pf:column>
        </pf:row>
    </pf:panelGrid>
</h:form>
这个想法是,选择一个单选按钮,我可以从DB加载一些数据,然后打开一个不同的面板,这取决于选择的按钮

它仅在第二次单击后工作。我搜索了论坛,但没有发现任何相同的问题。谢谢你的帮助
`

你能举个简单的例子吗?使用firefox inspector检查单选按钮,我看到有两个事件click附加到对象:一个Jquery click事件和一个DOM2 click事件。当我第一次单击单选按钮时,Jquery事件会捕获我的单击而不做任何事情。在这之后,使用inspector,我可以看到没有一个Jquery单击事件与radiobutton关联,事实上它工作正常。我需要避免第一次单击时出现故障,我希望此分析可能有用
public void loadSoggettoData(AjaxBehaviorEvent event){
    log.debug("Entrato in LoadSoggettoData =======> Tipologia Subentrante: {}", tipologiaSubentrante);
    log.debug("Info sull'evento: {}, {} ",event.getBehavior(), event.getClass());

    if(StringUtils.equals(tipologiaSubentrante,"N"))
    {
        soggettoSU = caricaSoggettoNazionale(this.selectedSub.getGblId());
    }
    else
    {
        soggettoSU.clear();
    }
}