[Seaside] Modal dialogs that appear with their "background"
iwan at reahl.org
Wed Jun 4 13:43:55 UTC 2014
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
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...
^ self call: (WAYesOrNoDialog new
addDecoration: (DialogDecoration new
WADecoration subclass: #DialogDecoration
backgroundComponent := nil
backgroundComponent := aComponent
self renderNextOn: html
html render: backgroundComponent.
More information about the seaside