2

I'm trying to implement:

Because the test server is defaulting IE8 to compatibility view.. Which is screwing up my layout.

Is there a special way to implement this with wicket?

Also, I do have javascript being ran so i don't know if this is interfering with it or not.

is set right after the tag and is the first thing before I've also tried it inside of still no luck.

eaglei22
  • 2,589
  • 1
  • 38
  • 53

1 Answers1

1

Just in case anyone ever runs into this problem while using wicket, I was able to fix this problem by overriding the headers of my parent page like so:

protected void setHeaders(WebResponse response) 
{  

    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate,
    no-store");
    response.setHeader("X-UA-Compatible", "IE=edge");
}

and this worked like a charm!

this -> response.setHeader("X-UA-Compatible", "IE=edge"); is what solved it.

eaglei22
  • 2,589
  • 1
  • 38
  • 53
  • I know this is old - I've a wicket screen within a larger application, the application forces IE8 compatibility, but my screen is angular, I need at least IE 10 compatibitlity. I tried adding a filter as suggested but the main HTML is overriding my filter. What did you do specificially? I think my problem is that my page is a child page within my parent page. thinking this is not possible. – notAChance Mar 09 '16 at 14:03
  • Hey sorry, I have since transferred jobs and now mostly use ASP.NET MVC 4 so I don't have access to the code this was for and I am rusty on Wicket, but it sounds like I just added that in the parent page code so if you have a child page then find out what the parent page is and just add it there. have you tried response.setHeader("X-UA-Compatible", "IE=10"); instead of using edge ? There is a full write up on what here: http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge – eaglei22 Mar 10 '16 at 13:31
  • Using edge didn't work for me with IE11 so I just did: which then worked. But that was with pure markup and Asp.Net not Wicket. – eaglei22 Mar 10 '16 at 13:33
  • Thanks for your reply! Problem is main page must use ie=8, as some older applications it hosts in their wicket pages need ie8 support. Main page meta tag overrides my html meta tag. With your knowledge, say I changed main page meta tag to - `` what effect would this have? – notAChance Mar 10 '16 at 14:14
  • By main page are you talking about the parent page or a specific main page in your application? When you render the page, try viewing the source to see what is actually happening. If the meta is being added twice I believe the last one added should be what is used. Based off of reading the stackoverflow topic I showed you it seems what you have will render IE 5, 6 and 7 as IE 5, IE8 as 8, IE 9 as 9, IE=10 and 11 as IE10. Why not just check dynamically what browser and version is being used and try setting the X-UA based off of that maybe? – eaglei22 Mar 10 '16 at 14:42
  • OK, my main page is an application, a menu system which hosts wicket screens. This "main" (parent) page's html dictates how the browser runs. so when my page which is hosted within a wicket page, which in turn is hosted in my menu system adds the meta tag, it's too late. the main page's meta tag has been read. On top of this, applications within my menu application need to run ie8, not higher. so i'm totally lost as to how to either run my wicket screen for that session in ie10 or > or somehow dynamically change the main pages meta tag each time an application is loaded throughthe mainpage – notAChance Mar 10 '16 at 15:28
  • Ah okay, I am still having trouble understanding this external application menu system, and how it hosts your Wicket Pages. You're probably better off posting in a separate post and asking your question there (if you haven't already) so you can add great detail as it seems more complex than my original issue. Also you may have luck posting on the Wicket Forums. I used that pretty often and they're all Wicket experts who respond, some even who help develop the framework or work Jira items. – eaglei22 Mar 10 '16 at 15:47