You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by g <g...@gwiki.be> on 2016/02/04 23:52:32 UTC

jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

hello,

I noticed some inconsistent behavior when calling
"jss.require(javascript).invoke(functionname).with(arguments)".

if the call is made inside a construct
"ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
void run(JavaScriptSupport jss);}", the javascript code is NOT
executed, where calling the same code inside void afterRender(){}, it
DOES get executed correctly.

so, I think there is a problem/bug in the code of the current 5.4.0
tapestry when processing the jss.require inside a
JavaScriptCallback...
my code works fine in 5.3.8 when using the jss.addScript() rather than
the jss.require...

I posted sample source code on stackoverflow, but have not gotten any
feedback so far:
http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f

thanks for your feedback, g.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by Chris Poulsen <ma...@nesluop.dk>.
At work we have a product that push javascript commands back to the client
in ajax calls using this technique (T5.4) and it has newer been problematic.

Let me try to explain why I guess the library should be the first place to
look:

I'm guessing that the atmosphere lib plugs into the tapestry processing and
attempts to map between "normal" ajax responses from tapestry and something
that can be delivered through a websocket channel - The library probably
also handles receiving the "something" from the channel on the client side
and determines how to apply the commands from the payload.

Lots of people have the plain JS callback mechanism working correctly,
while you have a pretty complicated piece of code in your setup (a lib that
I'm not even sure is widely used) altering how tapestry output is delivered
and interpreted on the client, possibly performing its own
encoding/decoding of the messages sent. And you are sure that it works
flawlessly, because it seems to be able to perform zone updates correct?

I'm sure that if you can produce a simple failing example without third
party libs. polluting the picture you would have much more luck getting
some responses/the issue fixed... (given that it actually is an issue with
the framework).

-- 
Chris

On Sat, Feb 6, 2016 at 11:13 PM, danny de cock <da...@gmail.com>
wrote:

> the atmos library works fine with the chatdemo page and the table in
> index.java gets updated correctly...
> it seems to me that the jss.require(..).invoke(..).with(..) is not
> executed correctly...
> I think the jss that is triggered through the "new
> JavaScriptCallback().run(JavaScriptSupport jss)" does not function
> correctly...
>
> On 6 February 2016 at 21:45, Chris Poulsen <ma...@nesluop.dk> wrote:
> > Your "onStockPriceReceived2" seems to be triggered from some atmos
> library
> > callback.
> >
> > As your AddPoint button clearly works, then I think it is a stretch to
> say
> > that the callback stuff does not work - It does not work when using the
> > atmos library, but does when called the "normal" way.
> >
> > You should probably start off by making sure that the third party library
> > (atmos) actually works like you expect.
> >
> > --
> > Chris
> >
> >
> >
> > On Sat, Feb 6, 2016 at 9:06 PM, g <g...@gwiki.be> wrote:
> >
> >> hello,
> >>
> >> I stripped down the demo to make it easy to test and illustrate the
> issue
> >> :)
> >>
> >> you can download a working project from
> >>
> >>
> http://gwiki.be/tapestry/tapestry-atmosphere-cometd-demo.5.4.0.simplified.tgz
> >>
> >> after unpacking the tar file and executing `mvn jetty:run`, the page
> >> http://localhost:8080/ will show a graph and a table.
> >>
> >> after a couple of seconds, the table will start showing updates. if
> >> the javascript calls would be executed fine, the graph would follow
> >> the updates shown in the table.
> >>
> >> you will see straightforward feedback in the console where you
> >> executed the mvn jetty:run.
> >>
> >> the javascript code that is added through the addDataPoint call in
> >> line 69 of org.lazan.t5.atmosphere.demo.pages.Index.java is not
> >> executed, where the same call to addDataPoint gets executed when
> >> called by addRandomPoint in afterRender and onSuccess.
> >>
> >> click the 'AddPoint' button a couple of times to confirm that the same
> >> addCallback gets executed correctly when clicked interactively, but
> >> not when called automatically...
> >>
> >> thanks for your feedback, g.
> >>
> >> On 5 February 2016 at 13:33, danny de cock <da...@gmail.com>
> wrote:
> >> > yes, they are ajax calls...  I will produce a stripped-down version of
> >> > the project that illustrates the problem...  when adding a submit
> >> > button that executes the same javascript script or when called from
> >> > afterRender, it works, when called through the onAjaxEvent call, it
> >> > does not...
> >> >
> >> > will upload the source  this evening...
> >> >
> >> > thanks, g.
> >> >
> >> > On 5 February 2016 at 13:00, JumpStart
> >> > <ge...@gmail.com> wrote:
> >> >> Crazy thought, but have you confirmed with a web inspector that your
> >> request is XHR?
> >> >>
> >> >>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
> >> >>>
> >> >>> yes, the js file is a module and is found in META-INF/modules.
> >> >>>
> >> >>> the file looks as follows:
> >> >>> define(["jquery"], function($) {
> >> >>>    var privateFunc = function(args) {
> >> >>>    alert('bingo! it works! ==========');
> >> >>>    var arg=args.arg;
> >> >>>    console.log('arg',arg);
> >> >>>    };
> >> >>>    return { publicFunc: privateFunc};
> >> >>>    });
> >> >>>
> >> >>> this is a simplification of the javascript file of
> >> >>>
> >>
> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
> >> >>>
> >> >>> the difference between my code and probably your and Geoff's code is
> >> >>> that I call the ajaxResponseRender.addCallback(...) directly from an
> >> >>> onAjaxEvent() method and that you are using the ajaxResponseRender
> it
> >> >>> only if request.isXHR() is true:
> >> >>>    void onEventHandler(...) {
> >> >>>        if (request.isXHR()) {
> >> >>>            ajaxResponseRenderer.addCallback(new
> JavaScriptCallback...);
> >> >>>        }
> >> >>>    }
> >> >>>
> >> >>> where my handler is structured without the request test:
> >> >>>    void onEventHandler(...) {
> >> >>>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
> >> >>>    }
> >> >>>
> >> >>> I have already tested whether adding the test would solve the issue,
> >> >>> but to no avail...
> >> >>>
> >> >>> I am porting the cometd-demo from uklance (cf.
> >> >>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this
> is
> >> >>> a push application in which this addCallback structure without the
> >> >>> request.isXHR-test works fine in 5.3.8...
> >> >>>
> >> >>> thanks for your feedback, g.
> >> >>>
> >> >>> On 5 February 2016 at 11:23, Carlos Montero Canabal
> >> >>> <ca...@gmail.com> wrote:
> >> >>>> Hi,
> >> >>>>
> >> >>>> Your js file you required is a js module??? I use many times
> require
> >> in a callback in tapestry 5.4.0 and it works perfect.
> >> >>>>
> >> >>>> Regards
> >> >>>>
> >> >>>> Carlos Montero
> >> >>>>
> >> >>>> Enviado desde mi iPhone
> >> >>>>
> >> >>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
> >> >>>>>
> >> >>>>> hello geoff,
> >> >>>>>
> >> >>>>> thanks for your feedback, and indeed: I believe it looks very much
> >> >>>>> like a tapestry 5.4 bug ;-)
> >> >>>>>
> >> >>>>> thanks & kind regards, g.
> >> >>>>>
> >> >>>>> On 5 February 2016 at 02:00, JumpStart
> >> >>>>> <ge...@gmail.com> wrote:
> >> >>>>>> Sorry, just looked at your stack overflow example and I’m baffled
> >> as to why it wouldn’t work.
> >> >>>>>>
> >> >>>>>> Geoff
> >> >>>>>>
> >> >>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <
> >> geoff.callender.jumpstart@gmail.com> wrote:
> >> >>>>>>>
> >> >>>>>>> Here are some working examples that may help.
> >> >>>>>>>
> >> >>>>>>> In a callback:
> >> >>>>>>>
> >> >>>>>>>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
> >> >>>>>>>
> >> >>>>>>> In afterRender:
> >> >>>>>>>
> >> >>>>>>>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
> >> >>>>>>>
> >> >>>>>>> Geoff
> >> >>>>>>>
> >> >>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
> >> >>>>>>>>
> >> >>>>>>>> hello,
> >> >>>>>>>>
> >> >>>>>>>> I noticed some inconsistent behavior when calling
> >> >>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
> >> >>>>>>>>
> >> >>>>>>>> if the call is made inside a construct
> >> >>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback()
> {public
> >> >>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
> >> >>>>>>>> executed, where calling the same code inside void
> >> afterRender(){}, it
> >> >>>>>>>> DOES get executed correctly.
> >> >>>>>>>>
> >> >>>>>>>> so, I think there is a problem/bug in the code of the current
> >> 5.4.0
> >> >>>>>>>> tapestry when processing the jss.require inside a
> >> >>>>>>>> JavaScriptCallback...
> >> >>>>>>>> my code works fine in 5.3.8 when using the jss.addScript()
> rather
> >> than
> >> >>>>>>>> the jss.require...
> >> >>>>>>>>
> >> >>>>>>>> I posted sample source code on stackoverflow, but have not
> gotten
> >> any
> >> >>>>>>>> feedback so far:
> >> >>>>>>>>
> >>
> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
> >> >>>>>>>>
> >> >>>>>>>> thanks for your feedback, g.
> >> >>>>>>>>
> >> >>>>>>>>
> >> ---------------------------------------------------------------------
> >> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >>>>>>>> For additional commands, e-mail:
> users-help@tapestry.apache.org
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> ---------------------------------------------------------------------
> >> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >> >>>>>
> >> >>>>>
> ---------------------------------------------------------------------
> >> >>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >> >>>>>
> >> >>>>
> >> >>>>
> ---------------------------------------------------------------------
> >> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >> >>>>
> >> >>>
> >> >>>
> ---------------------------------------------------------------------
> >> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >> >>>
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by Basile Chandesris <ba...@free.fr>.
http://callbackhell.com/

Le 06/02/2016 23:13, danny de cock a écrit :
> the atmos library works fine with the chatdemo page and the table in
> index.java gets updated correctly...
> it seems to me that the jss.require(..).invoke(..).with(..) is not
> executed correctly...
> I think the jss that is triggered through the "new
> JavaScriptCallback().run(JavaScriptSupport jss)" does not function
> correctly...
>
> On 6 February 2016 at 21:45, Chris Poulsen <ma...@nesluop.dk> wrote:
>> Your "onStockPriceReceived2" seems to be triggered from some atmos library
>> callback.
>>
>> As your AddPoint button clearly works, then I think it is a stretch to say
>> that the callback stuff does not work - It does not work when using the
>> atmos library, but does when called the "normal" way.
>>
>> You should probably start off by making sure that the third party library
>> (atmos) actually works like you expect.
>>
>> --
>> Chris
>>
>>
>>
>> On Sat, Feb 6, 2016 at 9:06 PM, g <g...@gwiki.be> wrote:
>>
>>> hello,
>>>
>>> I stripped down the demo to make it easy to test and illustrate the issue
>>> :)
>>>
>>> you can download a working project from
>>>
>>> http://gwiki.be/tapestry/tapestry-atmosphere-cometd-demo.5.4.0.simplified.tgz
>>>
>>> after unpacking the tar file and executing `mvn jetty:run`, the page
>>> http://localhost:8080/ will show a graph and a table.
>>>
>>> after a couple of seconds, the table will start showing updates. if
>>> the javascript calls would be executed fine, the graph would follow
>>> the updates shown in the table.
>>>
>>> you will see straightforward feedback in the console where you
>>> executed the mvn jetty:run.
>>>
>>> the javascript code that is added through the addDataPoint call in
>>> line 69 of org.lazan.t5.atmosphere.demo.pages.Index.java is not
>>> executed, where the same call to addDataPoint gets executed when
>>> called by addRandomPoint in afterRender and onSuccess.
>>>
>>> click the 'AddPoint' button a couple of times to confirm that the same
>>> addCallback gets executed correctly when clicked interactively, but
>>> not when called automatically...
>>>
>>> thanks for your feedback, g.
>>>
>>> On 5 February 2016 at 13:33, danny de cock <da...@gmail.com> wrote:
>>>> yes, they are ajax calls...  I will produce a stripped-down version of
>>>> the project that illustrates the problem...  when adding a submit
>>>> button that executes the same javascript script or when called from
>>>> afterRender, it works, when called through the onAjaxEvent call, it
>>>> does not...
>>>>
>>>> will upload the source  this evening...
>>>>
>>>> thanks, g.
>>>>
>>>> On 5 February 2016 at 13:00, JumpStart
>>>> <ge...@gmail.com> wrote:
>>>>> Crazy thought, but have you confirmed with a web inspector that your
>>> request is XHR?
>>>>>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
>>>>>>
>>>>>> yes, the js file is a module and is found in META-INF/modules.
>>>>>>
>>>>>> the file looks as follows:
>>>>>> define(["jquery"], function($) {
>>>>>>     var privateFunc = function(args) {
>>>>>>     alert('bingo! it works! ==========');
>>>>>>     var arg=args.arg;
>>>>>>     console.log('arg',arg);
>>>>>>     };
>>>>>>     return { publicFunc: privateFunc};
>>>>>>     });
>>>>>>
>>>>>> this is a simplification of the javascript file of
>>>>>>
>>> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
>>>>>> the difference between my code and probably your and Geoff's code is
>>>>>> that I call the ajaxResponseRender.addCallback(...) directly from an
>>>>>> onAjaxEvent() method and that you are using the ajaxResponseRender it
>>>>>> only if request.isXHR() is true:
>>>>>>     void onEventHandler(...) {
>>>>>>         if (request.isXHR()) {
>>>>>>             ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>>>>>         }
>>>>>>     }
>>>>>>
>>>>>> where my handler is structured without the request test:
>>>>>>     void onEventHandler(...) {
>>>>>>         ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>>>>>     }
>>>>>>
>>>>>> I have already tested whether adding the test would solve the issue,
>>>>>> but to no avail...
>>>>>>
>>>>>> I am porting the cometd-demo from uklance (cf.
>>>>>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
>>>>>> a push application in which this addCallback structure without the
>>>>>> request.isXHR-test works fine in 5.3.8...
>>>>>>
>>>>>> thanks for your feedback, g.
>>>>>>
>>>>>> On 5 February 2016 at 11:23, Carlos Montero Canabal
>>>>>> <ca...@gmail.com> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Your js file you required is a js module??? I use many times require
>>> in a callback in tapestry 5.4.0 and it works perfect.
>>>>>>> Regards
>>>>>>>
>>>>>>> Carlos Montero
>>>>>>>
>>>>>>> Enviado desde mi iPhone
>>>>>>>
>>>>>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>>>>>>>>
>>>>>>>> hello geoff,
>>>>>>>>
>>>>>>>> thanks for your feedback, and indeed: I believe it looks very much
>>>>>>>> like a tapestry 5.4 bug ;-)
>>>>>>>>
>>>>>>>> thanks & kind regards, g.
>>>>>>>>
>>>>>>>> On 5 February 2016 at 02:00, JumpStart
>>>>>>>> <ge...@gmail.com> wrote:
>>>>>>>>> Sorry, just looked at your stack overflow example and I’m baffled
>>> as to why it wouldn’t work.
>>>>>>>>> Geoff
>>>>>>>>>
>>>>>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <
>>> geoff.callender.jumpstart@gmail.com> wrote:
>>>>>>>>>> Here are some working examples that may help.
>>>>>>>>>>
>>>>>>>>>> In a callback:
>>>>>>>>>>
>>>>>>>>>>
>>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>>>>>>>>> In afterRender:
>>>>>>>>>>
>>>>>>>>>>
>>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>>>>>>>>> Geoff
>>>>>>>>>>
>>>>>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>>>>>>>>>
>>>>>>>>>>> hello,
>>>>>>>>>>>
>>>>>>>>>>> I noticed some inconsistent behavior when calling
>>>>>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>>>>>>>>>
>>>>>>>>>>> if the call is made inside a construct
>>>>>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>>>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>>>>>>>>> executed, where calling the same code inside void
>>> afterRender(){}, it
>>>>>>>>>>> DOES get executed correctly.
>>>>>>>>>>>
>>>>>>>>>>> so, I think there is a problem/bug in the code of the current
>>> 5.4.0
>>>>>>>>>>> tapestry when processing the jss.require inside a
>>>>>>>>>>> JavaScriptCallback...
>>>>>>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather
>>> than
>>>>>>>>>>> the jss.require...
>>>>>>>>>>>
>>>>>>>>>>> I posted sample source code on stackoverflow, but have not gotten
>>> any
>>>>>>>>>>> feedback so far:
>>>>>>>>>>>
>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>>>>>>>>> thanks for your feedback, g.
>>>>>>>>>>>
>>>>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by danny de cock <da...@gmail.com>.
the atmos library works fine with the chatdemo page and the table in
index.java gets updated correctly...
it seems to me that the jss.require(..).invoke(..).with(..) is not
executed correctly...
I think the jss that is triggered through the "new
JavaScriptCallback().run(JavaScriptSupport jss)" does not function
correctly...

On 6 February 2016 at 21:45, Chris Poulsen <ma...@nesluop.dk> wrote:
> Your "onStockPriceReceived2" seems to be triggered from some atmos library
> callback.
>
> As your AddPoint button clearly works, then I think it is a stretch to say
> that the callback stuff does not work - It does not work when using the
> atmos library, but does when called the "normal" way.
>
> You should probably start off by making sure that the third party library
> (atmos) actually works like you expect.
>
> --
> Chris
>
>
>
> On Sat, Feb 6, 2016 at 9:06 PM, g <g...@gwiki.be> wrote:
>
>> hello,
>>
>> I stripped down the demo to make it easy to test and illustrate the issue
>> :)
>>
>> you can download a working project from
>>
>> http://gwiki.be/tapestry/tapestry-atmosphere-cometd-demo.5.4.0.simplified.tgz
>>
>> after unpacking the tar file and executing `mvn jetty:run`, the page
>> http://localhost:8080/ will show a graph and a table.
>>
>> after a couple of seconds, the table will start showing updates. if
>> the javascript calls would be executed fine, the graph would follow
>> the updates shown in the table.
>>
>> you will see straightforward feedback in the console where you
>> executed the mvn jetty:run.
>>
>> the javascript code that is added through the addDataPoint call in
>> line 69 of org.lazan.t5.atmosphere.demo.pages.Index.java is not
>> executed, where the same call to addDataPoint gets executed when
>> called by addRandomPoint in afterRender and onSuccess.
>>
>> click the 'AddPoint' button a couple of times to confirm that the same
>> addCallback gets executed correctly when clicked interactively, but
>> not when called automatically...
>>
>> thanks for your feedback, g.
>>
>> On 5 February 2016 at 13:33, danny de cock <da...@gmail.com> wrote:
>> > yes, they are ajax calls...  I will produce a stripped-down version of
>> > the project that illustrates the problem...  when adding a submit
>> > button that executes the same javascript script or when called from
>> > afterRender, it works, when called through the onAjaxEvent call, it
>> > does not...
>> >
>> > will upload the source  this evening...
>> >
>> > thanks, g.
>> >
>> > On 5 February 2016 at 13:00, JumpStart
>> > <ge...@gmail.com> wrote:
>> >> Crazy thought, but have you confirmed with a web inspector that your
>> request is XHR?
>> >>
>> >>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
>> >>>
>> >>> yes, the js file is a module and is found in META-INF/modules.
>> >>>
>> >>> the file looks as follows:
>> >>> define(["jquery"], function($) {
>> >>>    var privateFunc = function(args) {
>> >>>    alert('bingo! it works! ==========');
>> >>>    var arg=args.arg;
>> >>>    console.log('arg',arg);
>> >>>    };
>> >>>    return { publicFunc: privateFunc};
>> >>>    });
>> >>>
>> >>> this is a simplification of the javascript file of
>> >>>
>> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
>> >>>
>> >>> the difference between my code and probably your and Geoff's code is
>> >>> that I call the ajaxResponseRender.addCallback(...) directly from an
>> >>> onAjaxEvent() method and that you are using the ajaxResponseRender it
>> >>> only if request.isXHR() is true:
>> >>>    void onEventHandler(...) {
>> >>>        if (request.isXHR()) {
>> >>>            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>> >>>        }
>> >>>    }
>> >>>
>> >>> where my handler is structured without the request test:
>> >>>    void onEventHandler(...) {
>> >>>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>> >>>    }
>> >>>
>> >>> I have already tested whether adding the test would solve the issue,
>> >>> but to no avail...
>> >>>
>> >>> I am porting the cometd-demo from uklance (cf.
>> >>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
>> >>> a push application in which this addCallback structure without the
>> >>> request.isXHR-test works fine in 5.3.8...
>> >>>
>> >>> thanks for your feedback, g.
>> >>>
>> >>> On 5 February 2016 at 11:23, Carlos Montero Canabal
>> >>> <ca...@gmail.com> wrote:
>> >>>> Hi,
>> >>>>
>> >>>> Your js file you required is a js module??? I use many times require
>> in a callback in tapestry 5.4.0 and it works perfect.
>> >>>>
>> >>>> Regards
>> >>>>
>> >>>> Carlos Montero
>> >>>>
>> >>>> Enviado desde mi iPhone
>> >>>>
>> >>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>> >>>>>
>> >>>>> hello geoff,
>> >>>>>
>> >>>>> thanks for your feedback, and indeed: I believe it looks very much
>> >>>>> like a tapestry 5.4 bug ;-)
>> >>>>>
>> >>>>> thanks & kind regards, g.
>> >>>>>
>> >>>>> On 5 February 2016 at 02:00, JumpStart
>> >>>>> <ge...@gmail.com> wrote:
>> >>>>>> Sorry, just looked at your stack overflow example and I’m baffled
>> as to why it wouldn’t work.
>> >>>>>>
>> >>>>>> Geoff
>> >>>>>>
>> >>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <
>> geoff.callender.jumpstart@gmail.com> wrote:
>> >>>>>>>
>> >>>>>>> Here are some working examples that may help.
>> >>>>>>>
>> >>>>>>> In a callback:
>> >>>>>>>
>> >>>>>>>
>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>> >>>>>>>
>> >>>>>>> In afterRender:
>> >>>>>>>
>> >>>>>>>
>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>> >>>>>>>
>> >>>>>>> Geoff
>> >>>>>>>
>> >>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>> >>>>>>>>
>> >>>>>>>> hello,
>> >>>>>>>>
>> >>>>>>>> I noticed some inconsistent behavior when calling
>> >>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>> >>>>>>>>
>> >>>>>>>> if the call is made inside a construct
>> >>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>> >>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>> >>>>>>>> executed, where calling the same code inside void
>> afterRender(){}, it
>> >>>>>>>> DOES get executed correctly.
>> >>>>>>>>
>> >>>>>>>> so, I think there is a problem/bug in the code of the current
>> 5.4.0
>> >>>>>>>> tapestry when processing the jss.require inside a
>> >>>>>>>> JavaScriptCallback...
>> >>>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather
>> than
>> >>>>>>>> the jss.require...
>> >>>>>>>>
>> >>>>>>>> I posted sample source code on stackoverflow, but have not gotten
>> any
>> >>>>>>>> feedback so far:
>> >>>>>>>>
>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>> >>>>>>>>
>> >>>>>>>> thanks for your feedback, g.
>> >>>>>>>>
>> >>>>>>>>
>> ---------------------------------------------------------------------
>> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> ---------------------------------------------------------------------
>> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>>
>> >>>>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by Chris Poulsen <ma...@nesluop.dk>.
Your "onStockPriceReceived2" seems to be triggered from some atmos library
callback.

