Hi Stephane, thanks for your answer.
I don't need to save my custom fields in DB. I declared new field in the RepositoryEntry as Transient and all is working fine.
If I use the a TextElement for my custom field in controller and a String field in the RepositoryEntry, after save I can read new values in the reloaded form. My problem persist with object of type TextBoxListElement. If I add a new tag in the TextBoxListElement, then click on button 'Save', the reloaded form haven't the new tag I inserted before click 'Save'
For this object I declare in the RepositoryEntry this attribute:
@Transient
private Map<String, String> tags;
public Map<String, String> getTags() {
return tags;
}
public void setTags(Map<String, String> tags) {
this.tags = tags;
}
in the init method of controller I put this code:
List<Tag> fetchedTags = taggingManager.loadTagsForResource(repositoryEntry, null, null);
Map<String, String> repositoryEntryTags = new HashMap<String, String>();
if (fetchedTags!=null) {
for (Tag fetchedTag : fetchedTags) {
repositoryEntryTags.put(fetchedTag.getTag(), fetchedTag.getTag());
}
}
repositoryEntry.setTags(repositoryEntryTags);
tagListElement = uifactory.addTextBoxListElement("artefact.tags", "tag.label", "tag.input.hint", repositoryEntry.getTags(), descCont, getTranslator());
tagListElement.setElementCssClass("o_sel_ep_tagsinput");
Best regards
Ivano