Hello,

in my OL-application I display HTML in two tabpanes. In Firefox (DHTML
runtime) it almost works perfectly. But in IE 7 (DHTML runtime) the
application does not start at all.

Does anyone of you have an idea why the application does not start with IE 7
(DHTMl runtime)?

Kind Regards,
Marc

------------

This is the code:

<canvas debug="true" >
        <class name="HTMLViews"  
                extends="view" bgcolor="#DDDDDD" width="${parent.width-300}"
height="${parent.height-40}">
                
                <attribute name="HTML1" type="string" value="" />
                <attribute name="HTML2" type="string" value="" />
                
                <attribute name="_jsflag" value="false" type="boolean" />
        
                <method name="_setIframeContent" args="iframeID, content"
><![CDATA[
                        Debug.write("content="+content);
                        if (!this._jsflag) {
                                var js = "document.__seticontent = function
(id, s) {"
                                        + "var
fr=document.getElementById(id);"
                                        + "if (!lz.embed.browser['isIE']) fr
= fr.contentWindow;"
                                        + "fr.document.body.innerHTML=s;}";
                                LzBrowser.loadJS(js);
                                this._jsflag = true;
                        }
                        LzBrowser.callJS("document.__seticontent", false,
iframeID, content);
                        ]]>     
                </method>
        
                <method name="setTexts" args="myHTML1,myHTML2"><![CDATA[
                
                try {
                        /* set HTML1 */
                        HTML1 = myHTML1;
                        Debug.write("HTML1="+HTML1);
                        var theiframeID =
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.iframeid;
                        this._setIframeContent(theiframeID, HTML1);
        
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.__updatepos();
                        
                        /* set HTML2 */
                        HTML2 = myHTML2;
                        Debug.write("HTML2="+HTML2);
                        var theiframeID =
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.iframeid;
                        this._setIframeContent(theiframeID, HTML2);
        
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.__updatepos();

                        
                } catch (e) {
                        alert(e);
                }
                ]]>
                </method>
        
                <method name="changeVisibility"><![CDATA[
                        if (parent.visible==true) {
                                parent.setVisible(false);
                                // work-around for flash, so that the the
edittext field is clickable
        
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.setAttribute('visible',fa
lse);
        
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.init();
        
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.setAttribute('visible',fa
lse);
        
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.init();
                        } else {
                                parent.setVisible(true);
                                // work-around for flash, so that the the
edittext field is clickable
        
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.setAttribute('visible',tr
ue);
        
this.tabs.HTMLTabs.HTML1Tabpane.myInnerView.myText.init();
        
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.setAttribute('visible',tr
ue);
        
this.tabs.HTMLTabs.HTML2Tabpane.myInnerView.myText.init();
                        }
                ]]>
                </method>
                
                <view name="tabs" height="${parent.height}"
width="${parent.width}" x="300">
                        <tabs name="HTMLTabs" y="2" x="0"
_contentWidth="${parent.width-20}"
                                  _contentHeight="${parent.height-35}"
visible="true">
        
                                <!-- HTML1Tabpane -->
                                <tabpane name="HTML1Tabpane"
bgcolor="#ffffff" text="HTML1"
                                width="${parent.width}"
height="${parent.height-30}">
        
                                        <view name="myInnerView" x="5" y="0"
width="${parent.width-15}" height="${parent.height-7}">
                                                <html name="myText"
width="${parent.width}" height="${parent.height}" scrollbars="true"
visible="true" />
                                        </view>
                                </tabpane>
        
                                <!-- HTML2Tabpane -->
                                <tabpane name="HTML2Tabpane"
bgcolor="#ffffff" text="HTML2"
                                width="${parent.width}"
height="${parent.height-30}">
                                        
                                        <view name="myInnerView" x="5" y="5"
width="${parent.width-15}" height="${parent.height-12}">
                                                <html name="myText"
width="${parent.width}" height="${parent.height}" scrollbars="true"
visible="true" />
                                        </view>
                                </tabpane>
                        </tabs>
                </view>
        </class>

        <!-- MAIN VIEW -->
        <view name="mainView" width="900" height="650">
                <button x="10" y="10">switch Visibility of HTMLViews
                        <handler name="onclick">
                                Debug.write("switch clicked");
        
parent.myView.myHTMLViews.changeVisibility();
                        </handler>              
                </button>
                <button x="215" y="10">fill Text
                        <handler name="onclick"><![CDATA[
                                Debug.write("set Text clicked");
        
parent.myView.myHTMLViews.setTexts("<html><body>This is HTML text
1.</body></html>",
                                        "<html><body>This is HTML text
2.</body></html>");
                        ]]>
                        </handler>              
                </button>
                <button x="300" y="10">clear Text
                        <handler name="onclick">
                                Debug.write("clear Text clicked");
                                parent.myView.myHTMLViews.setTexts("","");
                        </handler>              
                </button>
                <text x="400" y="150">I hope you can edit this edittext
field!</text>
                <edittext x="400" y="180" width="200"/>
                <view name="myView" x="50" y="50" width="700" height="700"
bgcolor="#BBBBBB">
                        <HTMLViews name="myHTMLViews"/>
                </view>
        </view>
</canvas>


Reply via email to