As your AddPoint button clearly works, then I think it is a stretch to say
that the callback stuff does not work - It does not work when using the
atmos library, but does when called the "normal" way.

You should probably start off by making sure that the third party library
(atmos) actually works like you expect.

-- 
Chris



On Sat, Feb 6, 2016 at 9:06 PM, g <g...@gwiki.be> wrote:

> hello,
>
> I stripped down the demo to make it easy to test and illustrate the issue
> :)
>
> you can download a working project from
>
> http://gwiki.be/tapestry/tapestry-atmosphere-cometd-demo.5.4.0.simplified.tgz
>
> after unpacking the tar file and executing `mvn jetty:run`, the page
> http://localhost:8080/ will show a graph and a table.
>
> after a couple of seconds, the table will start showing updates. if
> the javascript calls would be executed fine, the graph would follow
> the updates shown in the table.
>
> you will see straightforward feedback in the console where you
> executed the mvn jetty:run.
>
> the javascript code that is added through the addDataPoint call in
> line 69 of org.lazan.t5.atmosphere.demo.pages.Index.java is not
> executed, where the same call to addDataPoint gets executed when
> called by addRandomPoint in afterRender and onSuccess.
>
> click the 'AddPoint' button a couple of times to confirm that the same
> addCallback gets executed correctly when clicked interactively, but
> not when called automatically...
>
> thanks for your feedback, g.
>
> On 5 February 2016 at 13:33, danny de cock <da...@gmail.com> wrote:
> > yes, they are ajax calls...  I will produce a stripped-down version of
> > the project that illustrates the problem...  when adding a submit
> > button that executes the same javascript script or when called from
> > afterRender, it works, when called through the onAjaxEvent call, it
> > does not...
> >
> > will upload the source  this evening...
> >
> > thanks, g.
> >
> > On 5 February 2016 at 13:00, JumpStart
> > <ge...@gmail.com> wrote:
> >> Crazy thought, but have you confirmed with a web inspector that your
> request is XHR?
> >>
> >>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
> >>>
> >>> yes, the js file is a module and is found in META-INF/modules.
> >>>
> >>> the file looks as follows:
> >>> define(["jquery"], function($) {
> >>>    var privateFunc = function(args) {
> >>>    alert('bingo! it works! ==========');
> >>>    var arg=args.arg;
> >>>    console.log('arg',arg);
> >>>    };
> >>>    return { publicFunc: privateFunc};
> >>>    });
> >>>
> >>> this is a simplification of the javascript file of
> >>>
> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
> >>>
> >>> the difference between my code and probably your and Geoff's code is
> >>> that I call the ajaxResponseRender.addCallback(...) directly from an
> >>> onAjaxEvent() method and that you are using the ajaxResponseRender it
> >>> only if request.isXHR() is true:
> >>>    void onEventHandler(...) {
> >>>        if (request.isXHR()) {
> >>>            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
> >>>        }
> >>>    }
> >>>
> >>> where my handler is structured without the request test:
> >>>    void onEventHandler(...) {
> >>>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
> >>>    }
> >>>
> >>> I have already tested whether adding the test would solve the issue,
> >>> but to no avail...
> >>>
> >>> I am porting the cometd-demo from uklance (cf.
> >>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
> >>> a push application in which this addCallback structure without the
> >>> request.isXHR-test works fine in 5.3.8...
> >>>
> >>> thanks for your feedback, g.
> >>>
> >>> On 5 February 2016 at 11:23, Carlos Montero Canabal
> >>> <ca...@gmail.com> wrote:
> >>>> Hi,
> >>>>
> >>>> Your js file you required is a js module??? I use many times require
> in a callback in tapestry 5.4.0 and it works perfect.
> >>>>
> >>>> Regards
> >>>>
> >>>> Carlos Montero
> >>>>
> >>>> Enviado desde mi iPhone
> >>>>
> >>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
> >>>>>
> >>>>> hello geoff,
> >>>>>
> >>>>> thanks for your feedback, and indeed: I believe it looks very much
> >>>>> like a tapestry 5.4 bug ;-)
> >>>>>
> >>>>> thanks & kind regards, g.
> >>>>>
> >>>>> On 5 February 2016 at 02:00, JumpStart
> >>>>> <ge...@gmail.com> wrote:
> >>>>>> Sorry, just looked at your stack overflow example and I’m baffled
> as to why it wouldn’t work.
> >>>>>>
> >>>>>> Geoff
> >>>>>>
> >>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <
> geoff.callender.jumpstart@gmail.com> wrote:
> >>>>>>>
> >>>>>>> Here are some working examples that may help.
> >>>>>>>
> >>>>>>> In a callback:
> >>>>>>>
> >>>>>>>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
> >>>>>>>
> >>>>>>> In afterRender:
> >>>>>>>
> >>>>>>>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
> >>>>>>>
> >>>>>>> Geoff
> >>>>>>>
> >>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
> >>>>>>>>
> >>>>>>>> hello,
> >>>>>>>>
> >>>>>>>> I noticed some inconsistent behavior when calling
> >>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
> >>>>>>>>
> >>>>>>>> if the call is made inside a construct
> >>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
> >>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
> >>>>>>>> executed, where calling the same code inside void
> afterRender(){}, it
> >>>>>>>> DOES get executed correctly.
> >>>>>>>>
> >>>>>>>> so, I think there is a problem/bug in the code of the current
> 5.4.0
> >>>>>>>> tapestry when processing the jss.require inside a
> >>>>>>>> JavaScriptCallback...
> >>>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather
> than
> >>>>>>>> the jss.require...
> >>>>>>>>
> >>>>>>>> I posted sample source code on stackoverflow, but have not gotten
> any
> >>>>>>>> feedback so far:
> >>>>>>>>
> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
> >>>>>>>>
> >>>>>>>> thanks for your feedback, g.
> >>>>>>>>
> >>>>>>>>
> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by g <g...@gwiki.be>.
hello,

I stripped down the demo to make it easy to test and illustrate the issue :)

you can download a working project from
http://gwiki.be/tapestry/tapestry-atmosphere-cometd-demo.5.4.0.simplified.tgz

after unpacking the tar file and executing `mvn jetty:run`, the page
http://localhost:8080/ will show a graph and a table.

after a couple of seconds, the table will start showing updates. if
the javascript calls would be executed fine, the graph would follow
the updates shown in the table.

you will see straightforward feedback in the console where you
executed the mvn jetty:run.

the javascript code that is added through the addDataPoint call in
line 69 of org.lazan.t5.atmosphere.demo.pages.Index.java is not
executed, where the same call to addDataPoint gets executed when
called by addRandomPoint in afterRender and onSuccess.

click the 'AddPoint' button a couple of times to confirm that the same
addCallback gets executed correctly when clicked interactively, but
not when called automatically...

thanks for your feedback, g.

On 5 February 2016 at 13:33, danny de cock <da...@gmail.com> wrote:
> yes, they are ajax calls...  I will produce a stripped-down version of
> the project that illustrates the problem...  when adding a submit
> button that executes the same javascript script or when called from
> afterRender, it works, when called through the onAjaxEvent call, it
> does not...
>
> will upload the source  this evening...
>
> thanks, g.
>
> On 5 February 2016 at 13:00, JumpStart
> <ge...@gmail.com> wrote:
>> Crazy thought, but have you confirmed with a web inspector that your request is XHR?
>>
>>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
>>>
>>> yes, the js file is a module and is found in META-INF/modules.
>>>
>>> the file looks as follows:
>>> define(["jquery"], function($) {
>>>    var privateFunc = function(args) {
>>>    alert('bingo! it works! ==========');
>>>    var arg=args.arg;
>>>    console.log('arg',arg);
>>>    };
>>>    return { publicFunc: privateFunc};
>>>    });
>>>
>>> this is a simplification of the javascript file of
>>> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
>>>
>>> the difference between my code and probably your and Geoff's code is
>>> that I call the ajaxResponseRender.addCallback(...) directly from an
>>> onAjaxEvent() method and that you are using the ajaxResponseRender it
>>> only if request.isXHR() is true:
>>>    void onEventHandler(...) {
>>>        if (request.isXHR()) {
>>>            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>>        }
>>>    }
>>>
>>> where my handler is structured without the request test:
>>>    void onEventHandler(...) {
>>>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>>    }
>>>
>>> I have already tested whether adding the test would solve the issue,
>>> but to no avail...
>>>
>>> I am porting the cometd-demo from uklance (cf.
>>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
>>> a push application in which this addCallback structure without the
>>> request.isXHR-test works fine in 5.3.8...
>>>
>>> thanks for your feedback, g.
>>>
>>> On 5 February 2016 at 11:23, Carlos Montero Canabal
>>> <ca...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> Your js file you required is a js module??? I use many times require in a callback in tapestry 5.4.0 and it works perfect.
>>>>
>>>> Regards
>>>>
>>>> Carlos Montero
>>>>
>>>> Enviado desde mi iPhone
>>>>
>>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>>>>>
>>>>> hello geoff,
>>>>>
>>>>> thanks for your feedback, and indeed: I believe it looks very much
>>>>> like a tapestry 5.4 bug ;-)
>>>>>
>>>>> thanks & kind regards, g.
>>>>>
>>>>> On 5 February 2016 at 02:00, JumpStart
>>>>> <ge...@gmail.com> wrote:
>>>>>> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>>>>>>
>>>>>> Geoff
>>>>>>
>>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>>>>>>
>>>>>>> Here are some working examples that may help.
>>>>>>>
>>>>>>> In a callback:
>>>>>>>
>>>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>>>>>>
>>>>>>> In afterRender:
>>>>>>>
>>>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>>>>>>
>>>>>>> Geoff
>>>>>>>
>>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>>>>>>
>>>>>>>> hello,
>>>>>>>>
>>>>>>>> I noticed some inconsistent behavior when calling
>>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>>>>>>
>>>>>>>> if the call is made inside a construct
>>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>>>>>> executed, where calling the same code inside void afterRender(){}, it
>>>>>>>> DOES get executed correctly.
>>>>>>>>
>>>>>>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>>>>>>> tapestry when processing the jss.require inside a
>>>>>>>> JavaScriptCallback...
>>>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>>>>>>> the jss.require...
>>>>>>>>
>>>>>>>> I posted sample source code on stackoverflow, but have not gotten any
>>>>>>>> feedback so far:
>>>>>>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>>>>>>
>>>>>>>> thanks for your feedback, g.
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by danny de cock <da...@gmail.com>.
yes, they are ajax calls...  I will produce a stripped-down version of
the project that illustrates the problem...  when adding a submit
button that executes the same javascript script or when called from
afterRender, it works, when called through the onAjaxEvent call, it
does not...

