[Seaside] Embedded forms

Michel Bany michel.bany at gmail.com
Sat Nov 18 08:55:28 UTC 2006


> It appears that if I render a component that has a form inside it onto
> another form that buttons for the main form only work above the  
> embedded
> component.
>

Ron,

As a Seaside application is getting more complex, I noticed that it gets
hurt with two typical unanticipated issues that break XHTML compliance
- nested forms
- duplicate id.
That's why I created the package named SeasideAssistants.

Below, I am supplying the package description in VW.

HTH
Michel.



Among other things, proper compliance to XHTML implies
(1) Form tags are not be nested,
(2) The id attribute values are unique.
The later is especially important when using AJAX techniques where it  
is critical for the Javascript functions to uniquely identify the XML  
elements that are manipulated.
In complex constructs that are using many nested components generated  
by many different rendering methods from many different classes, it  
may be difficult to ensure XHTML compliance. As a consequence, nested  
form tags or duplicate id attribute values are likely to occur.
This package slightly modifies Seaside so that nested form tags and  
duplicate id attribute values are producing an error. This makes it  
possible to immediately and precisely spot where to look in the  
Seaside application.
The exact behavior is decided in the following methods :
	#shouldRaiseDuplicateCssIdErrors
	#shouldRaiseNestedFormErrors
	#shouldSilentlyDiscardNestedForms
These methods are available in classes WAHtmlRenderer and  
WARenderCanvas.
When this package is loaded the default behavior is the following:
(1) Duplicate id attribute values are allowed  
(#shouldRaiseDuplicateCssIdErrors answers false)
(2) Nested form tags are allowed (#shouldRaiseNestedFormErrors  
answers false)
(3) Nested form tags are silently discarded  
(#shouldSilentlyDiscardNestedForms answers true)
This default behavior ensures that an existing Seaside application  
does not break.
To enable a different behavior, there are two possibilities.
(1) Modifies any of the six methods listed above
(2) Subclass WAHtmlRenderer or WARenderCanvas and re-implement  
methods as needed



More information about the Seaside mailing list