[Seaside] Splitting a form in several components

Martin J.Laubach mjl at laubach.at
Sun Jan 30 12:25:33 CET 2005

   Say, is it possible to split a form in the following fashion?

	MainFormComponent >> renderContentOn: html
		html form: [
			html render: mySubComponent
			html submitWithAction: [ self doSomething ]]

	MySubComponent >> renderContentOn: html
		html textInputWithCallback: [ :v | self saveThatValueSomewhere: v ]

   Will that work or will it blow up in most spectacular fireworks?

   The general idea behind this is that I want to have a tabbed view, 
implemented using WASimpleNavigation, and in each of the tabs I have 
some form
elements to fill out. However, I'd like to do away with a separate 
"save" button
on each tab and instead save when the user leaves the tab (by clicking 
on another
tab). To do that, I'd have to transform the navigation in one large 
form, spanning
the tabs AND the sub-components, converting the tabs into submit 

   The other alternative I have come up with would be to attach some 
Javascript to
the tabs to trigger a submit for the enclosed form, but I'm not really 
a big fan
of Javascript magic when it's not strictly necessary.



More information about the Seaside mailing list