[Seaside] General subclassing question with regards to callbacks...

Lukas Renggli renggli at gmail.com
Wed Nov 12 07:38:14 UTC 2008


>        "Override the onClick: method to do what we want..."
>        html tableRow id: rowstr;
>                class:  (self classForRowNumber: index);
>                script: (self componentScriptOn: index);
>                with: [
>                                html anchor onClick: (html updater id:
> rowstr; callback: [:r |
>                                        self renderCompOn: r]); with:
> 'fooBar'.
>                                columns do: [:ea | self renderColumn: ea row:
> row on: html].
>                        ]

You can't put an anchor tag in-between table rows and table cells.
Tables have a very strict nesting policy (see
http://www.w3.org/TR/REC-html40/struct/tables.html). A minimal valid
HTML table looks like this:

#table
     #tableBody (exactly one)
          #tableRow (one or more)
                #tableData or #tableHeading (one or more)

Actually there are a couple of more things to consider, but that is the basics.

Note that the #onClick: Javascript event you can define on any DOM
node. Only if you want to use a traditional #callback: you need to use
an anchor.

Lukas

>
> <a href="javascript:void(0)" onclick="new
> Ajax.Updater('row1','http://localhost/seaside/foo',{'evalScripts':true,'parameters':['_s=WtzsCxCrreiqkTeX','_k=UIrMuNmm','10'].join('&')})">fooBar</a>
> <a href="javascript:void(0)" onclick="new
> Ajax.Updater('row2','http://localhost/seaside/foo',{'evalScripts':true,'parameters':['_s=WtzsCxCrreiqkTeX','_k=UIrMuNmm','11'].join('&')})">fooBar</a>
> <table id="tableSelectable" cellspacing="0" cellpadding="5">
> [ ... ]
> </table>
>
>
> On Nov 11, 2008, at 7:17 AM, Richard E. Flower wrote:
>
>> Thanks Lukas.. I'll look into doing that.. I figured it was something
>> stupid I was overlooking!
>> Too much late night coding!
>>
>> -- Rick
>>
>> On Nov 11, 2008, at 1:45 AM, Lukas Renggli wrote:
>>
>>>>     "Override the onClick: method to do what we want..."
>>>>     html tableRow id: 'row' , index asString;
>>>>             class:  (self classForRowNumber: index);
>>>>             script: (self componentScriptOn: index);
>>>>              onClick: [ self clickBlock ];
>>>>             with: [columns
>>>>                             do: [:ea | self
>>>
>>> #onClick: expects a Javascript string or object. #onClick is a HTML
>>> event attribute. You need to wrap the contents of your cells into an
>>> anchor that uses the block as a #callback:, or restort to JavaScript
>>> (AJAX).
>>>
>>> Cheers,
>>> Lukas
>>>
>>> --
>>> Lukas Renggli
>>> http://www.lukas-renggli.ch
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list