will upload the source  this evening...

thanks, g.

On 5 February 2016 at 13:00, JumpStart
<ge...@gmail.com> wrote:
> Crazy thought, but have you confirmed with a web inspector that your request is XHR?
>
>> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
>>
>> yes, the js file is a module and is found in META-INF/modules.
>>
>> the file looks as follows:
>> define(["jquery"], function($) {
>>    var privateFunc = function(args) {
>>    alert('bingo! it works! ==========');
>>    var arg=args.arg;
>>    console.log('arg',arg);
>>    };
>>    return { publicFunc: privateFunc};
>>    });
>>
>> this is a simplification of the javascript file of
>> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
>>
>> the difference between my code and probably your and Geoff's code is
>> that I call the ajaxResponseRender.addCallback(...) directly from an
>> onAjaxEvent() method and that you are using the ajaxResponseRender it
>> only if request.isXHR() is true:
>>    void onEventHandler(...) {
>>        if (request.isXHR()) {
>>            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>        }
>>    }
>>
>> where my handler is structured without the request test:
>>    void onEventHandler(...) {
>>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>>    }
>>
>> I have already tested whether adding the test would solve the issue,
>> but to no avail...
>>
>> I am porting the cometd-demo from uklance (cf.
>> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
>> a push application in which this addCallback structure without the
>> request.isXHR-test works fine in 5.3.8...
>>
>> thanks for your feedback, g.
>>
>> On 5 February 2016 at 11:23, Carlos Montero Canabal
>> <ca...@gmail.com> wrote:
>>> Hi,
>>>
>>> Your js file you required is a js module??? I use many times require in a callback in tapestry 5.4.0 and it works perfect.
>>>
>>> Regards
>>>
>>> Carlos Montero
>>>
>>> Enviado desde mi iPhone
>>>
>>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>>>>
>>>> hello geoff,
>>>>
>>>> thanks for your feedback, and indeed: I believe it looks very much
>>>> like a tapestry 5.4 bug ;-)
>>>>
>>>> thanks & kind regards, g.
>>>>
>>>> On 5 February 2016 at 02:00, JumpStart
>>>> <ge...@gmail.com> wrote:
>>>>> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>>>>>
>>>>> Geoff
>>>>>
>>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>>>>>
>>>>>> Here are some working examples that may help.
>>>>>>
>>>>>> In a callback:
>>>>>>
>>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>>>>>
>>>>>> In afterRender:
>>>>>>
>>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>>>>>
>>>>>> Geoff
>>>>>>
>>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>>>>>
>>>>>>> hello,
>>>>>>>
>>>>>>> I noticed some inconsistent behavior when calling
>>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>>>>>
>>>>>>> if the call is made inside a construct
>>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>>>>> executed, where calling the same code inside void afterRender(){}, it
>>>>>>> DOES get executed correctly.
>>>>>>>
>>>>>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>>>>>> tapestry when processing the jss.require inside a
>>>>>>> JavaScriptCallback...
>>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>>>>>> the jss.require...
>>>>>>>
>>>>>>> I posted sample source code on stackoverflow, but have not gotten any
>>>>>>> feedback so far:
>>>>>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>>>>>
>>>>>>> thanks for your feedback, g.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by JumpStart <ge...@gmail.com>.
Crazy thought, but have you confirmed with a web inspector that your request is XHR?

