[Seaside] Component with multiples decorations

Roger Whitney whitney at cs.sdsu.edu
Tue Jun 5 22:34:23 UTC 2007

On Jun 5, 2007, at 2:14 AM, Julien Berthaud wrote:

> Hello everyone,
> First of all, I am using Seaside2.7a1-mb.215 within Squeak 3.9.
> I have created a component by subclassing WAComponent.
> Then I have added two decorations:
>  - WAFormDecoration
>  - WAValidationDecoration
> So my component is wrapped into a form and a validator.
> Here is my initialize method:
> MyComponent>>initialize
>  super initialize.
>  form := WAFormDecoration new
>                buttons: self buttons.
>  self addDecoration: form.
>  self validateWith: [...my validation constraints... ifTrue:  
> [WAValidationNotification raiseSignal: 'a custom message']].
> MyComponent>>buttons
>  ^ #(Ok Cancel)
> I have two issues:
>  1) The buttons Ok and Cancel are displayed two times, one time  
> inside the form and one time just outside the form (just after the  
> </form> tag).

I don't see this in Seaside 2.6b1.140 in VW. What happens if you  
create at form directly in your renderContentOn: method rather than  
use a decorator?

>  2) When I hit the <Enter> key inside the form I encountered an  
> issue telling me that WAValidationDecoration does not understand  
> the message defaultButton.
Are you sure that it is WAValidationDecoration that raises the DNU  
defaultButton? That message should be sent to your MyComponent class.

> For the first issue, I have used a trick inside my CSS stylesheet  
> in order to remove the display of the second set of buttons.
> Here is the dedicated part inside my style function.
> div.dialog-buttons {
>  display:none;
> }
> form div.dialog-buttons {
>  display:block;
> }
> For the second issue, I understand well that this message should be  
> only dedicated to the WAFormValidation component but why it is  
> passed through the other decoration (the validation one)?
> After browsing the addDecoration method, I noticed that the  
> decorations are not collected through a list but they are chained.  
> Here I guess that form owner is MyComponent and that validation  
> owner is form. I do not know if I am right here? But anyway, I  
> can't solve my problem.
> Thank you in advance.
> Any ideas?
> Julien
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Roger Whitney              Department of Computer Science
whitney at cs.sdsu.edu        San Diego State University
http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
(619) 583-1978
(619) 594-3535 (office)
(619) 594-6746 (fax)

More information about the Seaside mailing list