Drop down Combo box - displayCollection

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Drop down Combo box - displayCollection

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Anonymous >> Wed, 5 Jul 2006 10:15:55 GMT

Hi,

I'm new to jade and I'm developing a new form on our Credit Control system to maintain various items of Customer information.
The users need a list from which to select the required Customer Account by Customer name.

I have this working using the listCollection & displayEntry methods however it is a little slow, due to the size of our Customer file, when initializing and adding new Customers.
It has been suggested that if I use the displayCollection & displayRow methods the speed may be improved. However I then lose the ability to type a character into the combo box ie 'L' and have the list move to the Customers whose name starts with an 'L' listed.
Apparently this can be overcome using the scrolled method on the combo box but I honestly don't know where to start.

If anyone has come accross this problem before or can point me in the right direction I would be most grateful.

Thanks,

Stu Good
Selwood Group Ltd.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Drop down Combo box - displayCollection

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Torrie >> Wed, 5 Jul 2006 23:49:18 GMT

The reason that the typing does not locate the customer is because of the way the items have been loaded into the combo box. With the displayCollection method only enough items to fill the visible portion of the list are loaded (for a combo box this is 7.) This is why the displayCollection is much faster than listCollection. ListCollection loads all the items into the combo box (for which displayEntry returns a value.

Using the drop down styles will find the items loaded in the list. For displayCollection this is only the 7 items displayed, where with listCollection this is any item in the collection.

You will need to add some code to find the other items. For example you could use the key down or change events on the list box to locate the relevant entry. For example

comboBox4_change(combobox: ComboBox input) updating;

vars
sText : String;begin

sText := combobox.text.toUpper;
if sText <> null then
if combobox.listObject = null or combobox.listObject.CodeType.description[ 1 : sText.length ].toUpper <> sText then
combobox.listObject := combobox.getCollection.MemberKeyDictionary.getAtKeyGeq( combobox.text );
endif;
endif;
end;

Note that this code will run every time the user changes the text in the combo box so it won't work very well over networks with a lot of latency.

We often use a text box with a search button above a table to find items in large collections. You can make the search button default so that the user only has to type some text and then press enter to locate the entry. You also get multiple columns to display data.

hope that helps

Torrie


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 34 guests