[Seaside] Magritte

Norbert Hartl norbert at hartl.name
Fri Feb 12 15:01:00 UTC 2010


Yes, only coding and not strong concerns. In general using this should be safe. The new selector is meaningful on the class side but AFAIK not on the instance side of your objects. If you are calling new you need to have an implemented method new that easily leads to confusion when you read code. 

In your case and taking the examples from Richard your probably best off using the actionButtons approach.

Norbert

On 12.02.2010, at 15:55, Tony Giaccone wrote:

> Ok, so because I'm totally noob. Your concern is that the "new" button might end up causing problems because of the smalltalk new method/message?  We're talking coding issues here right not UI issues?
> 
> 
> Tony
> 
> On Fri, Feb 12, 2010 at 9:47 AM, Norbert Hartl <norbert at hartl.name> wrote:
> Ah, good, I was on my way to replying to my own mail. I think your last option is the best one. Introducing a new button to the mix via addForm: needs subclassing of MAContainerComponent as the button methods are dispatched to the MAContainerComponent. While this is being created dynamically it will lead to DNU as long as the description does not specify a new container componentClass.
> 
> Tony,
> 
> while we are talking about button names that get dispached as selectors on objects: You might see the little dangerous and confusing potential you can introduce by using a button called "new"
> 
> 
> Norbert
> On 12.02.2010, at 15:43, Richard Durr wrote:
> 
> > or
> >
> > YourClass new asCpmponent addValidatedForm: #( save new cancel).
> >
> > or
> > | actionButtons |
> >
> > actionButtons := Array
> >  with: [ :param | " do something" ] -> 'Label'
> >  with: [ :param | " do something different" ] -> 'Another Label'
> >  with: [ :param | " do something entirely different" ] -> 'Yet Another Label'.
> > YourClass new asCpmponent addValidatedForm: actions.
> >
> > On Fri, Feb 12, 2010 at 3:37 PM, Norbert Hartl <norbert at hartl.name> wrote:
> >> You are pretty close. Just have a look at
> >> MAContainerComponent>>addForm:
> >> self addForm: #( save cancel )
> >> and
> >> MAContainerComponent>>addValidatedForm
> >> self addForm; addValidation
> >> So a
> >> YourClass new asComponent addForm: #( new save cancel); addValidation
> >> should do the trick
> >> Norbert
> >> On 12.02.2010, at 15:21, Tony Giaccone wrote:
> >>
> >>
> >> I'm working my way through portions of the seaside pdf ( really makes it so
> >> much more approachable for me).
> >> I suffered through one of my cognitive dissonance moments while working with
> >> this project. Most of it lingering ideas of what is expensive to do in java,
> >> vs the way to do it in smalltalk.  Here's my current problem.
> >> I've got an object which has a Margritte set of descriptions and I can call
> >> asComponent and get an editor.
> >> I currently am wrapping that editor with a form and buttons by
> >> using WAComponent>>addValidatedForm however, what I really want to do is add
> >> a third button to that form.  I want new, save, cancel.
> >> I thought I saw a way to do this, but for the life of me now, i can't find
> >> it.
> >>
> >> Any sugesstions?
> >>
> >> Tony Giaccone
> >> _______________________________________________
> >> 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
> >>
> >>
> > _______________________________________________
> > 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
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100212/908b05ec/attachment.htm


More information about the seaside mailing list