[Carbon-dev] Tool tip script
Dinusha Senanayaka
dinusha at wso2.com
Sun Mar 6 22:51:41 PST 2011
Hi,
I did some modifications to this tag library. When JSP page is using a
common resource bundle, tool tip tag library modified to take that resource
bundle.
To use that in JSP,
<carbon:tooltips image="images/help.gif"
key='dataservices.enableboxcarring.help' > </carbon:tooltips>
This will take the common resource bundle define in JSP.
If need to define a resource bundle other than the common bundle use in JSP
page,
<carbon:tooltips image="images/help.gif"
resourceBundle='org.wso2.carbon.dataservices.ui.i18n.Resourc'
key='dataservices.task.interval.cannotfound.msg' > </carbon:tooltips>
Regards,
Dinusha.
On Sun, Feb 27, 2011 at 2:14 PM, Dinusha Senanayaka <dinusha at wso2.com>wrote:
> Hi,
>
> I wrapped the above tool tip Java Script as a Tag Library and going to add
> as a carbon tag in the Carbon UI Core bundle.
>
> This is the tld for this tag library.
>
> <tag>
> <name>tooltips</name>
> <tagclass>org.wso2.carbon.ui.taglibs.TooltipsGenerator</tagclass>
> <bodycontent>JSP</bodycontent>
> <info>A tag for displaying tool tip</info>
> <attribute>
> <name>image</name>
> <required>true</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> <attribute>
> <name>description</name>
> <required>false</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> <attribute>
> <name>resourceBundle</name>
> <required>false</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> <attribute>
> <name>key</name>
> <required>false</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> <attribute>
> <name>noOfWordsPerLine</name>
> <required>false</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> </tag>
>
>
> Attributes taken in tag :
>
> - image - this attribute take the image that tool tip should appear
> when mouse over it.
> - description - this is the tool tip content. This should provide only
> when content is taken as user text without taking from resource bundle.
> - resourceBundle - resource bundle name. eg:
> org.wso2.carbon.dataservices.ui.i18n.Resources. This should provide only
> when tool tip content is reading from a resource file.
> - key - element in resource file to take tool tip content. eg:
> dataservices.enableboxcarring.help. This also provide only when tool tip
> content is reading from a resource file.
> - noOfWordsPerLine - you can adjust the size of tool tip box by giving
> no of words that should contain in a single line. optional attribute.
> default set to 10.
>
>
> This is how this tag library can use in a jsp file :
>
> 1. When the tool tip content is taken from a resource bundle .
>
> <carbon:tooltips image="images/registry_picker.gif"
> resourceBundle='org.wso2.carbon.dataservices.ui.i18n.Resources'
> key='dataservices.enableboxcarring.help' '> </carbon:tooltips>
>
>
> 2. When the tool tip content is taken as text input without taking from
> resource file.
>
> <carbon:tooltips image="images/registry_picker.gif" description=' This is
> the tool tip body content ' >
>
>
> Regards,
> Dinusha.
>
>
>
>
>
>
>
>
>
> On Tue, Feb 22, 2011 at 6:09 PM, Chanaka Jayasena <chanaka at wso2.com>wrote:
>
>> Hi all,
>>
>> I created a simple tool tip script to fulfil a requirement to show an
>> image as a tool tip. I commit the script to Carbon UI Core bundle. It use
>> YUI panel to display the tool tip.
>>
>> This is how you can use it in a carbon ui bundle.
>>
>> 1 - Include following js,css library files which are in the core ui.
>>
>> <link rel="stylesheet" type="text/css"
>> href="../yui/build/container/assets/skins/sam/container.css">
>>
>> <script type="text/javascript"
>> src="../yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
>> <script type="text/javascript"
>> src="../yui/build/container/container-min.js"></script>
>> <script type="text/javascript"
>> src="../yui/build/element/element-min.js"></script>
>> <script type="text/javascript" src="../admin/js/widgets.js"></script>
>>
>>
>> 2 - Define the mouseover event listener.
>>
>> <a href="#" onmouseover="showTooltip(this,'tool tip text')" />Mouse Over
>> This Text</a>
>>
>> thanks,
>> Chanaka
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> Carbon-dev at wso2.org
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.wso2.org/pipermail/carbon-dev/attachments/20110307/7c7f1299/attachment-0001.htm>
More information about the Carbon-dev
mailing list