Re: [WebDNA] maybe silly suggestion? [founditems]
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 111907
interpreted = N
texte = Sorry but I find nothing of value in any of these suggestions thathave to do with savefounditems or listfounditems or displayfounditems.> With [savefounditems], you could save several sets of searches> on the same database ...We can do this now simply by setting [text] variables in searchesat the top of the page.> Given a page with formvariables �firstname� and �city�, the top of your code could do:> [search people.db&eqfirstnamedatarq=[firstname]&allhit=1&lastnamesort=1&max=25]> [if [numfound]=0][then]> DO ERROR STUFF]> [/then][else]> [savefounditems namepeople]> [/else][/if]> [/search]Or we can do this now without any special new tags, like this:[search ...][if [numfound]=0][then]DO ERROR STUFF[/then][else][text]namepeople=[founditems][firstname], [/founditems][/text][/else][/if][/search]Then further on down the page:People named [firstname]: [namepeople]I do things like this all the time on order to keep complex codeat the top of the page and simplify my HTML which appears at thebottom of the page. Therefore I do not understand how yoursuggested new tags can provide us with any feature that is betteror more useful than what we already have at our disposal.But if I am missing something please feel free to explain it in adifferent way, then maybe I will "get it".Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 01/15/2015 12:27 PM, iPhonzie@G wrote:> I really like the idea of [savefounditems] /> [displayfounditems] (or maybe [listfounditems] for consistency> with other looping context names).> > Chris, if your [sto] concept is about persistent globally > available values, then I don�t think that applies to the need> here - the saved results generally only need to persist for the> life of the current page.> > Internal to the WebDNA engine, this may well leverage the same > code as [table] - the [savefounditems] could create a private > table and [listfounditems] could execute a generic unranked> search of that table> > With [savefounditems], you could save several sets of searches> on the same database, such as �peoplenameddave� and > �peoplefromalbuquerque�, gathered at the top of your page with > appropriate error responses, etc. Later in the display portion> of your page you could call a common function to display HTML> tables of Daves and Albequerqians.> > So, given a page with formvariables �firstname� and �city�,> the top of your code could do:> > [search > people.db&eqfirstnamedatarq=[firstname]&allhit=1&lastnamesort=1&max=25]>> [if [numfound]=0][then]> DO ERROR STUFF] [/then][else] [savefounditems namepeople] > [/else][/if] [/search]> > [search > people.db&eqcitydatarq=[city]&allhit=1&lastnamesort=1&firstnamesort=2&max=25]>> [if [numfound]=0][then]> DO ERROR STUFF] [/then][else] [savefounditems citypeople] > [/else][/if] [/search]> > [function name=showpeople] [listfounditems> [params_string]]> > > [/listfounditems]
[index]] | [firstname] | [lastname] | [city] | [any>> field in people.db] |
[/function] Later in the display> code you could do:> > People named [firstname]: [showpeople namepeople]> > People from [city]: [showpeople citypeople]> > > � Brian Fries> > On January 15, 2015 at 9:55:07 AM, Terry Wilson > (terry@terryfic.com
) wrote:> >> Or just put the search parameters in a variable up top to >> retrieve as needed with showifs. This is quite handy for >> repurposing found items loops, such as a nicely formatted>> table of info that is sorted by various fields (just>> discussed this a few days ago). This has the added benefit of>> letting you keep constants like eventdatetype=date, max=25,>> etc in the actual search code to keep your parameters easier>> to read and manage. This would certainly put your controller>> logic separate from your display code.>> >> [showif >> [somesearch]=t][text]searchforwhat=db=allthethings.db&blahblahblah[/text][/showif]>>>>>> [showif>> [someothersearch]=t][text]searchforwhat=db=allthethings.db&blahblahblah[/text][/showif]>>>>>>>> [search [searchforwhat]&max=25&lastnamesort=1]>> >>> >>> >>> On Jan 14, 2015, at 2:57 PM, Brian Burton>>> wrote:>>> >>>> to help separate my controller logic from my display code>>>> it would be awesome to have a shortcut like: [search>>>> db=allthethings.db&blahblahblah][savefounditems>>>> name=peoplenameddave][/search]>>>> >>>> >>>> >>>> >>>> then later in the page, where i�m rendering the html >>>> [displayfounditems use=peoplenameddave] html things>>>> [/displayfounditems]>>>> >>>> >>>> >>>> I know it looks like it�s not saving that much code, but>>>> I can see switching which search I want in the>>>> controller, and still being able to use a universal>>>> founditems loop lower in the code. Also the ability to>>>> reuse search results (if needed) without doing the same>>>> search again.>>>> >>>> ok, feel free to start telling me how you can do this>>>> with a table (you�re missing the point) or how we don�t>>>> need more tags or whatever :)>>>> >>>> >>>> -Brian B. Burton>> > --------------------------------------------------------- This > message is sent to you because you are subscribed to the> mailing list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us
Associated Messages, from the most recent to the oldest:
Sorry but I find nothing of value in any of these suggestions thathave to do with savefounditems or listfounditems or displayfounditems.> With [savefounditems], you could save several sets of searches> on the same database ...We can do this now simply by setting [text] variables in searchesat the top of the page.> Given a page with formvariables �firstname� and �city�, the top of your code could do:> [search people.db&eqfirstnamedatarq=[firstname]&allhit=1&lastnamesort=1&max=25]> [if [numfound]=0][then]> DO ERROR STUFF]> [/then][else]> [savefounditems namepeople]> [/else][/if]> [/search]Or we can do this now without any special new tags, like this:[search ...][if [numfound]=0][then]DO ERROR STUFF[/then][else][text]namepeople=[founditems][firstname], [/founditems][/text][/else][/if][/search]Then further on down the page:People named [firstname]: [namepeople]I do things like this all the time on order to keep complex codeat the top of the page and simplify my HTML which appears at thebottom of the page. Therefore I do not understand how yoursuggested new tags can provide us with any feature that is betteror more useful than what we already have at our disposal.But if I am missing something please feel free to explain it in adifferent way, then maybe I will "get it".Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 01/15/2015 12:27 PM, iPhonzie@G wrote:> I really like the idea of [savefounditems] /> [displayfounditems] (or maybe [listfounditems] for consistency> with other looping context names).> > Chris, if your [sto] concept is about persistent globally > available values, then I don�t think that applies to the need> here - the saved results generally only need to persist for the> life of the current page.> > Internal to the WebDNA engine, this may well leverage the same > code as [table] - the [savefounditems] could create a private > table and [listfounditems] could execute a generic unranked> search of that table> > With [savefounditems], you could save several sets of searches> on the same database, such as �peoplenameddave� and > �peoplefromalbuquerque�, gathered at the top of your page with > appropriate error responses, etc. Later in the display portion> of your page you could call a common function to display HTML> tables of Daves and Albequerqians.> > So, given a page with formvariables �firstname� and �city�,> the top of your code could do:> > [search > people.db&eqfirstnamedatarq=[firstname]&allhit=1&lastnamesort=1&max=25]>> [if [numfound]=0][then]> DO ERROR STUFF] [/then][else] [savefounditems namepeople] > [/else][/if] [/search]> > [search > people.db&eqcitydatarq=[city]&allhit=1&lastnamesort=1&firstnamesort=2&max=25]>> [if [numfound]=0][then]> DO ERROR STUFF] [/then][else] [savefounditems citypeople] > [/else][/if] [/search]> > [function name=showpeople] [listfounditems> [params_string]]> > > [/listfounditems] [index]] | [firstname] | [lastname] | [city] | [any>> field in people.db] |
[/function] Later in the display> code you could do:> > People named [firstname]: [showpeople namepeople]> > People from [city]: [showpeople citypeople]> > > � Brian Fries> > On January 15, 2015 at 9:55:07 AM, Terry Wilson > (terry@terryfic.com ) wrote:> >> Or just put the search parameters in a variable up top to >> retrieve as needed with showifs. This is quite handy for >> repurposing found items loops, such as a nicely formatted>> table of info that is sorted by various fields (just>> discussed this a few days ago). This has the added benefit of>> letting you keep constants like eventdatetype=date, max=25,>> etc in the actual search code to keep your parameters easier>> to read and manage. This would certainly put your controller>> logic separate from your display code.>> >> [showif >> [somesearch]=t][text]searchforwhat=db=allthethings.db&blahblahblah[/text][/showif]>>>>>> [showif>> [someothersearch]=t][text]searchforwhat=db=allthethings.db&blahblahblah[/text][/showif]>>>>>>>> [search [searchforwhat]&max=25&lastnamesort=1]>> >>> >>> >>> On Jan 14, 2015, at 2:57 PM, Brian Burton>>> wrote:>>> >>>> to help separate my controller logic from my display code>>>> it would be awesome to have a shortcut like: [search>>>> db=allthethings.db&blahblahblah][savefounditems>>>> name=peoplenameddave][/search]>>>> >>>> >>>> >>>> >>>> then later in the page, where i�m rendering the html >>>> [displayfounditems use=peoplenameddave] html things>>>> [/displayfounditems]>>>> >>>> >>>> >>>> I know it looks like it�s not saving that much code, but>>>> I can see switching which search I want in the>>>> controller, and still being able to use a universal>>>> founditems loop lower in the code. Also the ability to>>>> reuse search results (if needed) without doing the same>>>> search again.>>>> >>>> ok, feel free to start telling me how you can do this>>>> with a table (you�re missing the point) or how we don�t>>>> need more tags or whatever :)>>>> >>>> >>>> -Brian B. Burton>> > --------------------------------------------------------- This > message is sent to you because you are subscribed to the> mailing list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
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...
Related Readings:
Getting total number of items ordered (1997)
WebCat2 beta FTP site (1997)
WebCat2b12 - nesting [tags] (1997)
(no subject) (1997)
GuestBook example (1997)
This is probably a stupid question... (2004)
General Purpose Database utility ????? (2003)
emailer setup (1997)
Notepad problems (1998)
WebCat2 - [format thousands] (1997)
WebCat B13 Mac CGI -- Frames question (1997)
Java Path (2004)
WebCat2 several catalogs? (1997)
Doing VALIDCARD right? (1998)
[format 40s]text[/format] doesn't work (1997)
Running _every_ page through WebCat-error.html (1997)
Emailing html (1998)
No incentive ... (2000)
help needed: Non-english characters in WebCatalog (1997)
Resume Catalog ? (1997)