Hi,
1. I'm rather new to symfony forms.
2. I have a very large propel entity, which I want to display for
editing using tabs.
3. I would love opinions / pointers. I know this is a bit long...

I thought of implementing it in the form class as something like:

$ws1 = new sfWidgetFormSchema(array(... fields in first group...));
$wd1 = new sfWidgetFormSchemaDecorator($ws1, '<tab_markup>%content%</
tab_markup>');

$ws2 = new sfWidgetFormSchema(array(... fields in second group...));
$wd2 = new sfWidgetFormSchemaDecorator($ws2, '<tab_markup>%content%</
tab_markup>');

$ws_tabs = new sfWidgetFormSchema(array('tab1' => $wd1, 'tab1' =>
$wd2));
$wd_tabs = new sfWidgetFormSchemaDecorator($ws_tabs,
'<tabs_container_markup>%content%</tabs_container_markup>');

$this->widgetSchema['tabs'] = $wd_tabs;

Does this look like a reasonable design ?
Is there an existing widget for that ?

Problems I can think of:
1. Field names - I will get obj[tabs][tab1][fieldname], where all I
want is obj[fieldname] (server side shouldnt care for my tabs upon
submission). I assume this is solvable using nameFormat, although I
still havent figured it out

2. JQuery UI Tabs require this HTML:
<div id="tabs">
        <ul>
                <li><a href="#tabs-1">Nunc tincidunt</a></li>
                <li><a href="#tabs-2">Proin dolor</a></li>
                <li><a href="#tabs-3">Aenean lacinia</a></li>
        </ul>
        <div id="tabs-1"> bla bla </div>
        <div id="tabs-2"> bla bla </div>
        <div id="tabs-3"> bla bla </div>
</div>

which means my topmost decorator ($wd_tabs) will have to be smart
enough to access each of the tabs ($wd1, $wd2), to get their names, so
it would be able to print the ul / li structure for JQuery. I assume
this will be done by extending sfWidgetFormSchemaDecorator

Any thoughts ?
10x


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to