Calling a seaside component from a table row

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

Calling a seaside component from a table row

Annick
Hi,

        I would like to call a new component from a table row as in the following

        <tr onclick=« callmycomponent…>

        I have tried

        html tableRow
                onClick: (html jQuery callback: [self callMyComponent])

        but the callback is called and I stay on the same page

        Best regards

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

Re: Calling a seaside component from a table row

Karsten Kusche
Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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: Calling a seaside component from a table row

Annick
Thank you Karsten,

Do you have any suggestion then outside putting an anchor in each cell ?

Kind regards

Annick

Le 4 févr. 2021 à 10:45, Karsten Kusche <[hidden email]> a écrit :

Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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: Calling a seaside component from a table row

Karsten Kusche
Typically you use #call: to have the original component replace itself with another component and then this other component decides when to return by calling #answer:.

If you move this task to the surrounding component, it can replace the sub-component any time, without the need for a #call:. This approach should be possible from Ajax, too: you basically replace the component and redraw the cell.

Karsten 

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:46:41, List ([hidden email]) schrieb:

Thank you Karsten,

Do you have any suggestion then outside putting an anchor in each cell ?

Kind regards

Annick

Le 4 févr. 2021 à 10:45, Karsten Kusche <[hidden email]> a écrit :

Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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: Calling a seaside component from a table row

Esteban A. Maringolo
Hi Annick,

It is exactly as Karsten suggests, you usually replace a component by another one, depending on your needs you might use the call/answer, show or simply replace the component (the most common use).


 html tableRow
                onClick: ((html jQuery id: 'containerId') ajax html: [:h | h render: YourComponent new]);

this will render YourComponent within a <div> with id 'containerId', that must exist in the DOM before making the call.

regards

Esteban A. Maringolo


On Thu, Feb 4, 2021 at 8:51 AM Karsten Kusche <[hidden email]> wrote:
Typically you use #call: to have the original component replace itself with another component and then this other component decides when to return by calling #answer:.

If you move this task to the surrounding component, it can replace the sub-component any time, without the need for a #call:. This approach should be possible from Ajax, too: you basically replace the component and redraw the cell.

Karsten 

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:46:41, List ([hidden email]) schrieb:

Thank you Karsten,

Do you have any suggestion then outside putting an anchor in each cell ?

Kind regards

Annick

Le 4 févr. 2021 à 10:45, Karsten Kusche <[hidden email]> a écrit :

Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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

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

Re: Calling a seaside component from a table row

Annick
Hi Esteban,

Thank you for the update, but my web pages are big, and having all of them in one single DOM will be huge.
Otherwise, this was helpful.
Kind regards

Annick


Le 4 févr. 2021 à 15:40, Esteban Maringolo <[hidden email]> a écrit :

Hi Annick,

It is exactly as Karsten suggests, you usually replace a component by another one, depending on your needs you might use the call/answer, show or simply replace the component (the most common use).


 html tableRow
                onClick: ((html jQuery id: 'containerId') ajax html: [:h | h render: YourComponent new]);

this will render YourComponent within a <div> with id 'containerId', that must exist in the DOM before making the call.

regards

Esteban A. Maringolo


On Thu, Feb 4, 2021 at 8:51 AM Karsten Kusche <[hidden email]> wrote:
Typically you use #call: to have the original component replace itself with another component and then this other component decides when to return by calling #answer:.

If you move this task to the surrounding component, it can replace the sub-component any time, without the need for a #call:. This approach should be possible from Ajax, too: you basically replace the component and redraw the cell.

Karsten 

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:46:41, List ([hidden email]) schrieb:

Thank you Karsten,

Do you have any suggestion then outside putting an anchor in each cell ?

Kind regards

Annick

Le 4 févr. 2021 à 10:45, Karsten Kusche <[hidden email]> a écrit :

Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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
_______________________________________________
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: Calling a seaside component from a table row

Karsten Kusche
Hi Annick,

Esteban said the „container-id“ has to be in the DOM. The new components will only be rendered when requested via Ajax.

Kind regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 15:44:45, List ([hidden email]) schrieb:

Hi Esteban,

Thank you for the update, but my web pages are big, and having all of them in one single DOM will be huge.
Otherwise, this was helpful.
Kind regards

Annick


Le 4 févr. 2021 à 15:40, Esteban Maringolo <[hidden email]> a écrit :

Hi Annick,

It is exactly as Karsten suggests, you usually replace a component by another one, depending on your needs you might use the call/answer, show or simply replace the component (the most common use).


 html tableRow
                onClick: ((html jQuery id: 'containerId') ajax html: [:h | h render: YourComponent new]);

this will render YourComponent within a <div> with id 'containerId', that must exist in the DOM before making the call.

regards

Esteban A. Maringolo


On Thu, Feb 4, 2021 at 8:51 AM Karsten Kusche <[hidden email]> wrote:
Typically you use #call: to have the original component replace itself with another component and then this other component decides when to return by calling #answer:.

If you move this task to the surrounding component, it can replace the sub-component any time, without the need for a #call:. This approach should be possible from Ajax, too: you basically replace the component and redraw the cell.

Karsten 

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:46:41, List ([hidden email]) schrieb:

Thank you Karsten,

Do you have any suggestion then outside putting an anchor in each cell ?

Kind regards

Annick

Le 4 févr. 2021 à 10:45, Karsten Kusche <[hidden email]> a écrit :

Hi Annick,

performing a #call: from within a Ajax callback typically doesn’t work in Seaside.

Kind Regards
Karsten

— 

Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 4. Februar 2021 um 10:42:44, List ([hidden email]) schrieb:

Hi,

I would like to call a new component from a table row as in the following

<tr onclick=« callmycomponent…>

I have tried

html tableRow
onClick: (html jQuery callback: [self callMyComponent])

but the callback is called and I stay on the same page

Best regards

Annick
_______________________________________________
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
_______________________________________________
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

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