Combo Box Limitation

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Combo Box Limitation

Post by Saman Sjr. » Tue Apr 22, 2014 8:17 am

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Combo Box Limitation

Post by jmburnod » Tue Apr 22, 2014 10:11 am

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
https://alternatic.ch

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Combo Box Limitation

Post by BvG » Tue Apr 22, 2014 12:40 pm

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.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Re: Combo Box Limitation

Post by Saman Sjr. » Tue Apr 22, 2014 3:14 pm

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

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Combo Box Limitation

Post by Klaus » Tue Apr 22, 2014 3:30 pm

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

Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Re: Combo Box Limitation

Post by Saman Sjr. » Tue Apr 22, 2014 4:16 pm

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

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Combo Box Limitation

Post by Klaus » Tue Apr 22, 2014 4:24 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9647
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Combo Box Limitation

Post by dunbarx » Tue Apr 22, 2014 7:39 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9647
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Combo Box Limitation

Post by dunbarx » Tue Apr 22, 2014 7:53 pm

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

Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Re: Combo Box Limitation

Post by Saman Sjr. » Wed Apr 23, 2014 2:02 am

Dear All (Jean, Björnke, Klaus, Craig)

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

have a good day :)
SS

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Combo Box Limitation

Post by BvG » Wed Apr 23, 2014 11:41 am

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
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”