How to dynamically add to list of sub-components with Ajax?

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

How to dynamically add to list of sub-components with Ajax?

Sophie424
I have domain classes House and Room, and SUComponents HouseView and
RoomView, each directly editable.

HouseView contains (via inst-var) a list of RoomViews and a '++' anchor
which adds a new room to the House.

How do I get the '++' to correctly update only the list of RoomViews in the
browser (via Ajax)? What should #children look like for HouseView?

Thanks.

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

Re: How to dynamically add to list of sub-components with Ajax?

Damien Cassou-3
itsme213 wrote:
> I have domain classes House and Room, and SUComponents HouseView and
> RoomView, each directly editable.
>
> HouseView contains (via inst-var) a list of RoomViews and a '++' anchor
> which adds a new room to the House.
>
> How do I get the '++' to correctly update only the list of RoomViews in
> the browser (via Ajax)? What should #children look like for HouseView?

I don't know about SUComponents but you may try to create a component
rendering a collection of other components. On '++' callback, ask for
this collection component to refresh.

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

Re: How to dynamically add to list of sub-components withAjax?

Sophie424

From: "Damien Cassou" <[hidden email]>
> I don't know about SUComponents but you may try to create a component
> rendering a collection of other components. On '++' callback, ask for this
> collection component to refresh.

By refresh do you mean:

    html render: collectionSubcomponent
?

I can get this to work without ajax. With Ajax it renders fine but the newly
rendered elements are no longer 'active' i.e. they don't have the javascript
bits to activate them. I don't know how to force the re-creation or
re-evaluation of the client-side javascript code associated with each
element.

Thanks for the help.

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