【发布时间】:2023-03-11 02:26:01
【问题描述】:
我需要带有可编辑列的pickList,我不确定是否可能。
选择列表:
<p:pickList value="#{model.formatList}"
var="format"
itemValue="#{format.formatName}"
converter="formatConverter">
<p:column>
<h:outputText value="#{format.formatMess}" />
</p:column>
<p:column>
<p:inputText value="#{format.width}" />
</p:column>
</p:pickList>
在我的Backing Bean中,formatList中的所有字段都有getter&setter。
当我提交表单时,控制台中会显示一些错误消息:
[javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-0.0.0.0-0.0.0.0-8080- 1)/page/lookup/lookupFormatEdit.xhtml @91,45 value="#{format.width}" : Target Unreachable, identifier 'format' resolved to null: javax.el.PropertyNotFoundException ...
但如果我将<p:inputText value="#{format.width}" /> 替换为<h:outputText value="#{format.width}" />,它会起作用。
任何人都可以给我一些建议,谢谢。
【问题讨论】:
-
虽然不行,但我想知道为什么会出现这个错误
-
你能贴出你的backing bean的代码吗?页面好像找不到bean
-
我找到了一种方法来代替:在提交之前,我使用javascript将picklist数据制作为JSON格式,然后backing bean可以获取JSON值来更新模型。感谢您的帮助。跨度>
标签: jsf-2 primefaces