Fyi:
http://stackoverflow.com/questions/23063667/troubles-with-multiple-ajax-requests-from-different-instances-of-a-custom-elemen


On Mon, Apr 14, 2014 at 8:42 AM, Eric Bidelman <[email protected]> wrote:

> Can you provide a jsbin of what you're trying to do? It's hard to debug
> code without code :)
>
>
> On Mon, Apr 14, 2014 at 8:04 AM, Riccardo M. <[email protected]> wrote:
>
>> Hi there,
>> I've got the following scenario:
>>
>> - I created two Polymer Elements, let's call them respectively
>> "interpreter" and "viewer"
>>
>> - Basically, the "interpreter" makes an AJAX request to get data with
>> jQuery $.ajax(). When the request is completed, the interpreter processes
>> the answer, and provides it to the "viewer".
>>
>> - When the interpreter finishes to process the data, the "viewer" is
>> registered (just once) and instantiated into the "interpreter" (it is
>> appended to a div inside the "interpreter" template). The "viewer" gets the
>> data from the "interpreter" as attribute directly in the declaration tag
>> (like this: <polymer-viewer data="{json object}></polymer-viewer>).
>>
>> When I declare just one instance of the "interpreter" I've got no problem
>> to display correctly the "viewer".
>> Same result when I declare more than one instance of the "interpreter"
>> with the same URL in the AJAX request.
>>
>> I noticed that when I declare more than one instance of the "interpreter"
>> (hence, when I want to display more than one "viewer") with different URLs
>> in the AJAX request, only the first "interpreter" that receives a response
>> from the AJAX request is able to render correctly the "viewer" (i.e. when
>> the second instance gets the results, the results set is null, although in
>> the declaration tag I can see the attribute with the dataset from the
>> "interpreter").
>>
>> It seems a synchronization problem between the AJAX request and the
>> instantiation/rendering task.
>> In fact, serializing the AJAX requests (setting async = false) both the
>> "viewer" can be rendered.
>>
>> Any suggestions?
>>
>> Thank you :)
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/b8ebe1ab-c92c-4131-a073-343133b91e7e%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/b8ebe1ab-c92c-4131-a073-343133b91e7e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/CACGqRCAghrCU6iDcpDcf%3D510-PkC9G-HF-knu1T3pambVGkUiA%40mail.gmail.com<https://groups.google.com/d/msgid/polymer-dev/CACGqRCAghrCU6iDcpDcf%3D510-PkC9G-HF-knu1T3pambVGkUiA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAHbmOLYrR29P1RvS%3DAuoeP3JnkPO1WvSfxSWgJtipu3uzayzBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to