[ https://issues.apache.org/jira/browse/NETBEANS-6478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606328#comment-17606328 ]
Jaroslav Tulach commented on NETBEANS-6478: ------------------------------------------- I got the binding working in the [^kobinding.zip] example. It maintains two lists {{todos}} and {{selectedTodos}}. Run and/or debug in NetBeans, *Add* new items and *Change* their checked status. All seems to be working. > 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 > Attachments: kobinding.zip > > > 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.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists