Since EL version 2.2, the following value expression is allowed:
<h:outputText value="#{entry.getRow(column)}" />
Where column would be another variable. Eventually, what seemed to work so well on an outputText, I would like to reuse on an inputText:
<h:inputText value="#{entry.setRow(column)}" />
“setRow” is defined as follows:
public void setRow(String columnName, String content) {
// ...
}
My question is: Does that work? Or rather, I know that doesn’t work, since I’m getting an error about how the requested “setRow” method does not exist. So, does what I am trying to do here work in general – and if so, how can it be done?
Thanks for any feedback and best regards
Pascal
That’s indeed not a valid expression for a “set” operation. The value expression has to be a fullworthy bean property expression, but you’re having there a bean method expression.
You can achieve the particular functional requirement using a
Mapinstead.with
On form submit, EL will use
Map#put()method to set the value (hence, no setter required for the map) which will then be available in the action method by iterating over the map entries.