Page 1 of 1

Combo Box Limitation

Posted: Tue Apr 22, 2014 8:17 am
by Saman Sjr.
Does Combo Box have maximum row limitation ?
I have 5339 records in my shipper table, using this script i populate records into Combo Box :

put "SELECT shipper_name FROM shipper_table ORDER BY shipper_name" into tSQL
put revDataFromQuery(comma, return, connID, tSQL) into tRecords
put tRecords into button "ComboShipper"

the Combo Box is only contain 2515 line, any advise ?

regard's
SS

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 10:11 am
by jmburnod
Hi Saman,

I just tested it with a list of 4500 lines
I can only put 156 lines (4695 chars)

LiveCode 5.5.5,6.6.0
OSX 10.6.8

Best regards
Jean-Marc

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 12:40 pm
by BvG
Wow, in my oppinion, combo boxes should support way less lines, maybe 20 at most.

Think of your poor users, and use a different way to present that data. I suggest a sortable list field, but even better would be a way to avoid showing so much data at once.

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 3:14 pm
by Saman Sjr.
Thanks Jean for testing,
for your info i'm using live code 6.6.1 - windows 7

BvG, it's a shipper or customer list. I have no idea how to avoid showing so much data at once

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 3:30 pm
by Klaus
Hi Saman,
Saman Sjr. wrote:BvG, it's a shipper or customer list. I have no idea how to avoid showing so much data at once
whatever it is, wouldn't you also hate a developer who forces you to select any item from a >1000 lines popup-menu/combo box? 8)
I would! :D

Do as Björnke suggested and try to supply a scrolling list field, best with a "search/filter bar" at the top!
THAT would be user-friendly :D


Best

Klaus

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 4:16 pm
by Saman Sjr.
Hi Klaus,

Thanks for the "search/filter bar" at the top.
my background is visual basic where combo box will do the search automatically when user press the first letter of the list, so i focus to much on the combo box it self to find a solution.

I hope LC developer will update the documentation about this limitation.

best regard's
SS

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 4:24 pm
by Klaus
HI Saman,
Saman Sjr. wrote:my background is visual basic where combo box will do the search automatically
when user press the first letter of the list, so i focus to much on the combo box it self to find a solution.
is this "ususal/exspected" behavior of a combo-box control?
I confess that I have NEVER used a combo box in any of my projects in the last 15 years! :D


Best

Klaus

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 7:39 pm
by dunbarx
Whew.

You must, simply must, as everyone has said, change the interface. How about a binary search? You can have your thousands-of-lines list in a custom property. Have the user start typing into an "entry" field. After three or four characters, say, have been entered, filter that master list and present the result in a "results" field. As the user types another character, that list will winnow down to something useful.

Hopefully.

I do not know how similar the list items are. But in any case, do you see that something like this is far more palatable? The "results" field ought to be a list field that the user can eventually click on a the desired line.

Craig Newman

Re: Combo Box Limitation

Posted: Tue Apr 22, 2014 7:53 pm
by dunbarx
Hi again.

If you do decide to go the binary search method, are you able to execute something like that? I will give you a head start here. Simon will not mind, because it will take you a while to get through this, and that should be a pretty good learning experience. You need that long list set as a custom property of an editable field, named "longList". You also need a "resultList" field. In the editable field script:

Code: Select all

 on keydown var
put var after me
   if the length of me > 3 then put revFullFind(me,the longList of me) into fld "resultList"
   else put "" into fld "resultList"
end keyDown

Code: Select all

function revFullFind tText,tFind,exactly --RETURNS LINE NUMBER & "," & WORD NUMBER
   put 0 into counter
   switch exactly
      case "true"
      case empty
         repeat for each line tline in tText
            add 1 to counter
            if tFind = tline then
               put counter & return after tResult
            end if
         end repeat
         break
      case "false"
         repeat for each line tline in tText
            add 1 to counter
            if tFind is in tline then
               repeat with y = 1 to the number of words in tLine
                  if word y of tLine = tFind then put y & "," after temp
               end repeat
               delete last char of temp
               put counter & "," & temp & return after tResult
               put "" into temp
            end if
         end repeat
         break
   end switch
   return tResult
end revFullFind
Craig

Re: Combo Box Limitation

Posted: Wed Apr 23, 2014 2:02 am
by Saman Sjr.
Dear All (Jean, Björnke, Klaus, Craig)

Thank you for the advices :idea: , really appreciate it.

have a good day :)
SS

Re: Combo Box Limitation

Posted: Wed Apr 23, 2014 11:41 am
by BvG
Oh of course, combo boxes are used a lot for filtering large lists on Windows, I forgot. Mostly because I force myself to avoid platform specific approaches in LC. Said that, it should work like other combo boxes on Windows, and therefore it's a valid bug -> http://quality.runrev.com