-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.1
-
Security Level: Jimmy
-
None
a user reported an unfortunately not reproducible case where he is getting the following JS Errors (happened with native scrollbar enabled)
SCRIPT5007: Für die Eigenschaft "scrollTop" kann kein Wert festgelegt werden: Das Objekt ist Null oder undefiniert
zk.wpd, Zeile 27987 Zeichen 4
the following JS code added to a page fixed the related issues:
(Added checks before trying to access "this.ebody.scrollTop = 0;")
<script> <![CDATA zk.afterLoad('zkmax, zul.sel', function() { //console.log("override listbox"); var _listbox = {}; zk.override(zul.sel.Listbox.prototype, _listbox, { setResetDataLoader: function () { this._justScrollPads = this._currentTop = this._currentLeft = this._topPad = this._lasttop = 0; this.refreshBar_(false, true); //console.log("setResetDataLoader listbox called", this.ebody) if (this._nativebar && this.ebody) { this.ebody.scrollTop = 0; } } }); }); zk.afterLoad('zkmax, zul.grid', function() { //console.log("override grid"); var _grid = {}; zk.override(zul.grid.Grid.prototype, _grid, { setResetDataLoader: function () { this._currentTop = this._currentLeft = this._topPad = this._lasttop = 0; this.refreshBar_(false, true); //console.log("setResetDataLoader grid called", this.ebody) if (this._nativebar && this.ebody) { this.ebody.scrollTop = 0; } } }); }); ]]> </script>
Even if the reported issue was about listbox, the same might happen with Grid... as the code looks very similar.
affected files are in zkmax.jar
/web/js/zkmax/grid-rod.js:
/web/js/zkmax/listbox-rod.js:
- relates to
-
ZK-3932 zul.sel.Listbox.setSelInView() tries to access non-existing DOM element
- Closed