0

Zul incorrectly rendered when IE8 targets an application in the intranet zone

asked 2012-02-14 16:46:12 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I'm developing an application on zk5.0.10 to be accessed from IE8 browsers. The application's address is configured as an intranet local site, and sites in the intranet are configured (this is necessary in order to guarantee legacy applications get displayed correctly) to be displayed in the compatibility mode.

I've tried to enforce the IE8 mode by applying a filter that establishes an X-UA-Compatible http header as IE=8. This way, when I load my zul page, I open the developer tools and see <body class="ie ie8" onbeforeunload="">; org.zkoss.zk.ui.util.Clients.evalJavaScript( "alert(document.documentMode);" ); also yields 8.

My zul does not get correctly rendered, however. Here's the difference:

It should be displayed like this:

Any suggestion?

delete flag offensive retag edit

12 Replies

Sort by » oldest newest

answered 2012-02-23 09:44:05 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

my excuses for this late answer. I've been further researching into the subject and making sure what the real facts are.

If I switch IE8 to standard mode the page gets rendered correctly. If I activate the compatibility view it does not, even if I submit an http header telling ie what version should it apply. The same happens with IE9: if I enable the IE7 mode it will render it incorrectly, even if I apply a filter like this:

public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException {
        ( ( HttpServletResponse ) response ).setHeader( "X-UA-Compatible", "IE=edge" );
        chain.doFilter( request, response );
    }

and the document.documentMode I obtain by executing Clients.evalJavaScript( "alert( document.documentMode );" ); turns out to be 9 (in other words: the browser correctly detects and interprets the X-UA-Compatible http header).

This is the zul code I'm testing

<window>
    <listbox mold="paging" pageSize="5" rows="5" sizedByContent="false">
        <listhead id="listHead" sizable="true">
            <listheader label="Name" />
            <listheader label="Brand"/>
            <listheader label="Model" />
            <listheader label="Price" />
        </listhead>
    </listbox>
    <separator />
    <hlayout id="box">
        <label id="label0" value="You can also select by typing"/>
        <combobox autodrop="true" autocomplete="true" />
        <button label="Remove"/>
        <button label="Edit"/>
        <button label="Show document mode" onClick='org.zkoss.zk.ui.util.Clients.evalJavaScript( "alert( document.documentMode );" );' /> 
    </hlayout>
</window>

Please beware that when tested in the online zksandbox (which I guess is ZK6) the buttons at the bottom row also get rendered unaligned, although in a different way.

With kind regards

César Varona

link publish delete flag offensive edit

answered 2012-02-17 01:07:18 +0800

paowang gravatar image paowang
140 6

If you manually switch IE8 to standard mode, will it render correctly?
Can you provide some reproducible code such as zul ?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-02-14 16:46:12 +0800

Seen: 504 times

Last updated: Sep 23 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More