logo-radria.gif
   
Blog Download Documentation Forum Tasks Home
Blog Download Documentation Forum Tasks Home
barside-right.gif
barside-left.gif
logo-sql.gif





FieldType Text Suggest

It displays a text field and as the user types in the field it retrieves a list of suggestion.

Requirement

You will need to install the following package:

   field_text_suggest

We suggest you use the WebIDE to setup the field type to a Registry or Table.

Suggested data

The data suggested are coming from a Saved SQL Query.

When you add the Text Suggest field type to a Registry or a Table field it will require you to provide Saved SQL Query.

In the WebIDE create the query with the *[suggest_search]* that will be replaced by the user suggestion.

For example:

SELECT category FROM product
  WHERE category LIKE '%[suggest_search]%'

In this example we have added a field type Suggest to the category field of the product table. When the user begins typing and pauses it then runs this query with the typed string replacing the [suggest_search] and returns the selected category

The query should return only one column and the [suggest_search] contains the user input.

Registry Source

Sample registry source code:

  <rfield name="category">
    <rdata type="databasetype">varchar</rdata>
    <rdata type="default"></rdata>
    <rdata type="label">This is the test suggest</rdata>
    <rdata type="saved_query">suggest_query</rdata>
    <rdata type="num_line">10</rdata>
    <rdata type="width">30</rdata>
    <rdata type="max_size">80</rdata>
    <rdata type="fieldtype">FieldTypeTextSuggest</rdata>
  </rfield>
 
package/fieldtype/fieldtype_text_suggest.txt · Last modified: 2007/10/24 10:16 by 76.169.240.49
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki