Hi all...
I'm stumped once again -- it's probably just another ST thing that is throwing me for a loop.. Anyway, I've got a generic 'edit/add' widget that shows a list of records and then depending on the personality selected (by the parent menu), it invokes either the vanilla 'add' class to draw the form for a new record OR we render the 'editSelector' class who squirrels away the 'clickBlock' for later (in case the user clicks/selects a particular user). So, my initialize method and friends for the EditSelector class looks like : EditSelector>>initialize super initialize. userSelector := Admin_User_RecordSelector on: self. userEditor := Admin_User_EditExecutor on: self. self userSelector clickBlock: [ : each | self userEditor user: each. self call: self userEditor. ]. EditSelector>>renderContentOn: html html render: userSelector. While the above 'clickBlock' is valid, how its used elsewhere is not. See use of onClick: below and above.. I would like to be able to determine once the user presses on a row to select that user and perform an operation on them (whether it be delete or edit). Anyway, the clickBlock which will handle the task portion of it is failing indicating that the wrong argument count was specified (expects 1, got 0). Any ideas? Hope this makes sense! -- Rick Admin_User_RecordSelector >>initialize super initialize. clickBlock := nil. columns := OrderedCollection new add: (WAReportColumn selector: #familyId title: 'Family ID'); "selector gets performed on your data item" add: (WAReportColumn selector: #nameLast title: 'Family Last Name '); yourself. Admin_User_RecordSelector >>renderContentOn: html "Get the current list of users to show..." self rows: (self users). html break. html paragraph class: 'legend_lookalike'; with: 'Select a Family to Edit - click on a family name'. super renderContentOn: html. Admin_User_RecordSelector >>renderRowNumber: index item: row on: html "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 renderColumn: ea row: row on: html]] _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> "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 [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
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 > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
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 >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> "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 >>> [hidden email] >>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>> >> >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks.. I guess I need to think about it a bit more before it jells
in my head.. On Nov 11, 2008, at 11:38 PM, Lukas Renggli wrote: >> "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 >>>> [hidden email] >>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>>> >>> >>> _______________________________________________ >>> seaside mailing list >>> [hidden email] >>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>> >> >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > > > -- > Lukas Renggli > http://www.lukas-renggli.ch > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Lukas Renggli
Lukas,
I don't mean to nitpick, but you can have more than one body in a table, one for each row group. Cheers, -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. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Lukas Renggli Sent: Tuesday, November 11, 2008 11:38 PM To: Seaside - general discussion Subject: Re: [Seaside] General subclassing question with regards tocallbacks... > "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: > 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('&')})">fooB ar</a> > <a href="javascript:void(0)" onclick="new > Ajax.Updater('row2','http://localhost/seaside/foo',{'evalScripts':true,' parameters':['_s=WtzsCxCrreiqkTeX','_k=UIrMuNmm','11'].join('&')})">fooB ar</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 >>> [hidden email] >>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>> >> >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks for the comment Boris.. In a nutshell all I want to be able to do
is to have a table of names (or whatever) and be able to click anywhere on that row and have a callback (or block or ??) get rendered that can work on the 'selected row'.. I've got the code that changes the coloring when you hover over a row but the callback/block processing is what's getting me stumped.. Anyway, I'll continue looking at this some more this evening. Thanks for the insight.. On Wed, November 12, 2008 7:42 am, Boris Popov wrote: > Lukas, > > I don't mean to nitpick, but you can have more than one body in a table, > one for each row group. > > Cheers, > > -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. > > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of Lukas > Renggli > Sent: Tuesday, November 11, 2008 11:38 PM > To: Seaside - general discussion > Subject: Re: [Seaside] General subclassing question with regards > tocallbacks... > >> "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('&')})">fooB > ar</a> >> <a href="javascript:void(0)" onclick="new >> > Ajax.Updater('row2','http://localhost/seaside/foo',{'evalScripts':true,' > parameters':['_s=WtzsCxCrreiqkTeX','_k=UIrMuNmm','11'].join('&')})">fooB > ar</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 >>>> [hidden email] >>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>>> >>> >>> _______________________________________________ >>> seaside mailing list >>> [hidden email] >>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >>> >> >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > > > -- > Lukas Renggli > http://www.lukas-renggli.ch > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |