Cascaded liveUpdates not working?

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

Cascaded liveUpdates not working?

Martin J. Laubach-2
  Should cascaded liveUpdates work or don't they by design? The problem
at hand is the following: I select something from a select box, then
I want some checkboxes to appear. I click on a checkbox and something
should happen immediately.

  However, only the first part reliably works. The second works "sometimes"
when I hit the refresh button on the browser.

  Here's an example of what I want to do:

  LUTest>>initialize
        currentFruit := nil.
        currentActions := OrderedCollection new.

  LUTest>>renderContentOn: html
        html form:
                [(html select)
                        liveCallback:
                                [:v :h |
                                        currentFruit := v.
                                        self renderFruitOn: h];
                        list: #('apple' 'orange' 'banana').
                self renderFruitOn: html].
        self renderActionOn: html

  LUTest>>renderFruitOn: html
        (html div)
                id: 'fruits';
                with:
                    [currentFruit ifNotNil:
                        [#('peel' 'eat' 'cook') do:
                                [:c |
                                | act |
                                act := c , ' ' , currentFruit.
                                (html checkbox)
                                        liveCallback:
                                                [:v :h |
                                                currentActions add: act.
                                                self renderActionOn: h];
                                with: act.
                                html break]]].

  LUTest>>renderActionOn: html
        (html div)
                id: 'actions';
                with:
                    [currentActions do:
                                [:c | html text: c; break]]

  So this should give me a drop down box with fruits, then a couple
of checkboxes, and as soon as I select a checkbox, it should display
the action.

  Am I doing something completely wrong? Is there a known workaround?

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

RE: Cascaded liveUpdates not working?

Bany, Michel
>   Should cascaded liveUpdates work or don't they by design?
> The problem at hand is the following: I select something from
> a select box, then I want some checkboxes to appear. I click
> on a checkbox and something should happen immediately.

Cascaded live updates are designed to work. If it does not,
then we have a bug.

There is a working example at /seaside/tests/async/classic/livetests
entitled "Nested live callbacks". However this example is for
Seaside "classic" and I am afraid that cascading live updates
with the canvas api has never been tested.

You may want to rewrite your fruit example for the classic api
and verify that it works. If it does then you have your work-around

... until this bug is fixed.

HTH,
Michel.

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

Re: Cascaded liveUpdates not working?

Michel Bany

>
> ... until this bug is fixed.
>

Martin,
I believe I fixed the bug, try with SeasideAsync-mb.42 and let me know.
Enjoy,
Michel.




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