[Seaside] mailto:

Avi Bryant avi at beta4.com
Mon Jun 14 04:41:07 CEST 2004


On Jun 13, 2004, at 7:26 PM, Sebastián Sastre wrote:

> Hi all,
>  
>     I was trying to add some #mailto: to the renderer but for some 
> reason it does not work.
>  
>     Here is the code:
>  
> WAAbstractHtmlBuilder>>mailto: aEmailAddressString subject: 
> aSubjectString
>  
>     self document text: '<a 
> href="mailto:',aEmailAddressString,'?subject=',aSubjectString,'">'.
>  
>  
> This generates the code but the link is missing in the final rendered 
> page.
>  
>     <a href="mailto:xxx at someserver.com?subject=uh?">
>     any idea of what is going on?

The html needs to be <a 
href="mailto:xxx at someserver.com?subject=uh?">xxx at someserver.com</a>.  
You can't just put the <a> tag in there and assume the browser will 
know what your link text should be.

>   there is a better way to implement it?

Yes.  You shouldn't be generating HTML yourself; there are much higher 
level abstractions than that to use.  Look at the implementation of any 
of the other methods on AbstractHtmlBuilder for examples.  In fact, you 
could look at #anchorWithMailto: and #anchorWithMailto:subject:, since 
they already do what you want. :)

Avi



More information about the Seaside mailing list