> On 5 Feb 2016, at 6:59 PM, g <g...@gwiki.be> wrote:
> 
> yes, the js file is a module and is found in META-INF/modules.
> 
> the file looks as follows:
> define(["jquery"], function($) {
>    var privateFunc = function(args) {
>    alert('bingo! it works! ==========');
>    var arg=args.arg;
>    console.log('arg',arg);
>    };
>    return { publicFunc: privateFunc};
>    });
> 
> this is a simplification of the javascript file of
> https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once
> 
> the difference between my code and probably your and Geoff's code is
> that I call the ajaxResponseRender.addCallback(...) directly from an
> onAjaxEvent() method and that you are using the ajaxResponseRender it
> only if request.isXHR() is true:
>    void onEventHandler(...) {
>        if (request.isXHR()) {
>            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>        }
>    }
> 
> where my handler is structured without the request test:
>    void onEventHandler(...) {
>        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
>    }
> 
> I have already tested whether adding the test would solve the issue,
> but to no avail...
> 
> I am porting the cometd-demo from uklance (cf.
> https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
> a push application in which this addCallback structure without the
> request.isXHR-test works fine in 5.3.8...
> 
> thanks for your feedback, g.
> 
> On 5 February 2016 at 11:23, Carlos Montero Canabal
> <ca...@gmail.com> wrote:
>> Hi,
>> 
>> Your js file you required is a js module??? I use many times require in a callback in tapestry 5.4.0 and it works perfect.
>> 
>> Regards
>> 
>> Carlos Montero
>> 
>> Enviado desde mi iPhone
>> 
>>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>>> 
>>> hello geoff,
>>> 
>>> thanks for your feedback, and indeed: I believe it looks very much
>>> like a tapestry 5.4 bug ;-)
>>> 
>>> thanks & kind regards, g.
>>> 
>>> On 5 February 2016 at 02:00, JumpStart
>>> <ge...@gmail.com> wrote:
>>>> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>>>> 
>>>> Geoff
>>>> 
>>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>>>> 
>>>>> Here are some working examples that may help.
>>>>> 
>>>>> In a callback:
>>>>> 
>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>>>> 
>>>>> In afterRender:
>>>>> 
>>>>>     http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>>>> 
>>>>> Geoff
>>>>> 
>>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>>>> 
>>>>>> hello,
>>>>>> 
>>>>>> I noticed some inconsistent behavior when calling
>>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>>>> 
>>>>>> if the call is made inside a construct
>>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>>>> executed, where calling the same code inside void afterRender(){}, it
>>>>>> DOES get executed correctly.
>>>>>> 
>>>>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>>>>> tapestry when processing the jss.require inside a
>>>>>> JavaScriptCallback...
>>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>>>>> the jss.require...
>>>>>> 
>>>>>> I posted sample source code on stackoverflow, but have not gotten any
>>>>>> feedback so far:
>>>>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>>>> 
>>>>>> thanks for your feedback, g.
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by g <g...@gwiki.be>.
yes, the js file is a module and is found in META-INF/modules.

