You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Dusan Balek (Jira)" <ji...@apache.org> on 2022/03/17 10:18:00 UTC

[jira] [Updated] (NETBEANS-6478) Support for Knockout's "checked" binding broken.

     [ https://issues.apache.org/jira/browse/NETBEANS-6478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dusan Balek updated NETBEANS-6478:
----------------------------------
    Description: 
HTML4J does not correctly support Knockout's "checked" binding that includes {{checkedValue.}} The following code snippet illustrating the use case is copied from the Knockout documentation:
{code:java}
<!-- ko foreach: items -->
    <input type="checkbox" data-bind="checkedValue: $data, checked: $root.chosenItems" />
    <span data-bind="text: itemName"></span>
<!-- /ko -->

<script type="text/javascript">
    var viewModel = {
        items: ko.observableArray([
            { itemName: 'Choice 1' },
            { itemName: 'Choice 2' }
        ]),
        chosenItems: ko.observableArray()
    };
</script>{code}
Having the corresponding Java:
{code:java}
@HTMLDialog(url = "<snippet>.html")
static HTMLDialog.OnSubmit showUI() {
    ViewModel model = new ViewModel();
    model.applyBindings();
    return (id) -> {
        List<Item> chosenItems = model.getChosenItems();
        return !chosenItems.isEmpty();
    };
}

@Model(className = "ViewModel", targetId = "", instance = true, builder = "with", properties = {
    @Property(name = "chosenItems", type = Item.class, array = true)
})
static final class ViewModelControl {
    @ComputedProperty
    static List<Item> items() {
        return Arrays.asList(new Item("Choice 1"), new Item("Choice 2"));
    }
}

@Model(className = "Item", instance = true, properties = {
    @Property(name = "itemName", type = String.class)
})
static final class ItemControl {
}

{code}
The content of `chosenItems` does not reflect changes in checkbox selection.

 

  was:
HTML4J does not correctly support Knockout's "checked" binding that includes {{checkedValue.}} The following code snippet illustrating the use case is copied from the Knockout documentation:

 
{code:java}
<!-- ko foreach: items -->
    <input type="checkbox" data-bind="checkedValue: $data, checked: $root.chosenItems" />
    <span data-bind="text: itemName"></span>
<!-- /ko -->

<script type="text/javascript">
    var viewModel = {
        items: ko.observableArray([
            { itemName: 'Choice 1' },
            { itemName: 'Choice 2' }
        ]),
        chosenItems: ko.observableArray()
    };
</script>{code}
Having the corresponding Java:
{code:java}
@HTMLDialog(url = "<snippet>.html")
static HTMLDialog.OnSubmit showUI() {
    ViewModel model = new ViewModel();
    model.applyBindings();
    return (id) -> {
        List<Item> chosenItems = model.getChosenItems();
        return !chosenItems.isEmpty();
    };
}

@Model(className = "ViewModel", targetId = "", instance = true, builder = "with", properties = {
    @Property(name = "chosenItems", type = Item.class, array = true)
})
static final class ViewModelControl {
    @ComputedProperty
    static List<Item> items() {
        return Arrays.asList(new Item("Choice 1"), new Item("Choice 2"));
    }
}

@Model(className = "Item", instance = true, properties = {
    @Property(name = "itemName", type = String.class)
})
static final class ItemControl {
}

{code}
The content of `chosenItems` does not reflect changes in checkbox selection.

 


> Support for Knockout's "checked" binding broken.
> ------------------------------------------------
>
>                 Key: NETBEANS-6478
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-6478
>             Project: NetBeans
>          Issue Type: Bug
>          Components: platform - HTML4J
>            Reporter: Dusan Balek
>            Assignee: Jaroslav Tulach
>            Priority: Major
>
> HTML4J does not correctly support Knockout's "checked" binding that includes {{checkedValue.}} The following code snippet illustrating the use case is copied from the Knockout documentation:
> {code:java}
> <!-- ko foreach: items -->
>     <input type="checkbox" data-bind="checkedValue: $data, checked: $root.chosenItems" />
>     <span data-bind="text: itemName"></span>
> <!-- /ko -->
> <script type="text/javascript">
>     var viewModel = {
>         items: ko.observableArray([
>             { itemName: 'Choice 1' },
>             { itemName: 'Choice 2' }
>         ]),
>         chosenItems: ko.observableArray()
>     };
> </script>{code}
> Having the corresponding Java:
> {code:java}
> @HTMLDialog(url = "<snippet>.html")
> static HTMLDialog.OnSubmit showUI() {
>     ViewModel model = new ViewModel();
>     model.applyBindings();
>     return (id) -> {
>         List<Item> chosenItems = model.getChosenItems();
>         return !chosenItems.isEmpty();
>     };
> }
> @Model(className = "ViewModel", targetId = "", instance = true, builder = "with", properties = {
>     @Property(name = "chosenItems", type = Item.class, array = true)
> })
> static final class ViewModelControl {
>     @ComputedProperty
>     static List<Item> items() {
>         return Arrays.asList(new Item("Choice 1"), new Item("Choice 2"));
>     }
> }
> @Model(className = "Item", instance = true, properties = {
>     @Property(name = "itemName", type = String.class)
> })
> static final class ItemControl {
> }
> {code}
> The content of `chosenItems` does not reflect changes in checkbox selection.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists