[Seaside] Popup window
Julian Fitzell
julian at beta4.com
Wed Oct 15 14:57:05 CEST 2003
Pablo Iaría wrote:
> Hi all,
>
> I'd like to open a popup window to show some component.
>
> As an example, I modified the code in the WAStoreItemList:
>
> <code>
> renderContentOn: html
> html
> list: batcher batch
> do: [:ea |
> html attributes target: '_new'.
> html anchorWithUrl: (html urlForAction: [self call: (WAStoreItemView new item: ea)])
> title: ea title
> do: ea title].
> html render: batcher
> </code>
>
> Then, when a click an item a new window is opened but it shows other compoenents (not only WAStoreItemView).
>
> Is there a way to open the new window with only the WAStoreItemView component ?
Well, the issue of only seeing the desired component is just a matter of
where you call #call:. I've added #frameCall: to our session subclass
which knows how to get our main frame component and do a #call: on it.
So we can use "self call:" when we want to swap out the nearest
component and "self session frameCall:" when we want to put a new page
as the main content of the frame. You could do similar to find the the
component you want or even get the root from the session.
As for the actual code to popup windows, this isn't something Avi or I
have had to do yet, so there aren't any methods to help with it (but you
have the right idea using "html attributes" for the moment). We could
definitely add a helper method to do this. I was just talking to Avi
and he thinks that Derek had some code to do this as well... you out
there Derek?
Finally, can't you use #anchorWithAction:text: instead of that
composition of methods you use above? It looks at a quick glance like
it would do the same thing.
Julian
More information about the Seaside
mailing list