Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Fradiani on Jan 18, 2008 11:28
open dhtmlx forum
tabbar initialization error

hello.

i have an error when the tabbar is in initialization using javascript. the function new dhtmlXTabBar("tab") throws an exception with the message "document.defaultView.getComputedStyle(this.entBox, "") has no properties"

i assume that entBox is a reference to the div named "tab" in my html. this tab has a css with the syle properties of width, height, position, etc.

why it says that it doesnt have properties?. how can i fix that error?

Thanks.
Answer posted by Support on Jan 21, 2008 04:08
The problem may occur when you init tabbar in one iframe|window from some other iframe|window. In such case pointer to current document can be mixed and cause mentioned problem
It may occur only when size of tabbar not clearly specified and component tries to detect it automatically.

To resolve problem just set sizes of tabbar's container as
    <div width="some" height="some"
or as
    <div style="width:some; height:some;"

Answer posted by Alexander on Jan 21, 2008 14:09
Thanks for the answer.

I found that the problem in this case was because i was calling the initialization process when the object containing the div (an iframe) had the display property set to "none".
when this happens, the results from the function defaultView.getComputedStyle();  are all null values. I dont know if this is already a known bug (firefox), since that is not a correct behaviour.

the conflict was solved setting the display = "block" before all the others initializations that haves the page. hope this can help someone with the same problem..
Answer posted by Lalit on Feb 25, 2009 22:32
Hi I am getting the same error
"window.getComputedStyle(this.entBox, null) has no properties
this.entBox, null)["width"]) " which is a blocking issue as the url is not displayed

I have also set my tabbar's container height and width as
<div id="a_tabbar" class="bgcol" style="position:relative;width:100%;height:100%; overflow:auto !important"/>

Also the frame's style which I want to display on click of a button I have set as block

        var ref_iframe = parent.document.getElementsByTagName('iframe')[0];
           // This line will refresh the current page
           ref_iframe.src = "/url;
         document.getElementsByTagName('iframe')[0].style.display="block";

But still it is not working.
Could you guide me where is the issue ?

Regards,
Lalit

Answer posted on Feb 25, 2009 23:42
Got this issue resolved.
There was error in accesing

        var ref_iframe = parent.document.getElementsByTagName('iframe')[0];

So I have used document.location.href to access the iframe

Thanks,
Lalit