Hi all, i'm with these same problem!!!
anybory could help?
i have a list widget, where i try to change your values
(default)...when i do this....the widget don't changed the value and
return the same thing :(
example:
@turbogears.expose(template="test.templates.novo_pergunta")
def novo_pergunta(self, kw , tg_errors=None):
if tg_errors:
turbogears.flash('Error')
form_pergunta.fields[0] = widgets.HiddenField(name =
"questid", default = "%s" %kw['questid'])
form_pergunta.fields[1] = widgets.HiddenField(name =
"secaoid", default = "%s" %kw['secaoid'])
form_pergunta.fields[2] = widgets.HiddenField(name =
"numsecao", default = "%s" %kw['numsecao'])
form_pergunta.fields[3] = widgets.HiddenField(name =
"quantidade_secoes", default = "%s" %kw['quantidade_secoes'])
form_pergunta.fields[4] = widgets.HiddenField(name =
"numpergunta", default = "%s" %kw['numpergunta'])
form_pergunta.fields[5] = widgets.HiddenField(name =
"quantidade_perguntas", default = "%s" %kw['quantidade_perguntas'])
# return
return dict(form = form_pergunta, numpergunta =
kw['numpergunta'], quantidade_perguntas = kw['quantidade_perguntas'],
numsecao = kw['numsecao'],quantidade_secoes =
kw['quantidade_secoes'])
This case kw return a parameters right
def novo_pergunta create a form ....in my teamplate when a click
'save' i call the action save_form. This action return to def
novo_pergunta ...but kw have a new parameters.
Then def novo_pergunta create again the form ... but the parameters
aren't changed!!!
Any help apreciated.
Thanks
Bruno Nascimento
IM-UFRJ RJ, Brazil
On Aug 9, 5:23 am, Glauco <[EMAIL PROTECTED]> wrote:
> Hi all, i'm building a multi-step forms in turbogears.
> During mi implementation of workflow i've encountered this problem.
> Probably i'm doing somethin wrong, but anyway i cannot understand where
> is the issue.
>
> My purpose is a form with 2 parts:
> head: someinputwidget, parameters
> detail: a list of row selected with parameters in the head.
>
> With some submit i want to refresh the detail, so ichangevalueof
> form-datainsidethe 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, thevalueinsidethe widged is different from the
> h1valuetag..... but the source of data is the same.
>
> where TG get thisvalue?!?!?
>
> step1Form = NewTableForm(
> caption = 'bla bla',
> fields = [ w.TextField(name='test',
> label='',
> validator=v.Int ),
> w.SubmitButton(label='',
> name = 'go',
> default='submitter' ),
> ],
> action = 'step2')
>
> classController(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 ## -->Changeofvalue
> 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
-~----------~----~----~----~------~----~------~--~---