Custom combo box taglib ver. 1.4

    Custom JSP taglib for UI development. This taglib lets you create a customized combo box. You can use your any HTML (JSP) code describing your options. For example here we will add tooltips to the options:
 


<%@ taglib uri="taglib.tld" prefix="s" %>

<s:ComboBox name="b" height="18px" style="font-size:12px" listBackground="#FFFFF0">
  <s:option value="1" title="Option number one"><i>Option 1</i></s:option>
  <s:option value="2" title="Option number two" selected="true"><b>Option 2</b></s:option>
</s:ComboBox>

and you will get some like this

Option 2

and here we are adding images to our options:
 


<s:ComboBox name="a" height="18px" style="font-size:12px" listBackground="#FFFFF0">
  <s:option value="1" title="Option number one"><img src="HomeOn.gif" border="0" height="12px"> Option 1</s:option>
  <s:option value="2" title="Option number two"><img src="HomeOff.gif" border="0" height="12px"> Option 2</s:option>
</s:ComboBox>

and you will get some like this:

Option 1

You have to use this tag inside of HTML form (or form taglib from Coldtags suite).

Note: the evaluation version supports up to 5 predefined values.

Tags are:

ComboBox

Body tag provides a combo box control. Parameters are:

1) name Describes a name for your input tag
2) id Optional parameter. Describes a DHTML id for the selected option.
3) className Optional parameter. Describes a CSS class for the selected option
4) style Optional parameter. Describes your own CSS style.
5) width Optional parameter. Describes a width for the selected option. Default value is 150px
6) height Optional parameter. Describes a height for the selected option. Default value is 12px
7) borderWidth Optional parameter. Describes a width for the border around the selected option. Default value is 1px.
8) borderColor Optional parameter. Describes a color for the border around the selected option. Default value is black.
9) background Optional parameter. Describes a background for the selected option.
10) listBorderWidth Optional parameter. Describes a width for the border in your list. Default value is 1px.
11) listBorderColor Optional parameter. Describes a color for list's border. Default value is black.
12) listWidth Optional parameter. Describes a width for your list. Default value is 150px.
13) listHeight Optional parameter. Describes a height for your list. Default value is 80px.
14) listBackground Optional parameter. Describes a background for your list.
15) listClassName Optional parameter. Describes a CSS class for your list.
16) disabled Optional parameter. Possible values are true or false. If this value is true than combo box is in the read-only mode. Default value is false.
17) onChange Optional parameter. Describes your own JavaScript code for the selection event
18) img Optional parameter. Describes a path for your image. Default value is downButton.jpg.

option

Body tag lets you define an option for your combo box. Parameters are:

1) value Describes a value for this option.
2) title Optional parameter. Describes a tooltip for this option.
3) selected Optional parameter. Possible values are true or false. If this value if true than this option is selected. Default values is false.
4) style Optional parameter. Describes your own CSS style.
5) className Optional parameter. Describes your own CSS class for this option
6) cond Optional parameter. Describes a boolean value tag's behavior depends on. Default value is true (add option)

for downloading:

Library: ccombotag.jar    Description: taglib.tld
Default image: downButton.jpg

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: