Hi!
I've made the question below in
https://forum.primefaces.org/viewtopic.php?f=3&t=51091, and the Primefaces Core Developer Thomas Andraschko give me a hint to try getting answers here ("
Try to ask the hibernate validator guys. It seems like it uses getter and the property and those types doesn't match").
Well, I have a CRUD and I want to change the inputTexArea:
Code:
<p:inputTextarea id="tags" value="#{myController.selected.tags}" />
To the new Primefaces <b>chips</b> component:
Code:
<p:chips id="tags" value="#{myController.selected.tags}" />
An entity class excerpt:
Code:
@Lob
@Size(max = 2147483647)
@Column(name = "tags")
private String tags;
//GETTER AND SETTER OMITTED
The
get method works fine, since the tags are displayed in the field as expected:
Code:
public List<String> getTags() {
return Arrays.asList(tags.split(","));
}
But the
set method is not, because when I click on Save, occurs an Exception:
Code:
public void setTags(List<String> tags) {
this.tags = String.join(",", tags);
}
//excerpt of the Exception:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.CharSequence
at org.hibernate.validator.internal.constraintvalidators.SizeValidatorForCharSequence.isValid(SizeValidatorForCharSequence.java:33)
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:281)
Can you guys, please, help me?
Thanks in advance.