-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3495268
By: nobody
I got an error with java script. I do not know exactly why it came, but this is the information I have:
Problem file: zkau/web/js/i_zul.js
Line number: 1439
Snippet:
_calcSize2: function () {
....
var tblwd = this.body.clientWidth - 1;
//due to experiment, we have to substract 1 to avoid
//hor. scrollbar from appearing
if (this.headtbl) {
var extra = (this.body.offsetWidth - this.body.clientWidth) <= 5 ? 2: 0;
this.headtbl.style.width = this.head.style.width = (tblwd + extra) + 'px'; //ERROR HERE ....
In my runtime, 'this.body.clientWidth' evaluates to zero. So (tblwd + extra)
+ 'px' is -1, which gives an error saying invalid argument for width.
Is this a bug?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3495334
By: tomyeh
It shall be a bug if clientWidth will be zero. Is your listbox or tree contain no row at all?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3495341
By: samyem
My listbox does have rows. In anycase, I think the code should have been able to handle this situation. You can take a look at my code if that helps:
http://samyem.com/webdb.src.zip
The problem occured while rendering net.yomari.webdb.ui.TableTabBox .
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3495398
By: tomyeh
Samyem,
I skimmed your codes. It looks OK to me. Would you post the executable or a hyper link that I can test without compiling your codes?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3495587
By: nobody
I didn't want to put the website in public as I have not implemented any security in the app yet. However, you can run it locally with http://www.samyem.com/webdb.zip Just put the ZK and Firebird (jaybird-full-2.0.0.jar) libs under the WEB-INF/lib folder.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3496613
By: nobody
You can get the same error with the following code (mind the quotes). Put this inside a Window and see the error appear. The error does not come if I do not add the header of the listbox.
Listbox myList=new Listbox();
this.appendChild(myList);
Listhead header=new Listhead();
header.setParent(myList);
Listheader nameHeader=new Listheader("Name"); header.appendChild(nameHeader);
Listheader typeHeader=new Listheader("Type"); header.appendChild(typeHeader);
Listitem columnItems=new Listitem();
myList.appendChild(columnItems);
Listcell cell=new Listcell("some label"); columnItems.appendChild(cell);
Listcell celltype=new Listcell("some type"); columnItems.appendChild(celltype);
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3496632
By: nobody
I found the root cause of the problem. Apparently, if a listbox does not have the width specified, adding the listhead causes the java script error to occur.
This is a bug. The listbox should have taken a default width if one is not given.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3496659
By: tomyeh
It is fixed(the codes you posted in the last mail is really useful). It will be available at the next release.
It is, as you suggested, caused by zero width. However, the real cause is that the width is not ready yet (in IE) and we have to delay the calc.
Thus, the fix is
var wd = tblwd + ((this.body.offsetWidth - this.body.clientWidth) <= 5 ? 2: 0); if (wd < 0) wd = 0; this.headtbl.style.width = this.head.style.width = wd + 'px';
Asked: 2005-12-28 06:27:43 +0800
Seen: 612 times
Last updated: Dec 29 '05