call in child component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

call in child component

Dennis Schetinin
Hello, Seasiders!

1. I render a ('parent') page using:
WAParent >> renderContentOn: html
  | id |
  html form:
    [(html div)
      id: (id := html nextId);
      with: [html render: childComponent].
    (html anchor) with: 'save']

2. A 'childComponent' has an anchor inside:
WAChild >> renderContentOn: html
  ...
  (html div)
    id: 'add';
    with:
      [(html anchor)
        callback: [self addItem];
        with: '+']

3. WAChild >> addItem calls another simple component with some form on it.

THE PROBLEM IS:

Ahcnor 'save' (from a 'parent' component) is rendered at the bottom this form.

Is there a (good) way to get rid of it? ...keeping this nesting of
components, i.e. '+' should remain a part of a 'childComponent'; I
think 'adding new item' is a part of WAChild, not WAParent, as WAChild
can be used in other contexts.


Sorry for my english and thanks in advance for all answers.


--
Dennis Schetinin
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: call in child component

Sebastian Sastre-2
It will depend where you put the #addItem and #save responsibility

        cheers,

Sebastian

 

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Dennis Schetinin
> Enviado el: MiƩrcoles, 19 de Marzo de 2008 11:41
> Para: Seaside - general discussion
> Asunto: [Seaside] call in child component
>
> Hello, Seasiders!
>
> 1. I render a ('parent') page using:
> WAParent >> renderContentOn: html
>   | id |
>   html form:
>     [(html div)
>       id: (id := html nextId);
>       with: [html render: childComponent].
>     (html anchor) with: 'save']
>
> 2. A 'childComponent' has an anchor inside:
> WAChild >> renderContentOn: html
>   ...
>   (html div)
>     id: 'add';
>     with:
>       [(html anchor)
>         callback: [self addItem];
>         with: '+']
>
> 3. WAChild >> addItem calls another simple component with
> some form on it.
>
> THE PROBLEM IS:
>
> Ahcnor 'save' (from a 'parent' component) is rendered at the
> bottom this form.
>
> Is there a (good) way to get rid of it? ...keeping this nesting of
> components, i.e. '+' should remain a part of a 'childComponent'; I
> think 'adding new item' is a part of WAChild, not WAParent, as WAChild
> can be used in other contexts.
>
>
> Sorry for my english and thanks in advance for all answers.
>
>
> --
> Dennis Schetinin
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: call in child component

Philippe Marschall
In reply to this post by Dennis Schetinin
2008/3/19, Dennis Schetinin <[hidden email]>:

> Hello, Seasiders!
>
>  1. I render a ('parent') page using:
>  WAParent >> renderContentOn: html
>   | id |
>   html form:
>     [(html div)
>       id: (id := html nextId);
>       with: [html render: childComponent].
>     (html anchor) with: 'save']
>
>  2. A 'childComponent' has an anchor inside:
>  WAChild >> renderContentOn: html
>   ...
>   (html div)
>     id: 'add';
>     with:
>       [(html anchor)
>         callback: [self addItem];
>         with: '+']
>
>  3. WAChild >> addItem calls another simple component with some form on it.
>
>  THE PROBLEM IS:
>
>  Ahcnor 'save' (from a 'parent' component) is rendered at the bottom this form.
>
>  Is there a (good) way to get rid of it? ...keeping this nesting of
>  components, i.e. '+' should remain a part of a 'childComponent'; I
>  think 'adding new item' is a part of WAChild, not WAParent, as WAChild
>  can be used in other contexts.

http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside