Discussion:
[FE-discuss] Confusion over htmlfill and variable_decode
michael lovett
2010-09-21 20:26:48 UTC
Permalink
Hi all

Today I tried naming a set of repeating html controls according to the
Formencode "standard" for repeating controls.

For example, I have several controls related to "test products" (each test
product has a text box, a select, and so on). I was naming the html controls
like this:

tp-1.vehicle, tp-1.color, and so on.

As part of my testing today, I took request.params (containing form fields
named as per above) and fed them into variable_decode, and then I used the
resultant dictionary
for the "default" parameter for HTMLFIll.render.

But HTMLFill did not seem to understand the format of this dictionary; it
did not alter the html to reflect the values for tp-1.vehicle, etc.

Am I doing something wrong here? Is HTMLFill not expected to work with a
dictionary produced by variable_decode?

Note that if I don't follow the naming convention for my controls (I name
them something like TP1_vehicle) I don't have a problem...

Any insight would be helpful, and I can post code if my description above is
murky.

Michael

Loading...