Steps to Reproduce
run a ZK 10 project with client-bind jar on classpath.
run attached sample
Current Result
client-bind.wpd is added to the page, causing matchmedia to triggers twice.
(once for regular matchMedia, one when binder is created by client-bind)
Expected Result
just adding client-bind without zk.xml or apply="ClientBindComposer" shouldn't affect unrelated pages.
Debug Information
zul.tab.Tabbox.prototype.setSelectedTab calls this._getBinder()
_getBinder creates a binder if none is found
creating binder causes matchMedia to be sent
additionally, under some circumstances, the binder initializes when the components are not attached to a deskop, which causes a null error at client-side.
(ask matt)
Workaround
workaround for SPECIFICALLY the tabbox setSelectedTab issue (doesn't cover other possible side-effects of having client-bind in page)
<script><![CDATA[ zk.afterLoad("zul.tab", function () { var _xTabbox = {}; zk.override(zul.tab.Tabbox.prototype, _xTabbox, { setSelectedTab: function (selectedTab, fromServer) { if (this._selTab != selectedTab) { this._setSel(selectedTab, !fromServer); this._selTab = selectedTab; } if (!fromServer) { var binder = this._getBinder(); if (binder) { this.fire('onSelect', { items: [selectedTab], reference: selectedTab }, { toServer: false }); // to trigger save binding } } return this; } }); }); ]]></script>
- relates to
-
ZK-3133 Support a Match Media annotation for MVVM to use
- Closed