cancel
Showing results for 
Search instead for 
Did you mean: 

custom icon set by setPropertyValue disappears

roccapl_
Confirmed Champ
Confirmed Champ

I have an Action Seam Bean and a list of the currently selected documents called selectedDocs

My button cycles the list and changes the icon of the documents in this way:


for (DocumentModel selectedDoc : selectedDocs) {
selectedDoc.setPropertyValue("icon", "icons/archive.png");
}

where archive.png is an icon stored in the nuxeo.war

Now, the icon changes, but if i logout or create a new file in the same workspace it disappears and it's replaced by the default icon.

I tried calling documentManager.save(); (documentManger is the CoreSession) hoping that it would have made the icon change permanent, but it doesn't change this behaviour.

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

The default MimetypeIconUpdater listener probably overrides your changes

View answer in original post

4 REPLIES 4

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

The default MimetypeIconUpdater listener probably overrides your changes

Any workaround?

use another listener that overrides the default behaviour in your case, makijng sure it's executed after the default one

roccapl_
Confirmed Champ
Confirmed Champ

The correct solution is to call CoreSession#saveDocument after setting the property and the icon no longer disappear.