Re: [Wicket-user] Basic CSS and tags

2005-12-06 Thread Eelco Hillenius
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
  titlePage 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=7637alloc_id=16865op=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_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] Basic CSS and tags

2005-12-06 Thread David Leangen

I LOVE this community!

Always get great replies, even for simple things. Thanks!

Comments inline.


  My goal is to have a different css page depending on the l10n,
  client type, or perhaps other requirements. This is my border:



 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.


Thanks for this. This explanation really helped me to understand the meaning
of the wicket:head tag and how I can use normal links to css pages for
viewing without contributing them to the page model. Nice! I'm also getting
closer and closer to getting the simplicity of Wicket. Very cool!


 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.

Ok, thank you!

I'll add this to the wiki to try to make it a bit clearer for others, too.


 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.

Excellent! I will most certainly give this a try.


Thanks again!


BTW, sorry if this mail does not properly follow the thread order. I missed
a few mails because my mail server was down.




---
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=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] Basic CSS and tags

2005-12-06 Thread David Leangen

 I'll add this to the wiki to try to make it a bit clearer 
 for others, too.

Updated the wiki. 

  http://www.wicket-wiki.org.uk/wiki/index.php/JavaScript


Would be great if others could verify the accuracy of the contents.


Cheers,
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=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user