[Seaside] Component with multiples decorations

Julien Berthaud j.berthaud at aureo.info
Tue Jun 5 09:14:09 UTC 2007


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).
  2) When I hit the <Enter> key inside the form I encountered an issue 
telling me that WAValidationDecoration does not understand the message 
defaultButton.

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



More information about the Seaside mailing list