Q: WATagBrush>>before

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Q: WATagBrush>>before

Boris Popov, DeepCove Labs (SNN)
I'm trying to figure out how to extend WASubmitButtonTag to render some
<script> *before* proceeding with the <input> and my first hunch was to
override #before, but it's not quite what I'd hoped for. I ended up
overriding #openTag instead as follows, but wanted to hear if there's a
better way of doing it and if there's any problem with my hack as is?
Initial testing seems to indicate that it works as expected,

WASubmitButtonTag>>openTag

 self myScript ifNotEmpty: [:str |
  canvas forgetCurrentBrush.
  canvas script: (str expandMacrosWith: self ensureId).
  canvas brush: self].
 super openTag

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Q: WATagBrush>>before

Lukas Renggli
> I'm trying to figure out how to extend WASubmitButtonTag to render some
> <script> *before* proceeding with the <input> and my first hunch was to
> override #before, but it's not quite what I'd hoped for. I ended up

#before and #after are used to create tags within the tag. input is a
tag that is immediately closed and therefor has no contents.

> overriding #openTag instead as follows, but wanted to hear if there's a
> better way of doing it and if there's any problem with my hack as is?
> Initial testing seems to indicate that it works as expected,

I would have done exactly the same as what you propose in your code.
Should work fine, as far as I see.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside