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 255026 - Html/Java@1.2 does not notify change of a model property
Summary: Html/Java@1.2 does not notify change of a model property
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Html4j (show other bugs)
Version: 8.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2015-09-05 20:33 UTC by Jaroslav Tulach
Modified: 2015-09-08 06:43 UTC (History)
0 users

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 Jaroslav Tulach 2015-09-05 20:33:42 UTC
Following test fails on 1.2 version:

    @Test public void changingModelClass() throws Exception {
        final MyY myY = new MyY("Ahoj", 0);
        MyX p = Models.bind(
            new MyX(myY, new MyY("Hi", 333), new MyY("Hello", 999)),
            c)
        .applyBindings();
        MyY realY = p.getOne();

        Map m = (Map)Models.toRaw(p);
        Object v = m.get("one");
        assertNotNull(v, "Value should be in the map");
        assertEquals(v.getClass(), One.class, "It is instance of One");
        One o = (One)v;
        assertEquals(o.changes, 0, "No changes so far");
        assertFalse(o.pb.isReadOnly(), "Normal property");
        assertEquals(o.get(), myY);
        assertSame(o.get(), realY);

        final MyY newY = new MyY("Hi", 1);
        p.setOne(newY);

        assertSame(p.getOne(), newY);
        assertEquals(o.changes, 1, "One change");
    }
Comment 1 Jaroslav Tulach 2015-09-05 20:37:02 UTC
https://hg.netbeans.org/html4j/rev/34eed9763f59
The fix should get into NetBeans 8.1
Comment 2 maxnitribitt 2015-09-08 06:43:38 UTC
I tested my fifteen game and the CRUD archetype. No problems found with 1.2.1 so far