[Seaside] What's the difference and why??

Rick Flower rickf at ca-flower.com
Sat Feb 25 05:35:27 UTC 2006


I'm trying to find out why I need to write the method below using one of 
the two ways below:

generateMainPageLinks: html
    html unorderedList: [
        html listItem: [html anchorWithAction: [self renderMain: html] 
text: 'Home'.].
        html listItem: [html anchorWithAction: [self renderAbout: html] 
text: 'About'.].
        html listItem: [html anchorWithAction: [self renderEnroll: html] 
text: 'Enroll'.].
        html listItem: [html anchorWithAction: [self renderContactUs: 
html] text: 'Contact Us'.].
    ].


generateMainPageLinks
    self html unorderedList: [
        self html listItem: [self html anchorWithAction: [self 
renderMain: self html] text: 'Home'.].
        self html listItem: [self html anchorWithAction: [self 
renderAbout: self html] text: 'About'.].
        self html listItem: [self html anchorWithAction: [self 
renderEnroll: self html] text: 'Enroll'.].
        self html listItem: [self html anchorWithAction: [self 
renderContactUs: self html] text: 'Contact Us'.].
    ].

Now, since I'm not passing in any arguments to this method (at least for 
now), I'm wondering why I need to specify "html" on the first
version of the code (and have the ":").. On the second one, if I don't 
put the "self" in front of the various "html" items, I get compilation 
errors
saying it doesn't know what they are..  I'm sure it's one of those 
fundamental SmallTalk things I'm missing here, but this one beyond me..

Now, before you get too carried away, I've NOT tried running this code 
on the bottom, but have run with the top one.  Any
insight as to what I'm missing would be greatly appreciated!

-- Rick



More information about the Seaside mailing list