Re: [WebDNA] maybe silly suggestion? [founditems]

This WebDNA talk-list message is from

2015


It keeps the original formatting.
numero = 111908
interpreted = N
texte = It seems to me a little complicated: let=E2=80=99s take your example [search = people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D= 25] [if [numfound]=3D0][then] [DO ERROR STUFF] [/then][else] [savefounditems namepeople] [/else][/if] [/search] This is fine for a two columns database, but if the database includes 10 = columns, is [savefounditems] supposed to store everything? what should = be the format of the data stored? how would it be sorted by [showpeople = namepeople] we could do that instead of [savefounditems namepeople]: [text]name[index]=3D[firstname],[/text] which will give us name1=3DJim,name2=3DBob,name3=3DChris,name4=3DBrian - chris > On 15 Jan 2015, at 21:27, iPhonzie@G wrote: >=20 > I really like the idea of [savefounditems] / [displayfounditems] (or = maybe [listfounditems] for consistency with other looping context = names). >=20 > Chris, if your [sto] concept is about persistent globally available = values, then I don=E2=80=99t think that applies to the need here - the = saved results generally only need to persist for the life of the current = page. >=20 > 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 >=20 > With [savefounditems], you could save several sets of searches on the = same database, such as =E2=80=9Cpeoplenameddave=E2=80=9D and = =E2=80=9Cpeoplefromalbuquerque=E2=80=9D, 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. >=20 > So, given a page with formvariables =E2=80=9Cfirstname=E2=80=9D and = =E2=80=9Ccity=E2=80=9D, the top of your code could do: >=20 > [search = people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D= 25] > [if [numfound]=3D0][then] > DO ERROR STUFF] > [/then][else] > [savefounditems namepeople] > [/else][/if] > [/search] >=20 > [search = people.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstnamesort=3D= 2&max=3D25] > [if [numfound]=3D0][then] > DO ERROR STUFF] > [/then][else] > [savefounditems citypeople] > [/else][/if] > [/search] >=20 > [function name=3Dshowpeople] > > [listfounditems [params_string]] > = > [/listfounditems] >
[index]][firstname][lastname][city][any field in people.db]
> [/function] > =09 > Later in the display code you could do: >=20 > People named [firstname]: > [showpeople namepeople] >=20 > People from [city]: > [showpeople citypeople] >=20 >=20 > =E2=80=94 Brian Fries >=20 > On January 15, 2015 at 9:55:07 AM, Terry Wilson (terry@terryfic.com) = wrote: >=20 >> 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=3Ddate, max=3D25,= 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.=20 >>=20 >> [showif = [somesearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahblah[/= text][/showif]=20 >> [showif = [someothersearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahb= lah[/text][/showif]=20 >>=20 >> [search [searchforwhat]&max=3D25&lastnamesort=3D1]=20 >>=20 >> > =20 >> > =20 >> > On Jan 14, 2015, at 2:57 PM, Brian Burton = wrote:=20 >> > =20 >> >> to help separate my controller logic from my display code it would = be awesome to have a shortcut like:=20 >> >> [search db=3Dallthethings.db&blahblahblah][savefounditems = name=3Dpeoplenameddave][/search]=20 >> >> =20 >> >> =20 >> >> =20 >> >> =20 >> >> then later in the page, where i=E2=80=99m rendering the html=20 >> >> [displayfounditems use=3Dpeoplenameddave] html things = [/displayfounditems]=20 >> >> =20 >> >> =20 >> >> =20 >> >> I know it looks like it=E2=80=99s 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. =20 >> >> =20 >> >> ok, feel free to start telling me how you can do this with a table = (you=E2=80=99re missing the point) or how we don=E2=80=99t need more = tags or whatever :) =20 >> >> =20 >> >> =20 >> >> -Brian B. Burton=20 >>=20 > --------------------------------------------------------- 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:

    
  1. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  2. Re: [WebDNA] maybe silly suggestion? [founditems] (christophe.billiottet@webdna.us 2015)
  3. Re: [WebDNA] maybe silly suggestion? [founditems] (Michael Davis 2015)
  4. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  5. Re: [WebDNA] maybe silly suggestion? [founditems] (christophe.billiottet@webdna.us 2015)
  6. Re: [WebDNA] maybe silly suggestion? [founditems] (Stuart Tremain 2015)
  7. Re: [WebDNA] maybe silly suggestion? [founditems] (Dan Strong 2015)
  8. Re: [WebDNA] maybe silly suggestion? [founditems] (Brian Burton 2015)
  9. Re: [WebDNA] maybe silly suggestion? [founditems] (Brian Burton 2015)
  10. Re: [WebDNA] maybe silly suggestion? [founditems] (Dan Strong 2015)
  11. Re: [WebDNA] maybe silly suggestion? [founditems] (Brian Burton 2015)
  12. Re: [WebDNA] maybe silly suggestion? [founditems] (=?utf-8?Q?iPhonzie=40G?= 2015)
  13. Re: [WebDNA] maybe silly suggestion? [founditems] (Brian Burton 2015)
  14. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  15. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  16. Re: [WebDNA] maybe silly suggestion? [founditems] (Dan Strong 2015)
  17. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  18. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  19. Re: [WebDNA] maybe silly suggestion? [founditems] (=?utf-8?Q?iPhonzie=40G?= 2015)
  20. Re: [WebDNA] maybe silly suggestion? [founditems] (=?utf-8?Q?iPhonzie=40G?= 2015)
  21. Re: [WebDNA] maybe silly suggestion? [founditems] (christophe.billiottet@webdna.us 2015)
  22. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  23. Re: [WebDNA] maybe silly suggestion? [founditems] (=?utf-8?Q?iPhonzie=40G?= 2015)
  24. Re: [WebDNA] maybe silly suggestion? [founditems] (=?utf-8?Q?iPhonzie=40G?= 2015)
  25. Re: [WebDNA] maybe silly suggestion? [founditems] (Stephen Reiss 2015)
  26. Re: [WebDNA] maybe silly suggestion? [founditems] (Terry Wilson 2015)
  27. Re: [WebDNA] maybe silly suggestion? [founditems] (Terry Wilson 2015)
  28. Re: [WebDNA] maybe silly suggestion? [founditems] (Lawrence Banahan 2015)
  29. Re: [WebDNA] maybe silly suggestion? [founditems] ("Psi Prime Inc, Matthew A Perosi " 2015)
  30. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  31. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  32. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  33. Re: [WebDNA] maybe silly suggestion? [founditems] (Terry Wilson 2015)
  34. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  35. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  36. Re: [WebDNA] maybe silly suggestion? [founditems] (Terry Wilson 2015)
  37. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  38. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  39. Re: [WebDNA] maybe silly suggestion? [founditems] (Donovan Brooke 2015)
  40. Re: [WebDNA] maybe silly suggestion? [founditems] (christophe.billiottet@webdna.us 2015)
  41. Re: [WebDNA] maybe silly suggestion? [founditems] (Kenneth Grome 2015)
  42. [WebDNA] maybe silly suggestion? [founditems] (Brian Burton 2015)
It seems to me a little complicated: let=E2=80=99s take your example [search = people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D= 25] [if [numfound]=3D0][then] [DO ERROR STUFF] [/then][else] [savefounditems namepeople] [/else][/if] [/search] This is fine for a two columns database, but if the database includes 10 = columns, is [savefounditems] supposed to store everything? what should = be the format of the data stored? how would it be sorted by [showpeople = namepeople] we could do that instead of [savefounditems namepeople]: [text]name[index]=3D[firstname],[/text] which will give us name1=3DJim,name2=3DBob,name3=3DChris,name4=3DBrian - chris > On 15 Jan 2015, at 21:27, iPhonzie@G wrote: >=20 > I really like the idea of [savefounditems] / [displayfounditems] (or = maybe [listfounditems] for consistency with other looping context = names). >=20 > Chris, if your [sto] concept is about persistent globally available = values, then I don=E2=80=99t think that applies to the need here - the = saved results generally only need to persist for the life of the current = page. >=20 > 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 >=20 > With [savefounditems], you could save several sets of searches on the = same database, such as =E2=80=9Cpeoplenameddave=E2=80=9D and = =E2=80=9Cpeoplefromalbuquerque=E2=80=9D, 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. >=20 > So, given a page with formvariables =E2=80=9Cfirstname=E2=80=9D and = =E2=80=9Ccity=E2=80=9D, the top of your code could do: >=20 > [search = people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D= 25] > [if [numfound]=3D0][then] > DO ERROR STUFF] > [/then][else] > [savefounditems namepeople] > [/else][/if] > [/search] >=20 > [search = people.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstnamesort=3D= 2&max=3D25] > [if [numfound]=3D0][then] > DO ERROR STUFF] > [/then][else] > [savefounditems citypeople] > [/else][/if] > [/search] >=20 > [function name=3Dshowpeople] > > [listfounditems [params_string]] > = > [/listfounditems] >
[index]][firstname][lastname][city][any field in people.db]
> [/function] > =09 > Later in the display code you could do: >=20 > People named [firstname]: > [showpeople namepeople] >=20 > People from [city]: > [showpeople citypeople] >=20 >=20 > =E2=80=94 Brian Fries >=20 > On January 15, 2015 at 9:55:07 AM, Terry Wilson (terry@terryfic.com) = wrote: >=20 >> 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=3Ddate, max=3D25,= 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.=20 >>=20 >> [showif = [somesearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahblah[/= text][/showif]=20 >> [showif = [someothersearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahb= lah[/text][/showif]=20 >>=20 >> [search [searchforwhat]&max=3D25&lastnamesort=3D1]=20 >>=20 >> > =20 >> > =20 >> > On Jan 14, 2015, at 2:57 PM, Brian Burton = wrote:=20 >> > =20 >> >> to help separate my controller logic from my display code it would = be awesome to have a shortcut like:=20 >> >> [search db=3Dallthethings.db&blahblahblah][savefounditems = name=3Dpeoplenameddave][/search]=20 >> >> =20 >> >> =20 >> >> =20 >> >> =20 >> >> then later in the page, where i=E2=80=99m rendering the html=20 >> >> [displayfounditems use=3Dpeoplenameddave] html things = [/displayfounditems]=20 >> >> =20 >> >> =20 >> >> =20 >> >> I know it looks like it=E2=80=99s 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. =20 >> >> =20 >> >> ok, feel free to start telling me how you can do this with a table = (you=E2=80=99re missing the point) or how we don=E2=80=99t need more = tags or whatever :) =20 >> >> =20 >> >> =20 >> >> -Brian B. Burton=20 >>=20 > --------------------------------------------------------- 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 christophe.billiottet@webdna.us

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:

[WebDNA] Domain upgrade questions (2009) RAM variables (1997) setting taxable to true (1997) Did you hear about this? (1997) PCS Frames (1997) Still trying to email... (1998) email list archive template (2004) looking for some paid WebCatalog help (2000) writefile and texte (1997) [searchString] (1997) Plaintext Email Attachment (2001) Grouping Fields in Context (1999) Project 2 (1998) Digest for 4/18/97 (1997) [WebDNA] php/mySQL version of WebDNA Speed Test? (2009) Changes to the List (1997) WebCatalog2 Feature Feedback (1996) WebCat and AppleShare 6.0 (1998) Nesting format tags (1997) [WebDNA] [listallcontexts] ??? (2016)