【发布时间】:2016-03-03 03:06:58
【问题描述】:
我正在直接从 bean 中以编程方式添加一些 uiinput 组件,如下所示:
UIInput uiField = (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);
uiField.setId(fieldId);
请注意,我不想将此组件绑定到任何 bean 属性。
问题是,当通过 id 检索组件时,即使在表单中填充字段并提交表单后,该值也始终为 null。
UIInput uiField = (UIInput) facesContext.getViewRoot().findComponent(fieldId);
String value = uiField.getValue().toString(); //null
请指教。
【问题讨论】:
标签: java jsf jsf-2 primefaces richfaces