Thanks Alberto! it's works! but still have a litle problem...
its not "ajaxeable", the form sendo the request to "cadastrar" method
but refresh the entire page, not only the target divs (loading and
items)
here my controller:
class ContasContabeis:
@expose(template="tgorcamentos.templates.contascontabeis_cadastro")
def cadastro(self):
item_searchform = RemoteForm(
name="FormCtaContabil",
fields=[TextField("codigo"),
TextField ("descricao")],
submit_text="Enviar")
return dict(item_searchform=item_searchform)
@turbogears.expose(format = "json")
def cadastrar(self, **kw):
self.ccontabil = ContaContabil()
self.ccontabil.descricao=str(kw['descricao'])
self.ccontabil.codigo=str(kw['codigo'])
self.ccontabil.gravar()
""" Echo the parameters back, json formatted. """
return """Received data:<br />%r""" % kw
and my kid template
<span py:replace="item_searchform.display(
action='cadastrar',
target_dom='items',
before='getElement(\'loading\').innerHTML=\'Searching...\';',
on_complete='getElement(\'loading\').innerHTML=\'Done!\';',
confirm='Are you sure you want to
submit this request?'
)">
</span>
<div name="loading"></div>
<div name="items"></div>
att
Petry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---