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 254670 - Radio buttons with enums aren't visually updated on first click
Summary: Radio buttons with enums aren't visually updated on first click
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:
Depends on:
Blocks:
 
Reported: 2015-08-24 20:35 UTC by Jaroslav Tulach
Modified: 2015-09-18 13:35 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-08-24 20:35:28 UTC
Imagine model:

@Model(className = "Data", targetId="", properties = {
    @Property(name = "s3", type=String.class),
    @Property(name = "p3", type=En.class)
})
final class DataModel {
    private static Data ui;
    static void onPageLoad() throws Exception {
        ui = new Data("A", En.A);
        ui.applyBindings();
    }
    @OnPropertyChange("s3")
    static void s3Is(Data d) {
        System.err.println("s3: " + d);
    }
    @OnPropertyChange("p3")
    static void p3Is(Data d) {
        System.err.println("p3: " + d);
    }
}
enum En {
    A, B
}



and HTML:

<div>
    String:
    <input type="radio" name="s3" value="A" data-bind="checked: s3">Ano
    <input type="radio" name="s3" value="B" data-bind="checked: s3">Ne
</div>
<div>
    Enum:
    <input type="radio" name="p3" value="A" data-bind="checked: p3">Ano
    <input type="radio" name="p3" value="B" data-bind="checked: p3">Ne
</div>

then string version works OK while enum one is broken.
Comment 1 Jaroslav Tulach 2015-08-24 20:38:43 UTC
Will be part of 1.2 version:
http://hg.netbeans.org/html4j/rev/3e051dd888c4
Comment 2 Jaroslav Tulach 2015-09-15 18:54:36 UTC
Turned out the solution does way more callback between JS->Java then before slowing down the whole execution to unsustainable level.
Comment 3 Jaroslav Tulach 2015-09-18 13:35:11 UTC
http://hg.netbeans.org/html4j/rev/3dfb8f1fd2f5 part of 1.2.2 release of HTML/Java API.