Hi all, i'm building a multi-step forms in turbogears.
During my implementation of workflow i've encountered this problem.
Probably i'm doing something wrong, but anyway i cannot understand where
is the issue.
My purpose is a form with 2 parts:
head: some input widget , parameters
detail: a list of row, selected with parameters in the head.
With some submit i want to refresh the detail, so i change value of
form-data inside the controler, and after all when the user is happy
from his selection do the work
now
After a lot of try i cannot understand this problem and this is my
shortest test case.
as you can see, the value inside the widged is different from the h1
value tag..... but the source of data is the same.
where TG get this value ?!?!?
step1Form = NewTableForm(
caption = 'bla bla',
fields = [ w.TextField(name='test',
label='',
validator=v.Int ),
w.SubmitButton(label='',
name = 'go',
default='submitter' ),
],
action = 'step2')
class Controller(object):
@expose(template="""<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#">
<body>
${form(**form_params)}
<h1 py:if="form_params['value'].get('test')">
${ form_params['value']['test']}
</h1>
</body>
</html>
""")
def step1(self, tg_errors=None, **data):
if data.get('test'):
data['test'] = data['test'] +1 ## --> Change of value
return dict(form=step1Form,
form_params = dict( value = data )
)
@expose(template="kid:sicer.templates.templates.edit")
@validate( form = step1Form )
@error_handler( step1 )
def step2(self, tg_errors=None, **data):
return self.step1( tg_errors=tg_errors, **data )
Any help apreciated.
Glauco
--
+------------------------------------------------------------+
Glauco Uri - Programmatore
glauco(at)allevatori.com
Sfera Carta Software(r) [EMAIL PROTECTED]
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---