[Seaside] Modal dialogs that appear with their "background"
Iwan Vosloo
iwan at reahl.org
Wed Jun 4 13:43:55 UTC 2014
Hi there,
We would like methods similar to those that invoke the standard seaside
dialogs (like inform:) - but with a twist. We'd like the dialog to be
displayed WITH the current component instead of replacing it. (This is
basically the same visual effect that a JQuery ui dialog have, but
without any javascript involved.)
I am fairly new to seaside, so this is also a learning experience...
Our current solution works, but it seems to be the wrong way to go about
it. I am looking for a better way. This is all happening on Pharo 1.4
and Seaside 3.0.7
The current solution involves inheriting from WADelegation, and
overriding its renderContentOn: to render both the contents of the
dialog and also the previous component. This new kind of WADelegation is
then used in a show:onAnswer:delegation: call.
What bothers me about it is that a Delegation is not supposed to be used
for rendering stuff...as I understand it.
I have been investigating creating a normal visual Decoration that is
created with knowledge of the current component. It is then added to a
WAFormDialog, which I want to call:
... or something like that.
What I currently have is the code below. If I omit "html render:
backgroundComponent" in DialogDecoration>>renderContentOn: below, the
control flow work (of course that the backgroundComponent is not
displayed...). As the code is here, pharo just seems to get hung up.
Other possibilities is to create a component that wraps the current one
& adds the WAFormDialog - and calling it - but this has the same effect.
Any help appeciated...
- Iwan
ask: aString
^ self call: (WAYesOrNoDialog new
addMessage: aString;
addDecoration: (DialogDecoration new
backgroundComponent: self;
yourself);
yourself)
WADecoration subclass: #DialogDecoration
instanceVariableNames: 'backgroundComponent'
DialogDecoration>>initialise
super initialize.
backgroundComponent := nil
DialogDecoration>>backgroundComponent: aComponent
backgroundComponent := aComponent
DialogDecoration>>renderContentOn: html
self renderNextOn: html
html render: backgroundComponent.
More information about the seaside
mailing list