[Seaside] anchorWithAction:text:
Avi Bryant
avi at beta4.com
Mon Apr 7 00:40:34 CEST 2003
On Sun, 6 Apr 2003, Brian Brown wrote:
> I would like to build an anchor with an image like:
>
> <a href="generated seaside component link"><imageWithForm: image></a>
>
> so I tried to do the following:
>
> html anchorWithAction: [itemTarget mainContent: action.] text: (html
> imageWithForm: (ImageImports at: rollOver)).
>
> which produces the <img src=.... tag outside of the anchor tag with the
> correct image, and the text of anchor is 'a WAHtmlRenderer'. I can see
> this is from WAHtmlBuilder>>text with renders the object asString, and
> the object is a WAHtmlRenderer. How can I get it render the img src
> tag? Or is there a better way to go about this?
Brian,
The code that will work for now is
html openAnchorWithAction: [itemTarget mainContent: action].
html imageWithForm: (ImageImports at: rollOver)).
html close.
However there really oughta be an #anchorWithAction:do: so that this
becomes
html anchorWithAction: [itemTarget mainContent: action] do: [
html imageWithForm: (ImageImports at: rollOver))
].
Implementing that is left as an exercise to the reader. ;)
(And I probably don't need to point out that the code snippet above should
really be pulled into an #anchorWithAction:form: method...)
Avi
More information about the Seaside
mailing list