This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 141781

Summary: setModified does not work in XMLMV
Product: xml Reporter: scanti <scanti>
Component: XML MultiviewAssignee: Svata Dedic <sdedic>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: pjiricka
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 77210    
Bug Blocks:    

Description scanti 2008-07-26 18:42:14 UTC
I am  currently developing an RCP that uses XML-Multiview
I have found this problem. 
If I call setModified(true) on the dataObject, the first time every thing works.
Then I click on the save button and recall setModified(true).
This time I am not able to save unless I go to the Text view and  I press any key

I have found a workaround by extending XmlMultiViewEditorSupport
and adding

@Override
    public void saveDocument() throws IOException {
        super.saveDocument();
        DataObject dataObject = getDataObject();
        if(dataObject.isModified()) {
            dataObject.setModified(false);
        }
    }

I will be grateful if you could fix it
Thanks
Comment 1 Milan Kuchtiak 2008-08-12 09:05:45 UTC
The fix looks fine.
It can be integrated, I think.
Comment 2 Vince Kraemer 2008-12-03 19:33:20 UTC
bad tm value... reset to tbd
Comment 3 Petr Jiricka 2009-10-08 16:33:09 UTC
The save support in the platform is a real mess. I am wondering whether the proposed Savable interface would help here.
See issue 77210.
Comment 4 Svata Dedic 2011-11-11 20:55:36 UTC
Should work fine, current implementation (indirectly) calls DO.setModified(false) through XmlEnv. Please check in 7.1 dev/beta builds