Nitobi
Customer Login
Services
Products
About
Blogs
Contact
Home -> Product Knowledgebase Order Online | Free Trial Downloads

Nitobi Product Knowledgebase

Understanding the Combo HTML Tag


This tutorial applies for Classic ASP, JSP, and PHP but not for ASP.NET. ASP.NET developers should see the ASP.NET tutorials instead.

The Nitobi Combobox is defined on the page by a custom tag that resembles other HTML tags you may be familiar with. Here is an example of a Combobox tag that is unbound:

<ntb:Combo id="myCombo" Mode="unbound">

 <ntb:ComboTextBox DataFieldIndex=0></ntb:ComboTextBox>

 <ntb:ComboList></ntb:ComboList>

 <ntb:ComboColumnDefinition DataFieldIndex=0>
 </ntb:ComboColumnDefinition>
 <ntb:ComboColumnDefinition DataFieldIndex=1>
 </ntb:ComboColumnDefinition>

     <ntb:ComboValues fields="City|Population">
         <ntb:ComboValue a="Vancouver" b="3,000,000" >
         </ntb:ComboValue>
         <ntb:ComboValue a="Toronto" b="4,500,000" >
         </ntb:ComboValue>
     </ntb:ComboValues>

</ntb:Combo>

The combo tag contains severall member objects like ComboTextBox and ComboList that each have their own properties. Not everything has to be defined every time - it depends on what you want out of your combo.


ntb:Combo Object

General Description:

The main tag that contains all other combo objects like ComboTextBox, ComboList, etc. This is a required tag.

Tag Example:

<ntb:Combo id="myCombo" Mode="unbound"></ntb:Combo>

Attributes:

AttributeDescriptionExpected Value(s)Required
CSSClassNameThe name of the CSS class to associate with the entire combo box. stringNo
DataTextFieldThe name of the field in the dataset that provides text for the list to display. Use this if you only want one column, and you don"t want to use the ListColumnDefinition tag. stringNo
DataValueFieldThe name of the field in the dataset that provides data for the list. Use this if you only want one column, and you don"t want to use the ListColumnDefinition tag. stringNo
EnabledSpecifies whether the combo is enabled for user interaction. booleanNo
HeightThe height of the combo in html units, e.g. 100px or 100%.stringNo
InitialSearchDefines the initial value to "select" from the dataset, in bound search modes.stringNo
ListZIndexSpecifies the order of combo lists on the page along the Z axis.numericNo
ModeSpecifies the search mode of this combo. "classic", "compact", "filter", "smartlist", "smartsearch", "unbound"Yes
OnBeforeSelectEventSpecifies the function that is called when the user makes a selection but before any action has been taken in response to this. stringNo
OnBlurEventSpecifies the function called when the textbox of the combo loses focus. stringNo
OnFocusEventThe name of the function (as a string - i.e. "OnFocusEvent()" - note the brackets) that is called when the textbox of the combo again focus. stringNo
OnSelectEventSpecifies the function called when the user makes selects an item within the combobox. stringNo
OnTabEventThe handler for the event triggered when the user tabs outside of the combo. stringNo
SmartListSeparatorDefines the character used to separate selected list records, in SmartList mode. Default value is "," (comma). characterNo
TabIndexSpecifies the HTML tab index of the combo box. numericNo
WidthThe width of the combo in html units, e.g. 100px or 100%.stringNo

ntb:ComboTextBox Object

General Description

Defines specifically the textbox element of the combo. This is a required tag.

Tag Example:

 <ntb:ComboTextBox Width="200px" DataFieldIndex=0> </ntb:ComboTextBox>

Attributes:

AttributeDescriptionExpected Value(s)Required
CSSClassNameThe name of the CSS class that defines the textbox portion of the combobox. stringNo
DataFieldIndexThe column that is used as a datasource for the textbox. When the user types in the textbox, the combo will search this column for a match. Similarly, when the user clicks a row, the column"s value will be entered into the textbox. numericYes
EditableSpecifies whether the textbox is able to be modified by the user. True, if the textbox is editable and false otherwise. booleanNo
HeightThe height of the text box. It can be in % or px, e.g., 100px or 90%. numericNo
OnEditKeyUpEventSpecifies the function called upon release of a pressed key.stringNo
ValueDefines a value to be placed inside the textbox. stringNo
WidthThe width of the text box. It can be in % or px, e.g., 100px or 90%. numericNo

ntb:ComboList Object

Description:

The tag that describes the list element. This is a required tag for all modes except the compact mode.

Tag Example:

 <ntb:ComboList></ntb:ComboList>

Attributes:

