[Seaside] OK to directly call (#renderContentOn: html) of sub-component ?

John Thornborrow john at pinesoft.co.uk
Mon Jan 21 10:08:17 UTC 2008


Sophie,

Forgive my ignorance, but wouldn't it be best and just plain easier to
instantiate and render your child components like so?

renderContentOn: html
  "Parent rendering.."
  self div
    id: 'parent';
    with: [ | child |
      "child rendering"
      child := ChildComponent new options: #('some' 'options').
      html render: child
    ]

Regards,
John.

www.pinesoft.co.uk

itsme213 wrote:
> I read some time ago that a parent component should not directly call 
> #renderContentOn: on its children; instead it should do (html render: 
> child).
> 
> However, I've tried direct calls in a few places and it works OK; also makes 
> my interfaces more uniform, as parent may wants to pass some options into 
> the rendering of its child so often wants to use (child renderOn: html with: 
> options).
> 
> Is there a reason to avoid doing this?
> 
> Parent>>renderContentOn: html
>     html div: 'Parent stuff'.
>     child renderContentOn: html
> 
> Thanks - Sophie 
> 
> 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 


Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA



This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



More information about the seaside mailing list