Focal Point
Lage List Box

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5191021822

May 15, 2007, 06:26 PM
secret
Lage List Box
I have a request to add 2800 records to a list box.

I tried the !IBI.fil.ddname technique and it still took almost 2 minutes.

Is there a faster way to load a large list or combo box?
May 15, 2007, 07:12 PM
dhagen
Don't!

Do not do it for a couple of reasons:
1. Pure usability ... who in their right mind will want to scroll through 2800 options?
2. All the other problems this will cause ... there is a limit to the number of variables that you can pass to a request, and the size of a request. It is large, but you will open that door if you do this.

Think of a solution that doesn't require you to load such a large number of options.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 16, 2007, 11:35 AM
Alan B
dhagen is correct. This amount in a select can cause issues.

However there are times when these things become essential to do. If this is what you want to do then you need to examine where the hold up is. Where are the records coming from and how much data is involved.

I have a select with 27,000 items (ask the users not me!), which loads in less than 15 seconds, albeit the fields are only 4 characters.

The !IBI.FIL.ddname technique is not slow per se. WF builds a page and then sends it to the browser, not a big deal.

Questions are, how long does the request to get the records take to process? Can the record length be reduced at all? Perhaps there is no good answer.


Alan.
WF 7.705/8.007
May 17, 2007, 10:41 AM
gregv
Another way to approach the usage and possibly reduce the retreival time, is to have an 'onChange' event for the box so as the user starts to type in 1 or 2 characters you can use AJAX to retreive a much smaller record set and refresh the drop-down list.

Another approach would be to set up an 'A, B, C,...1,2,3...' set of links above the list box so the user could choose the first character of the item and then retreive just those items.

Either way you can still do a multi-select by holding whatever they select in a hidden field with the same name as the parm and just keep adding to it until the press submit.

I hope this helps.

Greg



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
May 17, 2007, 11:33 AM
secret
Thank you All,

I have resolved the problem by creating a search function where thre user enters part of a code or description.
January 31, 2008, 02:08 PM
Atilla
Hello Secret,

I just read this topic.
I want to repopulate a list-box (filled with !IBI.FIL.). This is created by calling a fex with a Parameter. F.e. &C='A'. The is filled with all records which begins with 'A'. I think you have found a answer to this issue. Can you share your SECRET?

Thanks in advance,
Atilla


Member of Benelux
Usergroup
January 31, 2008, 05:37 PM
Darin Lee
Here a quick fex I frequently use for user searches. It takes two parameters: &SEARCHTYPE is a user-selected operator of Begins, Contains, or Equals. &NAMSRCH is the search string.
-DEFAULT &NAMSRCH='AT'
-DEFAULT &SEARCHTYPE='Contains'
-SET &NAMSRCH=UPCASE(&NAMSRCH.LENGTH,&NAMSRCH,'A&NAMSRCH.LENGTH');
-SET &SNAM=IF &NAMSRCH GT ' ' THEN (&NAMSRCH || '%');
-*
JOIN CLEAR *
TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE SUBHEAD
"Car Search Results"
" "
-IF &NAMSRCH EQ ' ' THEN GOTO SKIPNAMSRCH;
-IF &SEARCHTYPE NE 'Begins' GOTO SKIPBEGIN;
WHERE (CAR LIKE '&SNAM' );
-GOTO SKIPNAMSRCH
-SKIPBEGIN
-IF &SEARCHTYPE NE 'Equals' GOTO SKIPEQUAL;
WHERE (CAR EQ '&NAMSRCH' );
-GOTO SKIPNAMSRCH
-SKIPEQUAL
-IF &SEARCHTYPE NE 'Contains' GOTO SKIPNAMSRCH;
WHERE (CAR CONTAINS '&NAMSRCH' );
-SKIPNAMSRCH
END


you easily modify this to populate your list box.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat