Radu Ux D. | 19 Nov 10:21

Re: Modify document property during documentModified Event

Try with event "beforeDocumentModification". "documentModified" means, 
as the name tells, document was already saved.

Radu

sean.radford.tacola.com wrote:
> Hi,
> 
> Any ideas on what I'm not doing? Basically I'm trying to update a property
> of a document as it is being saved from an edit via the front-end UI. I'm
> trying to do this via an EventListener, but any changes I make are not
> persisted. My listener is something like:
> 
> public class MyEventListener extends AbstractEventListener implements
> AsynchronousEventListener {
>   public void handleEvent(CoreEvent coreEvent) throws Exception {
>     String eventId = coreEvent.getEventId();
>     if (eventId.equals("documentModified")) {
>       doc.setProperty("myschema", "myproperty", "SOME_VALUE");
>     }
>   }
> }
> 
> Any ideas? In my actual implementatation the value is computed from other
> just entered fields - is there a better way to implement 'computed' fields?
> 
> Thanks,
> 
> Sean
> 
> 

Gmane