I just finished more advanced browser/ client capabilities detection. If anyone wants to take a look at it, I added an example in wicket-examples called HelloBrowser. It uses Javascript to detect browser properties, but it has a fallback in case javascript is not supported (e.g. because of security settings.
Eelco On 12/5/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > Hi, > > The wicket:head tag exists for a different reason. You can use it when > you create custom components, such as the datapicker, that use css/ > javascript to function. You want to reuse these components on your > pages without having to know what dependencies your page needs. If you > use wicket:head in your component panels, its content will be > 'contirbuted' to the current page's head. > > I your case, you want to vary the css tag based on some input, right? > That's pretty easy actually. Just add a WebComponent to your page, and > attach an AttributeModifier to it that replaces the href with the > right thing. Like: > > html: > > <link wicket:id="mycss" rel="Stylesheet" type="text/css" > href="styles/main.css"/> > > java: > > WebComponent c = new WebComponent("mycss"); > IModel model = new Model() { > getObject(Component c) { > if (x) return "stylesheetx.css"; else return "stylesheety.css"; > } > } > c.add(new AttributeModifier("href", model); > add(c); > > Btw, if you are working on HEAD, there's a basic, user-agent based > browser detection in there, and I am currently finishing some more > advanced browser capabilities detection. > > Eelco > > > On 12/5/05, David Leangen <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I apologise for asking a question that may seem so basic to more > > experienced Wicketeers and that has been asked over and over. > > > > I read the docs and searched the archive. Although the topic is indeed > > discussed, there was not enough information (or perhaps just not stated > > in a way that I could understand) to allow me to figure out what's going > > with CSS. Actually, I'm also having a bit of trouble in terms of tags. > > > > My goal is to have a different css page depending on the l10n, client > > type, or perhaps other requirements. This is my border: > > > > <?xml version="1.0"?> > > <html xmlns="http://www.w3.org/1999/xhtml" > > xmlns:wicket="http://wicket.sourceforge.net/" xml:lang="en" lang="en"> > > <wicket:head> > > <title>Page Title</title> > > <link wicket:id="css" rel="Stylesheet" type="text/css" > > href="styles/main.css"/> > > <script language="javascript" type="text/javascript" > > src="scripts/page.js"></script> > > </wicket:head> > > <body> > > <wicket:border> > > > > <wicket:body/> > > > > </wicket:border> > > </body> > > </html> > > > > > > Pretty basic, I think. However, where and how would I make the change > > for the CSS. Where and how is the <wicket:head> tag handled? I suppose > > that it is in this handler that <link wicked:id=""> is handled... > > > > > > In order for me to better understand how tags are handled, could > > somebody please point me to the relevant classes, so I can take a look > > at the code directly? > > > > If I can, I'll try to add useful info to the wiki. > > > > > > Thanks so much! > > Dave > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > _______________________________________________ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user