[Seaside] Re: Open URL in new window

Philippe Marschall philippe.marschall at gmail.com
Sun May 24 13:57:35 UTC 2009


2009/5/23 Paul DeBruicker <pdebruic at gmail.com>:
> I think I don't understand what to do with Randal's suggestion.  Do I
> put in the callback of the form submit button like this:
>
> html submitButton
>      callback:[html anchor newTarget url: (self
> createUrlFromFormData); with: ''.];
>      with: 'Open New Window'.
>
>
> I want to create the same effect as a popup window, where the URL that
> pops up is created from data in a form and the popup window appears
> when the submitButton is clicked.

That's a problem. Seaside supports opening popup windows in two ways,
either with the target attribute

html anchor
    newTarget;
    callback: [];
    with: ...

or with JavaScript, which gives you more control

html popupAnchor
    callback: [];
    with: ...

See WAPopupTest for an example

both of them work only on anchors, basically because that how HTML and
HTTP work. Doing it with a button in a form and the form data would be
possible but requires some JavaScript. In general Seaside applications
have very little use for popups. You can easily put the content of the
popup window in a component somewhere on the page without distracting
or surprising the user.

Cheers
Philippe


More information about the seaside mailing list