January 16, 2012, 12:41 PM
jseaburnGrouping 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
January 19, 2012, 04:17 PM
jncCombining 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.
January 19, 2012, 05:56 PM
HåkanI 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
January 20, 2012, 01:44 PM
ABTWould 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
January 24, 2012, 02:58 PM
jseaburnI 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?