Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] overriding isdirty for changes to custom list property

Unless you can re-work your logic to apply changes to the editor buffer in real-time, you will be stuck overriding the editor’s isDirty() method and the save logic. Sapphire model itself has no concept of dirty state as the changes are always written through to the underlying resource. If management of dirty state is necessary (like in an editor environment), it is up to the resource to manage it. When the model sits on top of XML Editor, model changes are written through to editor’s DOM, which then updates editor’s text buffer and sets the dirty flag.

 

- Konstantin

 

 

From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Greg Amerson
Sent: Tuesday, November 15, 2011 1:52 AM
To: Sapphire project
Subject: [sapphire-dev] overriding isdirty for changes to custom list property

 

I have a case where I am creating a CustomXmlListBinding for a ListProperty but the elements in the list property don't ever get serialized to the underlying XML file, they are just "in memory" so that I can hook up property editors in the UI and let the user change them.  Then I want to perform actions based on the model changes to that ListProperty when editor is saved.  However, the problem is that when the user makes a change in the UI from the masterDetails page, that ends up changing a list property in my CustomXmlListBinding, I don't know the best way to mark the editor as dirty.  I know that I could add a property listener from my editor subclass for that specific property and then fire an DIRTY event and then override the isDirty() method.  But I was wondering if this is a way to handle this so I don't have to override the top-level isDirty() method on the SapphireEditorForXML.

 

--

Greg Amerson

Liferay, Inc.


Back to the top