Jose,
That sounds more complicated than what I did, but hey, if it works for
you, go for it! :)
I had the same question about the tabbertab defaults and I looked it up
on google. You can set an additional div class called
"tabbertabdefault" which will cause a certain div to display first.
I did something like this in my kid template:
<div class="tabbertab ${tab_default}">
and then I return from the controller the tab_default value set to
either None or tabbertabdefault. Works for me!
jose wrote:
> I followed what Adam Jones suggested me:
> "...If you are looking for a quick hack you can do editForm.render(data,
> action=myaction)
> Where data is the 'data' you are using to fill in the form, and
> 'myaction' is the
> controller method the form should post data to."
> and it works fine.
> Now, the only problem is the default div.
> Thank any way, Aaron
> jo
>
>
> Aaron Bostick wrote:
>
>> Jose,
>>
>> Have you tried just a simple widget.display() in the kid template within
>> the tabber div? I am doing this now and it seems to work fine.
>>
>> Just create your widget in the controller and pass it to the template
>> like normal as part of the return dict()...
>>
>> jose wrote:
>>
>>
>>> Hi all,
>>> I would like to insert a form into a Tabber widget.
>>> Using the code above I can insert it successful,
>>> but I don't know how to set the editForm.fields.name with data.
>>> Using editForm.render() the widgets are displyed empty
>>> I tried editForm.display() but it doesn't work.
>>> Is there a demo about how to use it?
>>> -----------------------------------------------------------------------------------
>>> editForm = widgets.TableForm(
>>> fields = [
>>> widgets.HiddenField(name='id'),
>>> widgets.TextField(name='cliente',label='codice utente'),
>>> widgets.SubmitButton(name='Save',label='',default='salva'),
>>> ] )
>>>
>>> class Controller:
>>> @expose(template="kid:sicer.templates.config.edit")
>>> def index(self, tg_errors=None, **data):
>>> qry = session.query(Config)
>>> context = qry.get_by(id=1)
>>>
>>> template="""
>>> <div class="tabber">
>>> <div class="tabbertab"><h2>Amministratore</h2> </div>
>>> <div class="tabbertab"><h2>Anagrafica</h2> </div>
>>> <div class="tabbertab"><h2>Fatturazione</h2>
>>> %s </div>
>>> </div>
>>> """ % editForm.render()
>>> tabForm = widgets.Tabber(template=template)
>>> return dict(tabForm=tabForm, context=context)
>>> --------------------------
>>> jo
>>>
>>>
>>>
>>>
>>>
>> Regards,
>> Aaron
>>
>>
>>
>
>
> >
Regards,
Aaron
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---