the file looks as follows:
define(["jquery"], function($) {
    var privateFunc = function(args) {
    alert('bingo! it works! ==========');
    var arg=args.arg;
    console.log('arg',arg);
    };
    return { publicFunc: privateFunc};
    });

this is a simplification of the javascript file of
https://stackoverflow.com/questions/18796381/tapestry-5-4-call-jquery-more-than-once

the difference between my code and probably your and Geoff's code is
that I call the ajaxResponseRender.addCallback(...) directly from an
onAjaxEvent() method and that you are using the ajaxResponseRender it
only if request.isXHR() is true:
    void onEventHandler(...) {
        if (request.isXHR()) {
            ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
        }
    }

where my handler is structured without the request test:
    void onEventHandler(...) {
        ajaxResponseRenderer.addCallback(new JavaScriptCallback...);
    }

I have already tested whether adding the test would solve the issue,
but to no avail...

I am porting the cometd-demo from uklance (cf.
https://github.com/uklance/tapestry-cometd) to tapestry 5.4.  this is
a push application in which this addCallback structure without the
request.isXHR-test works fine in 5.3.8...

thanks for your feedback, g.

On 5 February 2016 at 11:23, Carlos Montero Canabal
<ca...@gmail.com> wrote:
> Hi,
>
> Your js file you required is a js module??? I use many times require in a callback in tapestry 5.4.0 and it works perfect.
>
> Regards
>
> Carlos Montero
>
> Enviado desde mi iPhone
>
>> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
>>
>> hello geoff,
>>
>> thanks for your feedback, and indeed: I believe it looks very much
>> like a tapestry 5.4 bug ;-)
>>
>> thanks & kind regards, g.
>>
>> On 5 February 2016 at 02:00, JumpStart
>> <ge...@gmail.com> wrote:
>>> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>>>
>>> Geoff
>>>
>>>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>>>
>>>> Here are some working examples that may help.
>>>>
>>>> In a callback:
>>>>
>>>>      http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>>>
>>>> In afterRender:
>>>>
>>>>      http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>>>
>>>> Geoff
>>>>
>>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>>>
>>>>> hello,
>>>>>
>>>>> I noticed some inconsistent behavior when calling
>>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>>>
>>>>> if the call is made inside a construct
>>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>>> executed, where calling the same code inside void afterRender(){}, it
>>>>> DOES get executed correctly.
>>>>>
>>>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>>>> tapestry when processing the jss.require inside a
>>>>> JavaScriptCallback...
>>>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>>>> the jss.require...
>>>>>
>>>>> I posted sample source code on stackoverflow, but have not gotten any
>>>>> feedback so far:
>>>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>>>
>>>>> thanks for your feedback, g.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by Carlos Montero Canabal <ca...@gmail.com>.
Hi,

