0
On my screen, I need the list of tags in the chips component to start empty and when I have values I need them to be set as tags, but when I try to start an empty list of tags, the component starts a blank tag in the field, I need the field to start blank, without any tag...
public String getCanInteresses() {
return canInteresses;
}
public void setCanInteresses(String canInteresses) {
this.canInteresses = canInteresses;
}
//REVISAR
public List<String> getCanListInteresses() {
return Arrays.asList(canInteresses);
}
public void setCanListInteresses(List<String> canInteresses) {
this.canInteresses = StringUtil.join(canInteresses, ",");
}
XHTML
<p:panelGrid columns="3" layout="grid">
<p:panelGrid columns="1" layout="grid">
<p:outputLabel value="Interesse" />
<p:chips id="tagsInteresse" value="#{curriculoBean.crudObj.canListInteresses}" />
<p:commandButton value="Adicionar" icon="#{icon.adicionar}" process="@this :form1:tagsInteresse" update=":form1:tagsInteresse" oncomplete="$(function(){PrimeFaces.focus('form1:tagsInteresse');});" />
</p:panelGrid>
</p:panelGrid>
The field starts with null and even doing the test if it is null and setting empty, it creates a tag with no value inside
I only need the field to start with no tag, only when it already has linked values
Excellent, thank you very much :)
– O. Junior
Just one thing, I’d call the upload where? in xhtml?
– O. Junior
I would call on the bean Managed, on a
@PostConstruct
, or after loading the data from the screen, or anywhere you want to synchronize the chipsinteresses
with thecanInteresses
– nullptr
I hadn’t thought about it, thank you!
– O. Junior