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

Rick Flower rickf at ca-flower.com
Tue Feb 28 23:56:55 UTC 2006


Brian Brown wrote:
> In your case, I wouldn't use a WATask.
That's kinda what I thought as well.. I guess if I'm not going to use a 
WATask, I'd need to code up the renderContentOn: method to not only 
display my links near the top of the page, but also display the login 
form crud as well..  In MyWebApp, can I do something like this :

renderContentOn: html
    html divClass: 'sidebar' with: [html render: menuArea].
    html divClass: 'contentarea' with: [html render: mainPage].
    html divClass: 'loginarea' with: [html render: loginArea].

where loginArea is an instance of a Login class which has a 
renderContentOn: method that looks something like :

renderContentOn: html
    html form: [
        html defaultAction: [self confirmLogin].
        html heading: 'Welcome to MyWebApp' level: 3.
        html bold: 'Enter login name:'.
        html textInputWithValue: '' callback: [:v | self login: v].
        html br; br.
        html space; space; space; bold: 'Enter password:'.
        html passwordInputWithCallback: [:c | self password: ((MD5 hash: 
c) asHexString asLowercase) ].
        html paragraph.
        html attributes value: 'Login!'.
        html submitButton.
    ].

What I'm hoping for as a result is that I would get my menu links (care 
of the "menuArea" class), my "mainPage" body (whatever that turns out to 
be), and a "loginArea" as defined above..  Now, I'd obviously have to 
put some sort of conditional flag on the rendering of the "loginArea" 
object since we don't need/want to display it AFTER someone logs in -- 
that can be accomplished by looking at my session variable to see if 
we've got a "user" object yet (easy).  I can't believe this stuff is 
starting to make sense.. Bizzare!

Comments?

-- Rick



More information about the Seaside mailing list