Your js file you required is a js module??? I use many times require in a callback in tapestry 5.4.0 and it works perfect.

Regards

Carlos Montero 

Enviado desde mi iPhone

> El 5 feb 2016, a las 2:15, g <g...@gwiki.be> escribió:
> 
> hello geoff,
> 
> thanks for your feedback, and indeed: I believe it looks very much
> like a tapestry 5.4 bug ;-)
> 
> thanks & kind regards, g.
> 
> On 5 February 2016 at 02:00, JumpStart
> <ge...@gmail.com> wrote:
>> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>> 
>> Geoff
>> 
>>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>> 
>>> Here are some working examples that may help.
>>> 
>>> In a callback:
>>> 
>>>      http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>> 
>>> In afterRender:
>>> 
>>>      http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>> 
>>> Geoff
>>> 
>>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>> 
>>>> hello,
>>>> 
>>>> I noticed some inconsistent behavior when calling
>>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>> 
>>>> if the call is made inside a construct
>>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>>> executed, where calling the same code inside void afterRender(){}, it
>>>> DOES get executed correctly.
>>>> 
>>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>>> tapestry when processing the jss.require inside a
>>>> JavaScriptCallback...
>>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>>> the jss.require...
>>>> 
>>>> I posted sample source code on stackoverflow, but have not gotten any
>>>> feedback so far:
>>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>> 
>>>> thanks for your feedback, g.
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by g <g...@gwiki.be>.
hello geoff,

thanks for your feedback, and indeed: I believe it looks very much
like a tapestry 5.4 bug ;-)

thanks & kind regards, g.

On 5 February 2016 at 02:00, JumpStart
<ge...@gmail.com> wrote:
> Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.
>
> Geoff
>
>> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
>>
>> Here are some working examples that may help.
>>
>> In a callback:
>>
>>       http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>
>> In afterRender:
>>
>>       http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>
>> Geoff
>>
>>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>>>
>>> hello,
>>>
>>> I noticed some inconsistent behavior when calling
>>> "jss.require(javascript).invoke(functionname).with(arguments)".
>>>
>>> if the call is made inside a construct
>>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>>> executed, where calling the same code inside void afterRender(){}, it
>>> DOES get executed correctly.
>>>
>>> so, I think there is a problem/bug in the code of the current 5.4.0
>>> tapestry when processing the jss.require inside a
>>> JavaScriptCallback...
>>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>>> the jss.require...
>>>
>>> I posted sample source code on stackoverflow, but have not gotten any
>>> feedback so far:
>>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>>>
>>> thanks for your feedback, g.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by JumpStart <ge...@gmail.com>.
Sorry, just looked at your stack overflow example and I’m baffled as to why it wouldn’t work.

Geoff

> On 5 Feb 2016, at 8:55 AM, JumpStart <ge...@gmail.com> wrote:
> 
> Here are some working examples that may help.
> 
> In a callback: 
> 
> 	http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
> 
> In afterRender:
> 
> 	http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
> 
> Geoff
> 
>> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
>> 
>> hello,
>> 
>> I noticed some inconsistent behavior when calling
>> "jss.require(javascript).invoke(functionname).with(arguments)".
>> 
>> if the call is made inside a construct
>> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
>> void run(JavaScriptSupport jss);}", the javascript code is NOT
>> executed, where calling the same code inside void afterRender(){}, it
>> DOES get executed correctly.
>> 
>> so, I think there is a problem/bug in the code of the current 5.4.0
>> tapestry when processing the jss.require inside a
>> JavaScriptCallback...
>> my code works fine in 5.3.8 when using the jss.addScript() rather than
>> the jss.require...
>> 
>> I posted sample source code on stackoverflow, but have not gotten any
>> feedback so far:
>> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
>> 
>> thanks for your feedback, g.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

Posted by JumpStart <ge...@gmail.com>.
Here are some working examples that may help.

In a callback: 

	http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1

In afterRender:

	http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust

Geoff

> On 5 Feb 2016, at 6:52 AM, g <g...@gwiki.be> wrote:
> 
> hello,
> 
> I noticed some inconsistent behavior when calling
> "jss.require(javascript).invoke(functionname).with(arguments)".
> 
> if the call is made inside a construct
> "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
> void run(JavaScriptSupport jss);}", the javascript code is NOT
> executed, where calling the same code inside void afterRender(){}, it
> DOES get executed correctly.
> 
> so, I think there is a problem/bug in the code of the current 5.4.0
> tapestry when processing the jss.require inside a
> JavaScriptCallback...
> my code works fine in 5.3.8 when using the jss.addScript() rather than
> the jss.require...
> 
> I posted sample source code on stackoverflow, but have not gotten any
> feedback so far:
> http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
> 
> thanks for your feedback, g.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org