Focal Point
sorting values in a listbox?

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

September 11, 2007, 09:51 AM
Jason K.
sorting values in a listbox?
I have a list of a few hundred customers in a list box. Is there any way to put these customers in alphabetical order in a listbox?

Thanks!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 11, 2007, 11:37 AM
Darin Lee
Yes. I'm sure there's some javascript to do it, (i'm not a javascript person) but you can always run a procedure that sorts them alphabetically before holding them for your list box control. Lots of examples available in the forum


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
September 17, 2007, 03:04 PM
cburtt
You don't indicate the source of the customer list you want to show in the listbox. I'm presuming you have a file/table somewhere that contains that.

Consider running a TABLE FILE ... against your Customer Master file to select the customers you need and hold that selection in a *.htm file. Precede the query with a FILEDEF pointing to a place in your FOCUS path. Include BY {customer-name-field} to sort them as you wish and an ON TABLE HOLD AS {filedef-name} to write the *.htm in the appointed place. Each row in the file must have the customer-name text you want preceded with an html 'select' tag consisting of the LT character, the word 'SELECT' and the GT character.

In your HTML/launch page, reference the content of the select box with !{name-of-held-file} which will cause the select box to be populated from the output of the afore mentioned query.

For this to work the launch page must be displayed by WF using a *.fex containing HTMLPAGE {name-of-launch-page-containing '!...'}.

If you need details, I can post example fex.


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
September 17, 2007, 03:17 PM
vaayu
I agree with cburtt, I have some launch forms where I use the dynamic list boxes using a procedure (.fex) and create a TABLE FILE for that list
CREATE A FEX CALLED "CUSTOMERLIST.FEX"
DEFINE FILE TABLE1
CUST/A120=CUSTOMERNAME|' : '| CUSTOMERID;
END
TABLE FILE TABLE1
SUM CUST AS 'CUSTLIST'
BY CUSTOMERID
ON TABLE PCHOLD FORMAT XML
END

And here's the


Hope it helps

-P


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
September 17, 2007, 03:19 PM
vaayu
heres the select tag for htm

"SELECT language=javascript id=listbox6 style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; Z-INDEX: 24; LEFT: 30px; WIDTH: 450px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 120px; HEIGHT: 360px" tabIndex=23 onchange=listbox6_onchange(this) size=3 name=CMISRPTS sourcetype="typeFex" ibiapp_app="cmisreports" ibic_server="EDASERVE" datatype="1" datafield displayfield datasource="CUSTOMERLIST.FEX">

CHANGE THE " TO < > ACCORDINGLY
THANKS


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************