numero = 48330
interpreted = N
texte = This is just a comment really on the way webcat does something that i don'tlike.I have just finished writing a search page that lets you select from dropdown lists to refine your search. The company sells projectors. The searchcriteria aremin / max pricemin / max resolutionmin / max weightmin / max lumens (brightness)with a drop down for both min and max values for each item.You select your mins and maxiums and hopefully you get a set of productsreturned that are within the range.So I wrote some nice generic code that should handle all eventuallities:[formvariables name=min&exact=false] [showif [value]!#] [text]search_string=[search_string]ge[getcharsstart=5][name][/getchars]data=[value]&[getcharsstart=5][name][/getchars]type=num&[/text] [/showif][/formvariables][formvariables name=max&exact=false] [showif [value]!#] [text]search_string=[search_string]le[getcharsstart=5][name][/getchars]data=[value]&[getcharsstart=5][name][/getchars]type=num&[/text] [/showif][/formvariables]So depending on how many options the user chooses, the search_string slowlygets built up to the point where you run it and the found items loop doesthe rest. It works great if you only select a min for one field or a max forone fieldBUT IT DOESN'T WORK IF YOU SELECT BOTH MIN AND MAX FROM ONE FIELD!Because of the way webcat works with Ranges when comparing multiple valueson the same field of the database, this code is toast and now i have towrite some not so nice generic code to handle the same search job.Argh!okay - sorry, i didn't get much sleep last night.-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
range vs greater than/less than (Andrew Simpson 2003)
This is just a comment really on the way webcat does something that i don'tlike.I have just finished writing a search page that lets you select from dropdown lists to refine your search. The company sells projectors. The searchcriteria aremin / max pricemin / max resolutionmin / max weightmin / max lumens (brightness)with a drop down for both min and max values for each item.You select your mins and maxiums and hopefully you get a set of productsreturned that are within the range.So I wrote some nice generic code that should handle all eventuallities:[formvariables name=min&exact=false] [showif [value]!#] [text]search_string=[search_string]ge[getcharsstart=5][name][/getchars]data=[value]&[getcharsstart=5][name][/getchars]type=num&[/text] [/showif][/formvariables][formvariables name=max&exact=false] [showif [value]!#] [text]search_string=[search_string]le[getcharsstart=5][name][/getchars]data=[value]&[getcharsstart=5][name][/getchars]type=num&[/text] [/showif][/formvariables]So depending on how many options the user chooses, the search_string slowlygets built up to the point where you run it and the found items loop doesthe rest. It works great if you only select a min for one field or a max forone fieldBUT IT DOESN'T WORK IF YOU SELECT BOTH MIN AND MAX FROM ONE FIELD!Because of the way webcat works with Ranges when comparing multiple valueson the same field of the database, this code is toast and now i have towrite some not so nice generic code to handle the same search job.Argh!okay - sorry, i didn't get much sleep last night.-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Andrew Simpson
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...