Re: [Zope-dev] Grabbing all the keys/values/trinkets from previous REQUEST
Jason Spisak <444@hiretechs.com> wrote:
I am trying to grab all the values from a previous form and include them in the next form. The following code works fine, but I would like to garner the trinkets as well. Is that possible from the REQUEST.form()? If not, I think they should marshall into their proper forms if I convert them on the backside. But that would be a pain.
<dtml-in "_.range(0,_.len(REQUEST.form.keys()))"> <dtml-let a=sequence-item> <input type="hidden" name="<dtml-var "REQUEST.form.keys()[a]">" value="<dtml-var "REQUEST.form.values()[a]">"> </dtml-let> </dtml-in>
I don't quite know what you mean by "trinkets". The following is a slightly cleaner cut at your code:: <!-- items() returns a dic't key-value pairs --> <dtml-in "REQUEST.form.items()"> <input type="hidden" name="&dtml-sequence-key;" value="&dtml-sequence-item;"> </dtml-in> Are "trinkets" the ":list" style names, and the original, unmangled data? I don't think there is any easy way to get access to them inside the called form. Hmmm, I'll think on it. Tres. -- ========================================================= Tres Seaver tseaver@palladion.com 713-523-6582 Palladion Software http://www.palladion.com
Actually the 'dirty' code was for that very thing: <dtml-in "_.range(0,_.len(REQUEST.form.keys()))"> <dtml-let a=sequence-item> <dtml-try "REQUEST.form.values()[a][0]"> <dtml-in "REQUEST.form.values()[a]"> <dtml-if "_['sequence-item'] != ''"> <input type="hidden" name="<dtml-var "REQUEST.form.keys()[a]">:list" value="<dtml-var sequence-item>"> </dtml-if> </dtml-in> <dtml-except> <input type="hidden" name="<dtml-var "REQUEST.form.keys()[a]">" value="<dtml-var "REQUEST.form.values()[a]">"> </dtml-try> </dtml-let> </dtml-in> Will allow you to pass all the type list or not on through a multiple form wizard. I put a How-To together about it and it's under review. All my best, Tres Seaver writes:
Jason Spisak <444@hiretechs.com> wrote:
I am trying to grab all the values from a previous form and include them in the next form. The following code works fine, but I would like to garner the trinkets as well. Is that possible from the REQUEST.form()? If not, I think they should marshall into their proper forms if I convert them on the backside. But that would be a pain.
<dtml-in "_.range(0,_.len(REQUEST.form.keys()))"> <dtml-let a=sequence-item> <input type="hidden" name="<dtml-var "REQUEST.form.keys()[a]">" value="<dtml-var "REQUEST.form.values()[a]">"> </dtml-let> </dtml-in>
I don't quite know what you mean by "trinkets". The following is a slightly cleaner cut at your code::
<!-- items() returns a dic't key-value pairs --> <dtml-in "REQUEST.form.items()"> <input type="hidden" name="&dtml-sequence-key;" value="&dtml-sequence-item;"> </dtml-in>
Are "trinkets" the ":list" style names, and the original, unmangled data? I don't think there is any easy way to get access to them inside the called form. Hmmm, I'll think on it.
Tres. -- ========================================================= Tres Seaver tseaver@palladion.com 713-523-6582 Palladion Software http://www.palladion.com
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Whoops, redendant. <dtml-try "REQUEST.form.values()[a][0]"> cand just be <dtml-try> All my best, Tres,
Jason Spisak <444@hiretechs.com> wrote:
I am trying to grab all the values from a previous form and include them in the next form. The following code works fine, but I would like to garner the trinkets as well. Is that possible from the REQUEST.form()? If not, I think they should marshall into their proper forms if I convert them on the backside. But that would be a pain.
<dtml-in "_.range(0,_.len(REQUEST.form.keys()))"> <dtml-let a=sequence-item> <input type="hidden" name="<dtml-var "REQUEST.form.keys()[a]">" value="<dtml-var "REQUEST.form.values()[a]">"> </dtml-let> </dtml-in>
I don't quite know what you mean by "trinkets". The following is a slightly cleaner cut at your code::
<!-- items() returns a dic't key-value pairs --> <dtml-in "REQUEST.form.items()"> <input type="hidden" name="&dtml-sequence-key;" value="&dtml-sequence-item;"> </dtml-in>
Are "trinkets" the ":list" style names, and the original, unmangled data? I don't think there is any easy way to get access to them inside the called form. Hmmm, I'll think on it.
Tres. -- ========================================================= Tres Seaver tseaver@palladion.com 713-523-6582 Palladion Software http://www.palladion.com
Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Jason Spisak -
Tres Seaver