I have a dynamically created HtmlInputText
, which is set to pull its value from a map in a session scoped bean. Like so.
HtmlInputText input = new HtmlInputText();
String expression = "${catalogue.itemValues.A" + item.getId() + "}";
ValueExpression valExpression = expressionFactory.createValueExpression(facesInstance.getELContext(), expression, String.class);
input.setValueExpression("value",valExpression);
where itemValues
is a map with a getter of getItemValues()
and the key would be A1
, A2
, etc.
I have programatically added a value to the Map
with the key A1
and value 1234
. Whenever the JSF page appears, the value is rendered. However, when I change the value and submit the form, the value is not changed.
I have tested with a h:inputText
element and linked it to the same key and it is able to update the value and the new value is reflected in the generated HtmlInputText
component.
How is this caused and how can I solve it?