Auto-complete

A place for users and developers of the Xataface to discuss and receive support.

Auto-complete

Postby rwzhao » Mon Sep 01, 2008 10:09 pm

Hello!

Searched the forum and could not find a tutorial for auto-complete input. Any hints, it will be very helpful.

Thanks.
rwzhao
 
Posts: 14
Joined: Mon Sep 01, 2008 10:04 pm

Postby shannah » Tue Sep 02, 2008 12:13 am

It works the same way a select widget works. There are two types of autocomplete widgets.

1. autocomplete
This is just a text field that tries to autocomplete what you are typing based on a valuelist. It doesn't provide a drop-down list of options.

2. yui_autocomplete
This is the YUI autocomplete widget. It provides a drop-down list of options for autocomplete.

e.g.
Code: Select all
[myfield]
    widget:type=autocomplete
    vocabulary=myvaluelist



or

Code: Select all
[myfield]
    widget:type=yui_autocomplete
    vocabulary=myvaluelist


This page may also be helpful http://xataface.com/wiki/widget%3Atype

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Auto-complete

Postby rwzhao » Tue Sep 02, 2008 4:09 pm

Thanks. Steve.

Thanks for your link.

On the data input, the input field is INT and the autocomplete field lookup is based on VAR field. I was able to get auto-complete VAR value into INT field. But I need INT value to be submitted to the Database. How can I do it. Here is what I have:

fields.ini contains:

[pol]
widget:type = yui_autocomplete
vocabulary = pols

valuelists.ini contains:

[pols]
__sql__ = "SELECT p_id, port_name FROM ports ORDER BY port_name"

I need p_id value to be into filed pol. Now I can only put port_name value there.

Any suggestion?

-Richard
rwzhao
 
Posts: 14
Joined: Mon Sep 01, 2008 10:04 pm

Postby shannah » Tue Sep 02, 2008 6:13 pm

Ah yes... unfortunately the autocomplete widgets don't currently support having different display and storage values.

Your pretty much stuck with a standard select widget unless you want to rig up your own concoction.

Best regards

Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 25 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved