首页 > 解决方案 > Adf selectOneChoice valueChangeListener NullPointerException

问题描述

当我试图在下拉列表中选择第二个项目时,我的 SelectOneChoice 的 valueChangeListener 没有被调用。例如 value="#{bindings.pagents.inputValue" eq 32 在第一个选择这个值但是如果改变其他值返回 null

vce.getNewValue().toString()

我正在使用 JSF 2.2 和 Jdeveloper 12.2.1.3.0。

我的 SelectOneChoice 的代码

<af:selectOneChoice value="#{bindings.pagents.inputValue}"
                                        label="#{bindings.AgentAdvancedFileMedical1.hints.IdtMatag.label}"
                                        autoSubmit="true" immediate="true"
                                        id="soc4" 
                                        binding="#{DossierMedBean.idtagentcodes}"
                                        valueChangeListener="#{DossierMedBean.agentchanged}">
                        <f:selectItems value="#{bindings.pagents.items}" id="si4"/>
                        <f:validator binding="#{bindings.pagents.validator}"/>
                    </af:selectOneChoice>

我的 ValueChangeListener 的代码

    public void agentchanged(ValueChangeEvent vce) {
       vce.getComponent().processUpdates(FacesContext.getCurrentInstance());
       Integer value = Integer.parseInt(vce.getNewValue().toString());
       if (vce.getNewValue() != null) {  
        BindingContainer bindings =
                BindingContext.getCurrent().getCurrentBindingsEntry();
          OperationBinding operationBindinsgs = bindings.getOperationBinding("filterAgentDossierByPartenaire");
       operationBindinsgs.getParamsMap().put("filterAgentStrings",value );
        operationBindinsgs.execute();
        AdfFacesContext.getCurrentInstance().addPartialTarget(dossiermed);
        aDFLogger.info("table refreshed successfully!");

        }
   }

标签: jsforacle-adf

解决方案


推荐阅读