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

Richard E. Flower rickf at ca-flower.com
Wed Nov 12 07:03:12 UTC 2008


Lukas et-al,

I changed the code mentioned below to look like that below.. However,  
the anchors do NOT show up within the table
at all -- they're outside the table in a different DIV.. Any ideas  
why?  It doesn't seem to make sense to me anyway.
I tried some other variations and got the same result..  Any ideas?

I've also included some generated XHTML output for reference..

renderRowNumber: index item: row on: html
	| rowstr |

	rowstr := 'row' , index asString.

	"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].
			]

<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
>



More information about the seaside mailing list