Focal Point
Grouping items in a multi-select list box

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

January 16, 2012, 12:41 PM
jseaburn
Grouping items in a multi-select list box
Hello - we have a large list of brands associated with our products. The fall into 2 main "groups". My question is - how do I display these 2 groups of brands as option in a list box, as well as each individual brand? Essentially it's 2 different fields that I need to combine in to 1 list box.

Thanks,
Jeralee


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
January 19, 2012, 04:17 PM
jnc
Combining the two database fields into one listbox probably wouldn't be so hard......

DEFINE FILE CAR
FIELDA/A16 = COUNTRY;
END
TABLE FILE CAR
PRINT FIELDA
ON TABLE HOLD AS OUTFILE FORMAT ALPHA
END
FILEDEF OUTFILE DISK outfile.ftm (APPEND
TABLE FILE CAR
PRINT CAR
ON TABLE SAVE AS OUTFILE
END
TABLE FILE OUTFILE
PRINT FIELDA
BY FIELDA
ON TABLE PCHOLD FORMAT XML
END

But... trying to use the listbox is probably more difficult.

What field are you going to evaluate when you send back the quoted string with the multiple values from two different fields? (going to be tough)

I think you need to re-evaluate and try to get two listbox's chained on the htmlform. One to say what field, and the other to say what value. Then you could make some sort of dynamic filter that would say WHERE &PARM1 EQ &PARM2.QUOTEDSTRING ; With only 1 parameter to evaluate two fields, it's going to be tough.


WebFocus 7x, 8x, Win / Linux, any output format
January 19, 2012, 05:56 PM
Håkan
I would go for the same approach as jnc. Go for the chaining alternative (despite the Document Composter), use two select lists, one with the groups and one with the brands, and chain on group.

Cheers
Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
January 20, 2012, 01:44 PM
ABT
Would this (http://www.w3schools.com/tags/tag_optgroup.asp) help at all? See it in action here: http://www.w3schools.com/tags/...ame=tryhtml_optgroup

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
January 24, 2012, 02:58 PM
jseaburn
I went with the chaining option for now but I'm curious about ABT's suggestion. I'm assuming I would place that code directly in the HTML? I would also guess that if I open the page in the composer it might break that additional code? I've experienced that quite a bit with the report painter, so I'm leery of adding code that the tool doesn't support. Anyone else think ABT's idea could be a possibility?


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active