Thinking out loud some more... I think I found a cleaner way of doing all this. In your page:
<html> <head> <div wicket:id="not-ie">Prevent Dreamweaver from removing this DIV</div> <div wicket:id="ie">Prevent Dreamweaver from removing this DIV</div> ...
In your CSS panel:
<html xmlns:wicket>
<body>
<wicket:panel>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
@import url(not-ie.css);
/*]]>*/-->
</style>
</wicket:panel>
</body>
</html>Now we have perfectly valid HTML and it produces CSS and everyone is happy. I'm not sure whether one still needs to remove the tag from the Page (i.e. what happens when you have <div> inside <head>?) but I'll test it and let you know.
Gili
Gili wrote:
I guess what I am looking for is for Wicket to have a top-level class like border, panel, etc whose behavior is identical to panel with the exception that the original tag is replaced as well. Based upon that I can create two components of this type of border with two names:
b
only-ie
not-ie
The Page that includes these components would then decide at construction time (based upon the browser user-agent) what instance to bind them to. If IE is detected, then only-ie will bind to some CSS component. If IE is not detected, then only-ie will bind to an empty CSS component (the tag is replaced with empty string).
At least, that's one idea I had in mind. How would one create a Panel that replaces its original tag in the Page markup? Also it is important to note that the markup of this CSS component would be kinda ugly. It would be something like this:
<html xmlns:wicket> <body> <wicket:panel> @import url(not-ie.css); </wicket:panel> </body> </html>
It look a little ackward because you have this CSS statement within HTML code. Still, this is meant to be a workaround until Wicket 1.1 handles CSS formally. What do you think?
Gili
Gili wrote:
This is a common-place thing... I need to be able to detect the browser on the server-end and depending on what I see I send out different CSS URLs. So basically broken-assed explorer gets GIFs while FireFox gets translucent PNGs.
Thing is, I don't know of a good way to do this in Wicket. Here is my normal code:
<style type="text/css"> <!--/*--><![CDATA[/*><!--*/ @import url(common.css); @import url(not-ie.css); @import url(only-ie.css); /*]]>*/--> </style>
and as you can see, I want to selectively include or exclude not-ie.css and only-ie.css depending upon the browser user agent. Thing is, wicket expects HTML angled-bracket tags. That's nice and well but I can't go including this within a CSS <style> tag.
Ideally, what I am looking for is for Wicket to render the tag and in so doing remove the original tag. So for example:
<div wicket:id="only-ie">
would get completely replaced with some body. No angle brackets are left around. Is there an easy way to do all this? Any suggestions?
Keep in mind I'm doing all this hacking because we don't have formal CSS support in Wicket. As such, I expect a half-decent workaround approach in 1.0 -- am I wrong here?
Gili
------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/info/Sentarus/hamr30 _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
