I don't think it's possible to call a function from an on-* attribute. The
easier thing would be to have that method on your polymer element, or
listen for the event it triggers and run the method in response to that.

On Fri, Dec 5, 2014 at 1:41 PM, <[email protected]> wrote:

> I would like to call a function straight out of core-ajax - is that
> possible??
>
> I have two search fields each with a 'currentLocation' button. When the
> button is clicked, it requests the current location (lat, lng) from the
> browser (getGeoLocation) and sends lat, lng and output-SearchField to the
> core-ajax.
> It then should display the formatted address in the search field close to
> where the button was clicked.
> (I can catch the results from the php file with addEvent Listener fine but
> in the process, I loose the search field where it should be displayed.)
>
> Here my code, sorry still struggling my way through but I really like the
> potential of Polymer.
>
>  <core-ajax
>    id="getAddressFromLatLng"
>    auto
>    url="php-include/phpAddressFromLatLong.php"
>    method="POST"
>    params='{"lat":"51.339", "lng":"12.373", "SearchField":""}'
>    handleAs="json"
>    on-core-response= "function(){
>        console.log(response);
>        document.getElementById("SearchField").value =
> response.detail.response;
>    }">
>  </core-ajax>
>
>
>
>
>
> Thanks for your help and comments.
>
> 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/a48df216-e2e1-4a95-afdb-4104033c5bb6%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/a48df216-e2e1-4a95-afdb-4104033c5bb6%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/CAJj5OwAWTZJ2__qcPgoK_QtrwJgeCxdT%2BNfEdYRud%3D6b4fCddw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to