AttributeDescriptionExpected Value(s)Required
AllowPagingIf set to true, the list supports large database access. It will get one page at a time. You must also set PageSize if you want to use this feature. booleanNo
BackgroundHighlightColorAn HTML color that changes the background of a row when highlighted, e.g., #FFFFFF or red, etc. You can also use HighlightCSSClassName for more control but setting only the color yields better performance. hex tripletNo
ClipLengthLength of clipping used in SmartList, SmartSearch and Filter modes. numericNo
CustomHTMLHeaderOptional. Specify a custom HTML definition for the list header. If this is used, the HeaderLabels from the ListColumnDefinition tag will not be used. stringNo
DatasourceUrlA URL to a page that returns compressed XML. This is used for populated the ComboBox as well as for paging and lookup. The page is given the following arguments: StartingRecordIndex - The next record in the data subset that the combo wants. PageSize - Size of the page. SearchSubstring - [Optional] The string the user is looking for. ComboId - The Id of the combo making the request. stringYes
ForegroundHighlightColorAn HTML color that specifies the foreground (text) of a row when highlighted, e. g. #FFFFFF or red, etc. You can also use HighlightCSSClassName for more control but setting only the color yields better performance. hex tripletNo
HeightThe height of the list body. This must be an HTML measurement, e.g., 100px. numericNo
HighlightCSSClassNameThe CSS style applied to the row when the user highlights it. You can also use BackgroundHighlightColor for better performance. stringNo
ListColumnDefinitionsThe objects that define how the list columns look and behave. Not used if CustomHTMLDefinition is used. stringNo
OffsetXDEPRECATED. Used to correct HTML glitches in the placement of the list. The number of pixels to move the list in the x direction. numericNo
OffsetYDEPRECATED. Used to correct HTML glitches in the placement of the list. The number of pixels to move the list in the y direction. numericNo
OnAfterSearchEventThe handler for the event that occurs after the combobox is searched (due to the user typing in something into the textbox). This string should be a JavaScript function, e.g. "OnAfterSearchEvent()". Note the brackets. stringNo
OnBeforeSearchEventThe handler for the event that occurs before the combobox is searched (due to the user typing in something into the textbox). This string should be a JavaScript function, e.g. "OnBeforeSearchEvent()". Note the brackets. stringNo
OnHideEventThe handler for the event that occurs when the list is hidden. This string should be a JavaScript function, e.g. SetOnHideEvent("OnHide()"). Note the brackets. If you want you can also return the List object by using SetOnHideEvent("OnHide(this)"). stringNo
OnShowEventThe handler for the event that occurs when the list is shown. This string should be a JavaScript function, with the () brackets. If you want you can also return the List object by using SetOnShowEvent("OnShow(this)"). stringNo
PageSizeUsed with paging. The number of records retrieved at a time. Only used if AllowPaging is set to true. numericNo
WidthThe width of the list in either pixels or percent. numericNo

ntb:ComboColumnDefinition Object

Description:

Defines specific columns inside the list. These tags are not required but are recommended.

Tag Example:

<ntb:ComboColumnDefinition Width="100px" DataFieldIndex=0></ntb:ComboColumnDefinition>

Attributes:

AttributeDescriptionExpected Value(s)Required
AlignAlignment of text in this column. "left", "right", "center"No
ColumnTypeThe type of the column. It can be one of TEXT or IMAGE. If IMAGE is used, you must also specify the ImageHandlerURL property. stringNo
CSSClassNameThe name of the CSS class that defines the style for this column. stringNo
DataFieldIndexThe index of the data field that populates this column. If you leave this field empty, it will use the ordinal position of the ListColumnDefinition within the List.ListColumnDefinitions collection. numericYes
HeaderLabelThe string displayed as the column header in the list. stringNo
HTMLPrefixHTML code that will be added before the column value. stringNo
HTMLSuffixHTML code that will be added after the column value. stringNo
ImageHandlerURLIf the ColumnType is IMAGE this property must be specfied. It contains the URL of a page that will serve up an image given an argument. That is, the database column will contain image identifiers; this identifier will be used as an argument to the page, e.g. if the URL is http://localhost/ImageServer.aspx?YourArgs=Arg, then combo will call it as follows http://localhost/ImageServer. aspx?YourArgs=Arg&Image=DataFromColumn. It will expect a binary image to be written out by the page. stringNo
TextColorColor of the text in this column. hex tripletNo
WidthThe width of the column. This can be an absolute pixel value, e.g., 15px or a percentage of the list width, e.g., 50%. numericNo

ntb:ComboValues Object

Description:

In unbound mode, you can define a data island much like you would with an HTML listbox. The ComboValues tag can contain records as ntb:ComboValue. See below for an example.

Tag Example:

<ntb:ComboValues fields="City|Population">
  <ntb:ComboValue a="Vancouver" b="3,000,000" >
  </ntb:ComboValue>
  <ntb:ComboValue a="Toronto" b="4,500,000" >
  </ntb:ComboValue>
</ntb:ComboValues>

Attributes:

 fieldsDefines the data columns seperated by "|". In the ntb:ComboValue tags these are references by alphabetical labels. The first column (in the above example "City") is "a". The 2nd column ("Population") is "b". Required.

Related Articles

View Printable Version

Comments:


Name:

Type the text you see above:

Comments:


Knowledgebase

To be notified of new articles when they're available, subscribe to our RSS feed.

Support Resources

Take advantage of our knowledgebase of product tutorials and tips, and our support forums!

Search Site


Sign up for our Newsletter:

Get industry articles and Nitobi company news in your inbox every couple of months — here's a sample!

Email:




Site RSS Feed  | All contents are (c) Copyright 2006, Nitobi Software Inc. All rights Reserved