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 99325 - Property Change Event not fired when Rule added/removed
Summary: Property Change Event not fired when Rule added/removed
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 100828 112141 (view as bug list)
Depends on:
Blocks: 100055 112141
  Show dependency tree
 
Reported: 2007-03-29 00:22 UTC by Joelle Lam
Modified: 2008-11-10 11:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joelle Lam 2007-03-29 00:22:35 UTC
When you remove a navigation rule from the xml file, an property change event on
the model is never triggered.
Comment 1 Joelle Lam 2007-03-29 00:34:10 UTC
Committed unit test in trunk.

IDE:-------------------------------------------------
IDE: [3/28/07 4:32 PM] Committing "SyncUpdateTest.java" started
Checking in SyncUpdateTest.java;
/cvs/web/jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
new revision: 1.7; previous revision: 1.6
done
IDE: [3/28/07 4:32 PM] Committing "SyncUpdateTest.java" finished
Comment 2 Petr Pisl 2007-03-29 03:52:20 UTC
Is this really P1?
Comment 3 Petr Pisl 2007-03-29 04:35:46 UTC
In the test the event is not fired, because the model still things that there is
the same number of navigation rules as was before removing. I will investigate
more.  
Comment 4 Petr Pisl 2007-03-29 05:15:37 UTC
Fixed in the trunk
Checking in SyncUpdateVisitor.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/SyncUpdateVisitor.java,v
 <--  SyncUpdateVisitor.java
new revision: 1.2; previous revision: 1.1
done
Comment 5 Joelle Lam 2007-04-04 04:43:39 UTC
I am still have this issue.  Are you sure it is fixed?  You might want to re-run
the unit test.
Comment 6 Joelle Lam 2007-04-12 18:15:22 UTC
*** Issue 100828 has been marked as a duplicate of this issue. ***
Comment 7 Lark Fitzgerald 2007-07-24 22:03:02 UTC
Note: This issue appears to be causing a failure in VW hyperlink component test.
Comment 8 Joelle Lam 2007-08-07 03:40:22 UTC
Just renaming more appropriately.  
Comment 9 Joelle Lam 2007-08-07 03:40:56 UTC
*** Issue 112141 has been marked as a duplicate of this issue. ***
Comment 10 Petr Pisl 2007-08-27 15:22:57 UTC
I did better test for the firing event. Based on the test the behavior is:

If there is deleted a component (like NavigationRule or NavigationCase), then the PropertyChangeEvent and ComponentEvent
are fired. If there is a property of component deleted (like ToViewID or FromOutcome), only ComponentEvent is fired. The
ComponentEvent is VALUE_CHANGED. 

So basically there are tree options:
1) Clients will listen also on the ComponentListeners.
2) All the simple property will be rewritten to the simple components, but it means that all client will have to reflect
these changes, because it requires changes in the api interfaces.
3) We will ask for a functionality, which will fire a PropertyChangeEvent from xam module.

Joelle, the simplest solution is that your code will also listen a ComponentListener. Look at the improved test
SyncUpdateTest.testSyncRemoveCase_99325, where I'm testing, whether the event is fired. 

If you think, that the solution 1 is ok for you, please close the issue.
Comment 11 Joelle Lam 2007-08-28 20:00:32 UTC
I looked at this issue of removing a "Rule" from the page and it seems that it has been fixed.  Now when I remove a rule
PropertyChangeListener is called.  Maybe something got fixed in XAM?  So we can mark this bug as fixed.  The additional
issue that you mentioned below is something that I didn't catch ealier. It probably should be refiled against XAM.  Per
the notes, PropertyChangeListener is supposed to offer finer granularity than Component Listener
(http://xml.netbeans.org/xam-usage.html). I am worried that if I submit a work around, they might fix this and cause a
regression (or double accounting of the same action due to two listeners) in my code.
Comment 12 martin_zmrhal 2008-11-10 11:32:52 UTC
verified

Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)