My bean is viewscoped. I have a simple string property with a getter and setter. The getter works fine(checked by initialising the property), but not the setter. In the setter method I am building a Stringbuffer using each of the incoming parameter.
Code:
public String getParamval() {
return paramval;
}
public void setParamval(String paramval) {
logger.info("Incoming value:" + paramval);
pvals.append(paramval);
this.paramval = "VAL";
}
Is that wrong? I have tested within the setter to see if the input string is being passed but apparently the method is not being called/invoked at all. In the view am using a #{} notation.
View:
<c:forEach items="${gdsiGeodataBean.requiredfields}" var="reqs">
<h:outputLabel value="#{reqs}:* " />
<pou:inputText value="#{gdsiGeodataBean.paramval}" required="true" requiredMessage="Input is required."/>
</c:forEach>
And why would I wanna build a stringbuffer in a setter method? because, the inputtext are created dynamically based on a dynamic list. I only have one bean property to bind to.
I know I could use a map, but for the same reason as above, i seem not able to updated a map values in the setter method. This is connected to the question I asked here Updating a map value in a managed bean