This article is relevant for Classic ASP, PHP, and JSP users. ASP.NET users should read this article instead (although the principal is the same).
There are two steps to defining a datasource with Combo.
Set up the HTML combo tag to specify your datasource.
Specify a data handler (AKA getHandler).
Set up the HTML Combo Tag for your Datasource
In the HTML page containing your Combobox, you need to write out the tag with the search mode, the datasource, and a few other details. The combo tag is described in more detail in another article.
The first thing to do is set what search mode you are using. These are Filter, Classic, SmartSearch, SmartList, and Unbound. Only Unbound does not require a seperate datasource. You do this in the top-level Combo tag.
Next, you define your list object and the attribute DatasourceUrl, which is your remote datasource (or getHandler). This is similar to the getHandler in the Nitobi Grid Control.
eg:
Specify a Data Handler (getHandler)
Typically a getHandler is a seperate file that does the database connection, and outputs a raw XML stream which is read by the combobox. The EBA combobox does a background HTTP request to this page and expects to see this XML page. If it doesn't, your combobox will be empty, or you will see "undefined" in the list.
Unbound Mode
In unbound mode you don"t specify a getHandler. You merely contain your values inside the combobox tag as you would with a regular Listbox control.
eg:
This unbound combobox has two columns and no column labels. In unbound mode the list values follow an XML convention a,b,c,d, .. etc. The Fields attribute must be defined, which give labels to each data column. For those unfamiliar with XML, in this example, City is column a, and Population is column b.
If you would like to know more about using Combo with unbound data, there is another article in this knowledgebase under developement which covers it.
For these modes, we must define a URL that specifies where to retrieve XML from. This getHandler should respond to certain querystring variables. See the article entitled "Constructing SQL Queries for Web Combo V3" for a full description of these parameters.
If our getHandler is get.asp, and our desired search mode was Classic, our combo tag might look like this:
In this example we have two columns and have set our getHandler to "get.asp" and our page size (the number of records to retrieve at a time) to 12.
For information on how to construct a getHandler, follow the links at the bottom of this article.