[Seaside] Re: [ANN] PDF of Dynamic Web Development with Seaside

John McKeon p3anoman at gmail.com
Mon Feb 1 00:17:34 UTC 2010


Hello Tony,

On Sun, Jan 31, 2010 at 4:52 PM, Tony Giaccone <tgiaccone at gmail.com> wrote:

> Well I purchased a copy.  And now I've reached a point where I'm very
> frustrated..
> Great progress, but now reached  a limit and I feel like I'm not
> understanding the basic ways the framework should be used.
>

Have patience....

>
> Here's my dilemma.  Imagine a page with an editor and a browser.  The
> browser lists the entries of a particular type. The editor allows you
> to create a new entry or edit one which exists already.
>
> The page as a whole is initialized like this:
>
> initialize
>        super initialize.
>        person := Person new initialize.
>        editor := (person asComponent addValidatedForm).
>        browser := PersonBrowser new initialize.
>
>


> The renderContentOn method looks like this:
>
>        html text: 'Hello'; break.
>        html div class: 'personInfo'; with: [
>                editor isNil ifFalse: [html render: editor].
>                browser isNil ifFalse: [html render: browser].
>        ]
>
>
> What I can't figure out how to do is to connect into the method that
> gets called when the user presses save on the editor.  At that point I
> want to persist the person, and do some other things.  I see this
> lovely line from the book:
>
> This is clearly the place to hook a database commit for example.
>

Could you point us to where in the book you find this lovely line?

If I'm not mistaken, you need to add an onAnswer: block to the editor :=
line of code:
   editor := person asComponent
     addValidatedForm;
     onAnswer: [ :p | "do something with p" ];
     yourself.

To explore further put a self halt in the block to see when it gets called.

Also, I don't think you need to send initialize after you send new.
And be sure person and browser are returned in an array in the children
method.


>
> Yes, it clearly is.. what's not clear is how the heck you do it. LOL
>
>
> Tony
>
> PS I have this feeling, coming from a Java background that I'm totally
> am not doing things in the tao of smalltalk.  It's extremely
> frustrating.
>

Look at the bright side: You aren't in Java anymore =)

Regards


>
>
> On Sun, Jan 31, 2010 at 1:29 PM, Squeaker <squeakman at gmail.com> wrote:
> > Lukas Renggli wrote:
> >>
> >> The PDF version of the book "Dynamic Web Development with Seaside" is
> >> available for download now:
> >>
> >>      http://book.seaside.st/book/introduction/pdf-book
> >>
> >>
> >
> >
> > Any chance of getting some stats on how well it is selling.  It would be
> > nice to gauge community support.
> >
> > BTW - I purchased the pdf book.
> >
> >
> > _______________________________________________
> > 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
>



-- 
http://jmck.seasidehosting.st
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100131/aaeec3ba/attachment-0001.htm


More information about the seaside mailing list