Problem with type ahead and valuelist

Hi,
Im trying to attach a valuelist that returns an id to the dataprovider but displays a calc to a type ahead but its not working.
If i show a field instead of a calc it works just fine but this is no use to me cause that way i can only display 2 fiels and i need to show 4(which are returned by my calc as a string).
Are type aheads not compatible with this? am i doing something wrong? or is this a bug?

Im using servoy 5.1.1
Thanks.

nromeou,

If you use a type-ahead with different display/return value, Servoy will try to match what is typed by mapping the display back to the real value.
For example, if you have a type ahead on company_id which shows company_name, and the user types ‘ser’, there will be a query to find all company_names that start with ser.

This works with fields (or even combined fields), but it does not work with calculations because we don’t know how to query the underlying data.

Maybe you can use the value-list defined in global method (Servoy 5.1) to solve your issue.

Rob

nromeou:
Im trying to attach a valuelist that returns an id to the dataprovider but displays a calc to a type ahead but its not working.

I also noticed this. Strange things happen: the value appears two times in the valuelist, I attached the valuelist to a combobox. I’m going to submit a case for this.

And how does that work rob? what does the global method needs to do?

nromeou,

Create a value list, set the type to ‘global method’.
When you use the global method selection dialog, you can create one that is a template (use the ‘Create Global Method’ button).

Rob

michel:

nromeou:
Im trying to attach a valuelist that returns an id to the dataprovider but displays a calc to a type ahead but its not working.

I also noticed this. Strange things happen: the value appears two times in the valuelist, I attached the valuelist to a combobox. I’m going to submit a case for this.

Is this behavior in web client ?

This happens in Smart Client, did not check this in web client yet.

michel:
This happens in Smart Client, did not check this in web client yet.

hmm, how can to reproduce it then ? it works ok in simple example (non editable combo, displays a calc, returns another column: number of calcs displayed will be equal to number of rows in table and value is correct for each one); are you sure the calculation doesn’t return two identical values ?