ValueList method

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

ValueList method

Postby Robin.Lanneer » Tue Mar 28, 2017 11:35 am

Hello

I am trying to use a Type Ahead with a valuelist. I'm using the global method of the valuelist: getDataSetForValueList(displayValue, realValue, record, valueListName, findMode, rawDisplayValue)

According to the default implementation / documentation, there are three cases: real and display params both null, only display is specified and only real is specified.
I understand the first two cases, but i don't understand how the third case is supposed to work / how i'm supposed to implement it.
Where does the realValue come from? SInce the user can only type in the displayValue in the Type Ahead.
Robin.Lanneer
 
Posts: 4
Joined: Tue Mar 28, 2017 11:26 am

Re: ValueList method

Postby patrick » Tue Mar 28, 2017 12:27 pm

The real value might already be set in the field. This is the case when you simply navigate to a record (not editing that field) that has a real value set and want to resolve that.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: ValueList method

Postby Robin.Lanneer » Tue Mar 28, 2017 3:48 pm

thank you for the answer,
so the third case isn't really used with a type Ahead.
Robin.Lanneer
 
Posts: 4
Joined: Tue Mar 28, 2017 11:26 am

Re: ValueList method

Postby patrick » Tue Mar 28, 2017 6:37 pm

Yes it is! When you navigate to a record that has a real value stored your user wants to see the display value for that! But obviously you don't have to load a whole list, but only need to resolve that one value. Maybe I'm not explaining that well. Let me try to explain the 3 cases again:

1. Nothing is in the field and the user has not typed anything yet (displayValue = null, realValue = null)

-> You want to return the whole list (at least as much as possible) and show that when the list drops down

2. Your user starts typing (displayValue != null)

-> only used for type aheads obviously, you want to return a filtered list

3. You have a real value in the field and the list you might have returned earlier doesn't return that

-> you want to make sure your user sees the display value for that real value

One example. You are in record A, user starts typing "A" and you return a list with everything beginning with A. User selects something from the list and Servoy internally holds that filtered list with all items starting with "A". Now you browse to the next record which has a real value that resolves to "B_something". He is not editing or anything, just looking at the record. The last value list you provided had everything beginning with "A", but we need to show "B_something" now. So you run into case 3.

I hope this makes it clearer?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 10 guests