[Seaside] Use of onMouseOver: and onMouseOut: in Seaside 2.8x

Rick Flower rickf at ca-flower.com
Sat Nov 8 00:58:11 UTC 2008


Ok -- just to reply to myself.. I was missing the need to add SULibrary
to the list of libraries that the Dispatch editor indicates.. Once I did
that the prototype (and related) libraries were loaded so no more error..
Now, I did end up copying the code below to my test from one of the
Scriptaculous examples and it runs great and highlights EVERYTHING but I
only want it to highlight a single <TR> in a table when the mouse hovers
over it.. Any ideas how to tailor it to down-scope what it highlights?

MTIA!

   html script: (Scriptaculous.SUEvent new
      observe: (Scriptaculous.SUStream on: 'document')
      on: 'mouseover'
      do: (html effect highlight; id: Scriptaculous.SUEvent new element)).



On Fri, November 7, 2008 3:43 pm, Rick Flower wrote:
> By the way, I modified the existing Seaside Unit Test (WATableReportTest)
> to have a #renderContentOn: method as follows (the rest of the test code
> is the same) :
>
> WATableReportTest>>renderContentOn: html
>
>         self session addLoadScript: (html selector
>               add: 'tr.effect';
>               do: [ :each |
>                         each element on: 'mouseover' do:
> '$(event.target).up(''tr'').addClassName(''highlight'')'.
>                        each element on: 'mouseout' do:
> '$(event.target).up(''tr'').removeClassName(''highlight'')']).
> 	html render: report.
>
> Unfortunately, I must be doing something wrong as Firebug complains about
> the use of '$$' below in the generated script...  Any ideas what I've
> missed?
>
> <script type="text/javascript">
> 1/*<![CDATA[*/function
> onLoad(){$$('tr.effect').each(function(){$(arguments[0]).observe('mouseover',function(event){'$(event.target).up(\'tr\').addClassName(\'highlight\')'});$(arguments[0]).observe('mouseout',function(event){'$(event.target).up(\'tr\').removeClassName(\'highlight\')'})})}/*]]>*/
> </script>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>




More information about the seaside mailing list