jsf - 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!");
}
}
解决方案
推荐阅读
- python - 不准确的情节袖扣情节
- amazon-lex - Amazon lex 运行时操作
- elasticsearch - 如何使用无痛脚本将新字段添加到文档中
- swift - 在 Swift 4.1 中,具体类型不能符合具有约束关联类型的协议
- java - 阻止具有跳过元素的能力的 FIFO 队列?
- scheme - Scheme/Racket中letrec的含义
- node.js - 如何在 Angular 中保护凭证
- algorithm - 用于在 While 循环内包含收缩列表的算法的大 O 表示法
- sql - 重构 COALESCE 比较
- .net - 在通过 Http 将其发送到 Angular 之前压缩/缩小 JSONObject