Ajax + callbacks

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

Ajax + callbacks

Bernat Romagosa
Hi list,

I've got a problem when rendering a component on an AJAX dialog, I have a table where there is an anchor in each row containing the following (among other stuff):

| id |
(html div)
id: (id := html nextId);
script:
((html jQuery new dialog)
html: (AComponent new withParameter: anObject);
title: anObject objectName).
html
tableData: [ 
(html anchor)
onClick: (html jQuery id: id) dialog open;
with: 'Open my component for anObject in a dialog box' ]

Now, this works perfectly, but AComponent should also be able to call other simple components and handle their callbacks. Not only this, but it contains a form and it should be able to handle its own callbacks without disappearing. Adding these small subcomponents to AComponent's children doesn't help, could someone please point out the way to proceed or give me some example/documentation?

Thanks a lot!

Bernat Romagosa.

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

Re: Ajax + callbacks

Bart Veenstra
Hi Bernat,

You could render the AComponent in the containing div. This div is
hidden automatically by jQuery and all callbacks are correctly
registered when rendering the page.

i.e.

| id |
        (html div)
                id: (id := html nextId);
                script:
                                ((html jQuery new dialog)
                                                autoOpen: false.
                                                title: anObject objectName);
.              with: [html render: (AComponent new withParameter: anObject) ].


have you tried this?

Regards.

Bart


2010/9/24 AxiNat <[hidden email]>:

> Hi list,
> I've got a problem when rendering a component on an AJAX dialog, I have a
> table where there is an anchor in each row containing the following (among
> other stuff):
> | id |
> (html div)
> id: (id := html nextId);
> script:
> ((html jQuery new dialog)
> html: (AComponent new withParameter: anObject);
> title: anObject objectName).
> html
> tableData: [
> (html anchor)
> onClick: (html jQuery id: id) dialog open;
> with: 'Open my component for anObject in a dialog box' ]
> Now, this works perfectly, but AComponent should also be able to call other
> simple components and handle their callbacks. Not only this, but it contains
> a form and it should be able to handle its own callbacks without
> disappearing. Adding these small subcomponents to AComponent's children
> doesn't help, could someone please point out the way to proceed or give me
> some example/documentation?
> Thanks a lot!
> Bernat Romagosa.
> _______________________________________________
> 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: Ajax callbacks

Robert Sirois
In reply to this post by Bernat Romagosa
Unless you render everything in that div (the dialog) within the #with: or render another component in there, sometimes it's easier to separate out everything into their own components.

RS


From: [hidden email]
Date: Fri, 24 Sep 2010 13:15:04 +0200
To: [hidden email]
Subject: [Seaside] Ajax + callbacks

Hi list,

I've got a problem when rendering a component on an AJAX dialog, I have a table where there is an anchor in each row containing the following (among other stuff):

| id |
(html div)
id: (id := html nextId);
script:
((html jQuery new dialog)
html: (AComponent new withParameter: anObject);
title: anObject objectName).
html
tableData: [ 
(html anchor)
onClick: (html jQuery id: id) dialog open;
with: 'Open my component for anObject in a dialog box' ]

Now, this works perfectly, but AComponent should also be able to call other simple components and handle their callbacks. Not only this, but it contains a form and it should be able to handle its own callbacks without disappearing. Adding these small subcomponents to AComponent's children doesn't help, could someone please point out the way to proceed or give me some example/documentation?

Thanks a lot!

Bernat Romagosa.

_______________________________________________ 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