jsf - How to set a Map value in h:inputText -
i'm struggling implement trivial functionality jsf involves dynamically displaying content of nested map on page , editing capabilities values. has turned out mappedvalueexpression$entry
when iterating on map c:foreach
not writable!
<c:foreach items='#{inflectionbean.word.inflectionalforms}' var="number" > <p:fieldset legend="#{number.key}"> <c:foreach items="#{number.value}" var="case" > <p:panel header="#{case.key}"> <h:inputtext value="#{case.value}" /> </p:panel> </c:foreach> </p:fieldset> </c:foreach>
when trying submit above form i'm getting:
javax.el.propertynotwritableexception: /inflection.xhtml @39,56 value="#{case.value}": class 'com.sun.faces.facelets.tag.jstl.core.mappedvalueexpression$entry' not have writable property 'value'.
i wonder if there reasonable workarounds or if approaching problem in wrong way. thanks!
basically, code attempting invoking map.entry#setvalue(value)
. indeed not possible in el. instead, should referencing map value directly on map key, el can map#put(key, value)
.
<c:foreach items="#{number.value}" var="case"> ... <h:inputtext value="#{number.value[case.key]}" />
Comments
Post a Comment