struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Lea <ja...@kumachan.net.nz>
Subject Re: [OT] off topic, but I have a quick JavaScript question please...
Date Fri, 26 Sep 2003 21:14:14 GMT
If you are not worried about older browsers there is another way to get 
tooltips without using JavaScript.  Browsers with good HTML4.01 support 
will display 'title' attributes as tooltips.  Form tags (and lots of 
other tags in HTML 4.01) allow you to specify a title.

If you use Struts tags you can use 'titleKey' to look up the key from 
the message bundle...  eg

<html:text property="name" titleKey="tooltip.title.name"/>


Mick Knutson wrote:
> It just makes my code much cleaner inside my function. But I do understand
> the way you described.
> 
> Thanks
> 
> ---
> Thanks
> Mick Knutson
> http://www.baselogic.com
> 
> +001(805) 563-0666 Office
> +001 (708) 570-2772 Fax
> ---
> 
> ----- Original Message ----- 
> From: "Daniel Smeltzer" <Daniel@saminvestments.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Friday, September 26, 2003 9:06 AM
> Subject: RE: [OT] off topic, but I have a quick JavaScript question
> please...
> 
> 
> Well, the <bean:message> tag would need to be where the function is
> called, not where it is defined.  The struts tags will execute on the
> server side and the JavaScript executes on the client side.  When the
> JavaScript runs, all the struts tags will have been executed and
> converted into text.  So, you'd need something like:
> 
> function tooltip(message) {
> return overlib(message, STICKY, CAPTION, message, CENTER);
> }
> 
> 
> And somewhere else:
> 
> ... onMouseOver="return tooltip('<bean:message key="tooltip_key"
> bundle="TOOLTIP_RESOURCES_KEY"/>')" ...
> 
> 
> Daniel
> 
> -----Original Message-----
> From: Mick Knutson [mailto:mickknutson@hotmail.com]
> Sent: Friday, September 26, 2003 10:59 AM
> To: Struts Users Mailing List
> Subject: Re: [OT] off topic, but I have a quick JavaScript question
> please...
> 
> 
> Thank you, but now another issue:
> 
> How do I dynamically use that argument in my <bean:message>???
> 
>         function tooltip( tooltip_key )
>         {
>             return overlib(  '<bean:message key="tooltip_key"
> bundle="TOOLTIP_RESOURCES_KEY" />'
>                             , STICKY, CAPTION
>                             , '<bean:message key=" +tooltip_key + "
> bundle="TOOLTIP_RESOURCES_KEY" />'
>                             , CENTER
>                           );
>         }
> 
> 
> ---
> Thanks
> Mick Knutson
> http://www.baselogic.com
> 
> +001(805) 563-0666 Office
> +001 (708) 570-2772 Fax
> ---
> 
> ----- Original Message ----- 
> From: "Daniel Smeltzer" <Daniel@saminvestments.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Friday, September 26, 2003 8:52 AM
> Subject: RE: [OT] off topic, but I have a quick JavaScript question
> please...
> 
> 
> In your function definition, just declare the input parameters and use
> those names to refer to them, i.e.:
> 
> Function tooltips(message, title) {
>   // now the input parameters are available as message and title }
> 
> Daniel
> 
> -----Original Message-----
> From: Mick Knutson [mailto:mickknutson@hotmail.com]
> Sent: Friday, September 26, 2003 10:50 AM
> To: struts
> Subject: [OT] off topic, but I have a quick JavaScript question
> please...
> 
> 
> I have a function "function tooltips()" and the call to that function is
> "return tooltip('tooltip.msg.name', 'tooltip.title.name');"
> 
> in my function, how do I access each of the arguments? Is it something
> like args[0], and args[1]?
> 
> ---
> Thanks
> Mick Knutson
> http://www.baselogic.com
> 
> +001(805) 563-0666 Office
> +001 (708) 570-2772 Fax
> ---


-- 
Jason Lea


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message