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 249319 - applyBindings only to part of the DOM tree
Summary: applyBindings only to part of the DOM tree
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Html4j (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks: 248418
  Show dependency tree
 
Reported: 2014-12-12 10:31 UTC by Jaroslav Tulach
Modified: 2014-12-19 10:03 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Introduces applyBindings(String) at various places (10.33 KB, patch)
2014-12-12 11:33 UTC, Jaroslav Tulach
Details | Diff
@Model(targetId="xyz") (25.12 KB, patch)
2014-12-18 09:46 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2014-12-12 10:31:04 UTC
The knockout.js allows people to applyBindings of their models only to particular subtree of the DOM identified by its topmost element. There is no Java only way to access this useful functionality from Java and it limits the usefulness of HTML/Java knockout bindings.
Comment 1 Jaroslav Tulach 2014-12-12 10:36:20 UTC
The envisioned proposal is to let @Model(...) annotation processor generate not only applyBindings(), but also

public ModelClass applyBindings(String elementId);

which could be used to apply the model to element with given id. Mimics closely the "Activating Knockout" section at http://knockoutjs.com/documentation/observables.html
Comment 2 Jaroslav Tulach 2014-12-12 11:02:00 UTC
The "sub-tree" only application of data will be useful for example for wizards, that always manipulate just a piece of the page.
Comment 3 Jaroslav Tulach 2014-12-12 11:33:30 UTC
Created attachment 151070 [details]
Introduces applyBindings(String) at various places
Comment 4 Jaroslav Tulach 2014-12-18 09:46:59 UTC
Created attachment 151170 [details]
@Model(targetId="xyz")

Rather than the previous patch, I'd like to integrate this one, which introduces new "targetId" attribute (and associated incompatible change with respect to applyBindings() method). With this change it will be easier to use the benefits of issue 231131.
Comment 5 Jaroslav Tulach 2014-12-19 10:03:17 UTC
OK. Applied the "targetId" version. Will be part of 1.1 release:
http://hg.netbeans.org/html4j/rev/117b732d42d0