how to pass geolocation coords as hidden values in login form

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to pass geolocation coords as hidden values in login form

Qbyte Consulting
Hi,

Does anyone have an idea how to pass latitude and longitude as hidden
values in a login for with T5.4, or any other tricks to get this data into
a component?

John
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Nathan Quirynen
Hi

I guess you could do something like the following:

Create a component just containing two hidden fields and in the after
render event of this component run a javascript module where you get the
longitude and latitude and set these values to your hidden fields.
Add two parameters (latitude and longitude) to the components java class
to which you pass the latitude and longitude properties from your page
that have to be set when submitting the form. Use these parameters in
your component as the values for your hidden fields.
Then you can add this component inside any form where you need.

Nathan


On 30/08/16 01:10, Qbyte Consulting wrote:
> Hi,
>
> Does anyone have an idea how to pass latitude and longitude as hidden
> values in a login for with T5.4, or any other tricks to get this data into
> a component?
>
> John
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Qbyte Consulting
Thanks Nathan,

I want to drive the process from the submission of the login form, not from
the render process. So I could fire some JavaScript after the login
succeeds but how does the JS push the data to the page? Maybe I could use
an entirely hidden form and submit it from the JS?

John

On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
[hidden email]> wrote:

> Hi
>
> I guess you could do something like the following:
>
> Create a component just containing two hidden fields and in the after
> render event of this component run a javascript module where you get the
> longitude and latitude and set these values to your hidden fields.
> Add two parameters (latitude and longitude) to the components java class
> to which you pass the latitude and longitude properties from your page that
> have to be set when submitting the form. Use these parameters in your
> component as the values for your hidden fields.
> Then you can add this component inside any form where you need.
>
> Nathan
>
>
>
> On 30/08/16 01:10, Qbyte Consulting wrote:
>
>> Hi,
>>
>> Does anyone have an idea how to pass latitude and longitude as hidden
>> values in a login for with T5.4, or any other tricks to get this data into
>> a component?
>>
>> John
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Qbyte Consulting
In reply to this post by Nathan Quirynen
I get JS to populate the hidden form fields, they are passed as parameters
to the page, but they are empty strings?

function locate() {
    //Geolocation
    if (navigator.geolocation) {
        navigator.geolocation
                .getCurrentPosition(function (position)
                {
                    $("#latitude").val(position.coords.latitude.toString());

$("#longitude").val(position.coords.longitude.toString());
                }, geoError);
        $("#locateForm").submit();
    }
}

On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
[hidden email]> wrote:

> Hi
>
> I guess you could do something like the following:
>
> Create a component just containing two hidden fields and in the after
> render event of this component run a javascript module where you get the
> longitude and latitude and set these values to your hidden fields.
> Add two parameters (latitude and longitude) to the components java class
> to which you pass the latitude and longitude properties from your page that
> have to be set when submitting the form. Use these parameters in your
> component as the values for your hidden fields.
> Then you can add this component inside any form where you need.
>
> Nathan
>
>
>
> On 30/08/16 01:10, Qbyte Consulting wrote:
>
>> Hi,
>>
>> Does anyone have an idea how to pass latitude and longitude as hidden
>> values in a login for with T5.4, or any other tricks to get this data into
>> a component?
>>
>> John
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Chris Poulsen
Use a form, request parameters or url context - The usual way of sending
data to the server.

--
Chris

On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
[hidden email]> wrote:

> I get JS to populate the hidden form fields, they are passed as parameters
> to the page, but they are empty strings?
>
> function locate() {
>     //Geolocation
>     if (navigator.geolocation) {
>         navigator.geolocation
>                 .getCurrentPosition(function (position)
>                 {
>                     $("#latitude").val(position.
> coords.latitude.toString());
>
> $("#longitude").val(position.coords.longitude.toString());
>                 }, geoError);
>         $("#locateForm").submit();
>     }
> }
>
> On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
> [hidden email]> wrote:
>
> > Hi
> >
> > I guess you could do something like the following:
> >
> > Create a component just containing two hidden fields and in the after
> > render event of this component run a javascript module where you get the
> > longitude and latitude and set these values to your hidden fields.
> > Add two parameters (latitude and longitude) to the components java class
> > to which you pass the latitude and longitude properties from your page
> that
> > have to be set when submitting the form. Use these parameters in your
> > component as the values for your hidden fields.
> > Then you can add this component inside any form where you need.
> >
> > Nathan
> >
> >
> >
> > On 30/08/16 01:10, Qbyte Consulting wrote:
> >
> >> Hi,
> >>
> >> Does anyone have an idea how to pass latitude and longitude as hidden
> >> values in a login for with T5.4, or any other tricks to get this data
> into
> >> a component?
> >>
> >> John
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Qbyte Consulting
I could not get the form method to work, so ended up passing an eventlink
url to my javascript and adding parameters to it. Works a treat and simple.

                Link link =
componentResources.createEventLink("geolocation", null);
                final String eventLinkURI = link.toAbsoluteURI();
                ajaxResponseRenderer.addCallback(new JavaScriptCallback() {
                    @Override
                    public void run(JavaScriptSupport javascriptSupport) {
                        javascriptSupport.addScript(
                                "locate('" + eventLinkURI + "');");
                    }
                });


function locate(eventLinkURI) {
    if (navigator.geolocation) {
        navigator.geolocation
                .getCurrentPosition(function (position)
                {
                    var geolink = eventLinkURI
                        + "?lat=" + position.coords.latitude
                        + "&long=" + position.coords.longitude;
                    $.ajax({url: geolink});
                }, geoError);
    }
}


On Tue, Aug 30, 2016 at 12:11 PM, Chris Poulsen <[hidden email]>
wrote:

> Use a form, request parameters or url context - The usual way of sending
> data to the server.
>
> --
> Chris
>
> On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
> [hidden email]> wrote:
>
> > I get JS to populate the hidden form fields, they are passed as
> parameters
> > to the page, but they are empty strings?
> >
> > function locate() {
> >     //Geolocation
> >     if (navigator.geolocation) {
> >         navigator.geolocation
> >                 .getCurrentPosition(function (position)
> >                 {
> >                     $("#latitude").val(position.
> > coords.latitude.toString());
> >
> > $("#longitude").val(position.coords.longitude.toString());
> >                 }, geoError);
> >         $("#locateForm").submit();
> >     }
> > }
> >
> > On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
> > [hidden email]> wrote:
> >
> > > Hi
> > >
> > > I guess you could do something like the following:
> > >
> > > Create a component just containing two hidden fields and in the after
> > > render event of this component run a javascript module where you get
> the
> > > longitude and latitude and set these values to your hidden fields.
> > > Add two parameters (latitude and longitude) to the components java
> class
> > > to which you pass the latitude and longitude properties from your page
> > that
> > > have to be set when submitting the form. Use these parameters in your
> > > component as the values for your hidden fields.
> > > Then you can add this component inside any form where you need.
> > >
> > > Nathan
> > >
> > >
> > >
> > > On 30/08/16 01:10, Qbyte Consulting wrote:
> > >
> > >> Hi,
> > >>
> > >> Does anyone have an idea how to pass latitude and longitude as hidden
> > >> values in a login for with T5.4, or any other tricks to get this data
> > into
> > >> a component?
> > >>
> > >> John
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Chris Poulsen
The javaScriptSupport.addScript is deprectated in 5.4 iirc.

Instead I would use a module for the locate function, the url can be passed
as an init parameter to require or stored somewhere in the DOM (the former
probably makes the most sense in this case.

Also I would use the tapestry ajax module (
http://tapestry.apache.org/current/coffeescript/ajax.html) instead of
$.ajax as that will give you some code that understands the responses that
tapestry may generate in from an event handler (error screen, additional
stuff added using ajaxResponseRenderer etc.)

There is also a helper for adding url parameters (
http://tapestry.apache.org/current/coffeescript/utils.html)

--
Chris


On Wed, Aug 31, 2016 at 1:19 AM, Qbyte Consulting <[hidden email]
> wrote:

> I could not get the form method to work, so ended up passing an eventlink
> url to my javascript and adding parameters to it. Works a treat and simple.
>
>                 Link link =
> componentResources.createEventLink("geolocation", null);
>                 final String eventLinkURI = link.toAbsoluteURI();
>                 ajaxResponseRenderer.addCallback(new JavaScriptCallback()
> {
>                     @Override
>                     public void run(JavaScriptSupport javascriptSupport) {
>                         javascriptSupport.addScript(
>                                 "locate('" + eventLinkURI + "');");
>                     }
>                 });
>
>
> function locate(eventLinkURI) {
>     if (navigator.geolocation) {
>         navigator.geolocation
>                 .getCurrentPosition(function (position)
>                 {
>                     var geolink = eventLinkURI
>                         + "?lat=" + position.coords.latitude
>                         + "&long=" + position.coords.longitude;
>                     $.ajax({url: geolink});
>                 }, geoError);
>     }
> }
>
>
> On Tue, Aug 30, 2016 at 12:11 PM, Chris Poulsen <[hidden email]>
> wrote:
>
> > Use a form, request parameters or url context - The usual way of sending
> > data to the server.
> >
> > --
> > Chris
> >
> > On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
> > [hidden email]> wrote:
> >
> > > I get JS to populate the hidden form fields, they are passed as
> > parameters
> > > to the page, but they are empty strings?
> > >
> > > function locate() {
> > >     //Geolocation
> > >     if (navigator.geolocation) {
> > >         navigator.geolocation
> > >                 .getCurrentPosition(function (position)
> > >                 {
> > >                     $("#latitude").val(position.
> > > coords.latitude.toString());
> > >
> > > $("#longitude").val(position.coords.longitude.toString());
> > >                 }, geoError);
> > >         $("#locateForm").submit();
> > >     }
> > > }
> > >
> > > On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
> > > [hidden email]> wrote:
> > >
> > > > Hi
> > > >
> > > > I guess you could do something like the following:
> > > >
> > > > Create a component just containing two hidden fields and in the after
> > > > render event of this component run a javascript module where you get
> > the
> > > > longitude and latitude and set these values to your hidden fields.
> > > > Add two parameters (latitude and longitude) to the components java
> > class
> > > > to which you pass the latitude and longitude properties from your
> page
> > > that
> > > > have to be set when submitting the form. Use these parameters in your
> > > > component as the values for your hidden fields.
> > > > Then you can add this component inside any form where you need.
> > > >
> > > > Nathan
> > > >
> > > >
> > > >
> > > > On 30/08/16 01:10, Qbyte Consulting wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> Does anyone have an idea how to pass latitude and longitude as
> hidden
> > > >> values in a login for with T5.4, or any other tricks to get this
> data
> > > into
> > > >> a component?
> > > >>
> > > >> John
> > > >>
> > > >>
> > > >
> > > > ------------------------------------------------------------
> ---------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Qbyte Consulting
Thank you. Where can I find sample code implementing these suggestions or similar?

Sent from my iPhone

> On 31 Aug 2016, at 08:07, Chris Poulsen <[hidden email]> wrote:
>
> The javaScriptSupport.addScript is deprectated in 5.4 iirc.
>
> Instead I would use a module for the locate function, the url can be passed
> as an init parameter to require or stored somewhere in the DOM (the former
> probably makes the most sense in this case.
>
> Also I would use the tapestry ajax module (
> http://tapestry.apache.org/current/coffeescript/ajax.html) instead of
> $.ajax as that will give you some code that understands the responses that
> tapestry may generate in from an event handler (error screen, additional
> stuff added using ajaxResponseRenderer etc.)
>
> There is also a helper for adding url parameters (
> http://tapestry.apache.org/current/coffeescript/utils.html)
>
> --
> Chris
>
>
> On Wed, Aug 31, 2016 at 1:19 AM, Qbyte Consulting <[hidden email]
>> wrote:
>
>> I could not get the form method to work, so ended up passing an eventlink
>> url to my javascript and adding parameters to it. Works a treat and simple.
>>
>>                Link link =
>> componentResources.createEventLink("geolocation", null);
>>                final String eventLinkURI = link.toAbsoluteURI();
>>                ajaxResponseRenderer.addCallback(new JavaScriptCallback()
>> {
>>                    @Override
>>                    public void run(JavaScriptSupport javascriptSupport) {
>>                        javascriptSupport.addScript(
>>                                "locate('" + eventLinkURI + "');");
>>                    }
>>                });
>>
>>
>> function locate(eventLinkURI) {
>>    if (navigator.geolocation) {
>>        navigator.geolocation
>>                .getCurrentPosition(function (position)
>>                {
>>                    var geolink = eventLinkURI
>>                        + "?lat=" + position.coords.latitude
>>                        + "&long=" + position.coords.longitude;
>>                    $.ajax({url: geolink});
>>                }, geoError);
>>    }
>> }
>>
>>
>> On Tue, Aug 30, 2016 at 12:11 PM, Chris Poulsen <[hidden email]>
>> wrote:
>>
>>> Use a form, request parameters or url context - The usual way of sending
>>> data to the server.
>>>
>>> --
>>> Chris
>>>
>>> On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
>>> [hidden email]> wrote:
>>>
>>>> I get JS to populate the hidden form fields, they are passed as
>>> parameters
>>>> to the page, but they are empty strings?
>>>>
>>>> function locate() {
>>>>    //Geolocation
>>>>    if (navigator.geolocation) {
>>>>        navigator.geolocation
>>>>                .getCurrentPosition(function (position)
>>>>                {
>>>>                    $("#latitude").val(position.
>>>> coords.latitude.toString());
>>>>
>>>> $("#longitude").val(position.coords.longitude.toString());
>>>>                }, geoError);
>>>>        $("#locateForm").submit();
>>>>    }
>>>> }
>>>>
>>>> On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
>>>> [hidden email]> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I guess you could do something like the following:
>>>>>
>>>>> Create a component just containing two hidden fields and in the after
>>>>> render event of this component run a javascript module where you get
>>> the
>>>>> longitude and latitude and set these values to your hidden fields.
>>>>> Add two parameters (latitude and longitude) to the components java
>>> class
>>>>> to which you pass the latitude and longitude properties from your
>> page
>>>> that
>>>>> have to be set when submitting the form. Use these parameters in your
>>>>> component as the values for your hidden fields.
>>>>> Then you can add this component inside any form where you need.
>>>>>
>>>>> Nathan
>>>>>
>>>>>
>>>>>
>>>>>> On 30/08/16 01:10, Qbyte Consulting wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Does anyone have an idea how to pass latitude and longitude as
>> hidden
>>>>>> values in a login for with T5.4, or any other tricks to get this
>> data
>>>> into
>>>>>> a component?
>>>>>>
>>>>>> John
>>>>>
>>>>> ------------------------------------------------------------
>> ---------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Qbyte Consulting
In reply to this post by Chris Poulsen
How can I trigger the locate function from the component Java after login success, what replaces .addScript?

Sent from my iPhone

> On 31 Aug 2016, at 08:07, Chris Poulsen <[hidden email]> wrote:
>
> The javaScriptSupport.addScript is deprectated in 5.4 iirc.
>
> Instead I would use a module for the locate function, the url can be passed
> as an init parameter to require or stored somewhere in the DOM (the former
> probably makes the most sense in this case.
>
> Also I would use the tapestry ajax module (
> http://tapestry.apache.org/current/coffeescript/ajax.html) instead of
> $.ajax as that will give you some code that understands the responses that
> tapestry may generate in from an event handler (error screen, additional
> stuff added using ajaxResponseRenderer etc.)
>
> There is also a helper for adding url parameters (
> http://tapestry.apache.org/current/coffeescript/utils.html)
>
> --
> Chris
>
>
> On Wed, Aug 31, 2016 at 1:19 AM, Qbyte Consulting <[hidden email]
>> wrote:
>
>> I could not get the form method to work, so ended up passing an eventlink
>> url to my javascript and adding parameters to it. Works a treat and simple.
>>
>>                Link link =
>> componentResources.createEventLink("geolocation", null);
>>                final String eventLinkURI = link.toAbsoluteURI();
>>                ajaxResponseRenderer.addCallback(new JavaScriptCallback()
>> {
>>                    @Override
>>                    public void run(JavaScriptSupport javascriptSupport) {
>>                        javascriptSupport.addScript(
>>                                "locate('" + eventLinkURI + "');");
>>                    }
>>                });
>>
>>
>> function locate(eventLinkURI) {
>>    if (navigator.geolocation) {
>>        navigator.geolocation
>>                .getCurrentPosition(function (position)
>>                {
>>                    var geolink = eventLinkURI
>>                        + "?lat=" + position.coords.latitude
>>                        + "&long=" + position.coords.longitude;
>>                    $.ajax({url: geolink});
>>                }, geoError);
>>    }
>> }
>>
>>
>> On Tue, Aug 30, 2016 at 12:11 PM, Chris Poulsen <[hidden email]>
>> wrote:
>>
>>> Use a form, request parameters or url context - The usual way of sending
>>> data to the server.
>>>
>>> --
>>> Chris
>>>
>>> On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
>>> [hidden email]> wrote:
>>>
>>>> I get JS to populate the hidden form fields, they are passed as
>>> parameters
>>>> to the page, but they are empty strings?
>>>>
>>>> function locate() {
>>>>    //Geolocation
>>>>    if (navigator.geolocation) {
>>>>        navigator.geolocation
>>>>                .getCurrentPosition(function (position)
>>>>                {
>>>>                    $("#latitude").val(position.
>>>> coords.latitude.toString());
>>>>
>>>> $("#longitude").val(position.coords.longitude.toString());
>>>>                }, geoError);
>>>>        $("#locateForm").submit();
>>>>    }
>>>> }
>>>>
>>>> On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
>>>> [hidden email]> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I guess you could do something like the following:
>>>>>
>>>>> Create a component just containing two hidden fields and in the after
>>>>> render event of this component run a javascript module where you get
>>> the
>>>>> longitude and latitude and set these values to your hidden fields.
>>>>> Add two parameters (latitude and longitude) to the components java
>>> class
>>>>> to which you pass the latitude and longitude properties from your
>> page
>>>> that
>>>>> have to be set when submitting the form. Use these parameters in your
>>>>> component as the values for your hidden fields.
>>>>> Then you can add this component inside any form where you need.
>>>>>
>>>>> Nathan
>>>>>
>>>>>
>>>>>
>>>>>> On 30/08/16 01:10, Qbyte Consulting wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Does anyone have an idea how to pass latitude and longitude as
>> hidden
>>>>>> values in a login for with T5.4, or any other tricks to get this
>> data
>>>> into
>>>>>> a component?
>>>>>>
>>>>>> John
>>>>>
>>>>> ------------------------------------------------------------
>> ---------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how to pass geolocation coords as hidden values in login form

Chris Poulsen
javascriptSupport.require( "<module name>" ).with( <args> ) - if your
module returns a function
javascriptSupport.require( "<module name>" ).invoke( "<method name>"
).with( "<args>" ) if your module export named functions

Take a look at the t5 sources to see how things are used.

--
Chris

On Wed, Aug 31, 2016 at 9:36 AM, Qbyte Consulting <[hidden email]
> wrote:

> How can I trigger the locate function from the component Java after login
> success, what replaces .addScript?
>
> Sent from my iPhone
>
> > On 31 Aug 2016, at 08:07, Chris Poulsen <[hidden email]> wrote:
> >
> > The javaScriptSupport.addScript is deprectated in 5.4 iirc.
> >
> > Instead I would use a module for the locate function, the url can be
> passed
> > as an init parameter to require or stored somewhere in the DOM (the
> former
> > probably makes the most sense in this case.
> >
> > Also I would use the tapestry ajax module (
> > http://tapestry.apache.org/current/coffeescript/ajax.html) instead of
> > $.ajax as that will give you some code that understands the responses
> that
> > tapestry may generate in from an event handler (error screen, additional
> > stuff added using ajaxResponseRenderer etc.)
> >
> > There is also a helper for adding url parameters (
> > http://tapestry.apache.org/current/coffeescript/utils.html)
> >
> > --
> > Chris
> >
> >
> > On Wed, Aug 31, 2016 at 1:19 AM, Qbyte Consulting <
> [hidden email]
> >> wrote:
> >
> >> I could not get the form method to work, so ended up passing an
> eventlink
> >> url to my javascript and adding parameters to it. Works a treat and
> simple.
> >>
> >>                Link link =
> >> componentResources.createEventLink("geolocation", null);
> >>                final String eventLinkURI = link.toAbsoluteURI();
> >>                ajaxResponseRenderer.addCallback(new
> JavaScriptCallback()
> >> {
> >>                    @Override
> >>                    public void run(JavaScriptSupport javascriptSupport)
> {
> >>                        javascriptSupport.addScript(
> >>                                "locate('" + eventLinkURI + "');");
> >>                    }
> >>                });
> >>
> >>
> >> function locate(eventLinkURI) {
> >>    if (navigator.geolocation) {
> >>        navigator.geolocation
> >>                .getCurrentPosition(function (position)
> >>                {
> >>                    var geolink = eventLinkURI
> >>                        + "?lat=" + position.coords.latitude
> >>                        + "&long=" + position.coords.longitude;
> >>                    $.ajax({url: geolink});
> >>                }, geoError);
> >>    }
> >> }
> >>
> >>
> >> On Tue, Aug 30, 2016 at 12:11 PM, Chris Poulsen <[hidden email]
> >
> >> wrote:
> >>
> >>> Use a form, request parameters or url context - The usual way of
> sending
> >>> data to the server.
> >>>
> >>> --
> >>> Chris
> >>>
> >>> On Tue, Aug 30, 2016 at 11:56 AM, Qbyte Consulting <
> >>> [hidden email]> wrote:
> >>>
> >>>> I get JS to populate the hidden form fields, they are passed as
> >>> parameters
> >>>> to the page, but they are empty strings?
> >>>>
> >>>> function locate() {
> >>>>    //Geolocation
> >>>>    if (navigator.geolocation) {
> >>>>        navigator.geolocation
> >>>>                .getCurrentPosition(function (position)
> >>>>                {
> >>>>                    $("#latitude").val(position.
> >>>> coords.latitude.toString());
> >>>>
> >>>> $("#longitude").val(position.coords.longitude.toString());
> >>>>                }, geoError);
> >>>>        $("#locateForm").submit();
> >>>>    }
> >>>> }
> >>>>
> >>>> On Tue, Aug 30, 2016 at 8:24 AM, Nathan Quirynen <
> >>>> [hidden email]> wrote:
> >>>>
> >>>>> Hi
> >>>>>
> >>>>> I guess you could do something like the following:
> >>>>>
> >>>>> Create a component just containing two hidden fields and in the after
> >>>>> render event of this component run a javascript module where you get
> >>> the
> >>>>> longitude and latitude and set these values to your hidden fields.
> >>>>> Add two parameters (latitude and longitude) to the components java
> >>> class
> >>>>> to which you pass the latitude and longitude properties from your
> >> page
> >>>> that
> >>>>> have to be set when submitting the form. Use these parameters in your
> >>>>> component as the values for your hidden fields.
> >>>>> Then you can add this component inside any form where you need.
> >>>>>
> >>>>> Nathan
> >>>>>
> >>>>>
> >>>>>
> >>>>>> On 30/08/16 01:10, Qbyte Consulting wrote:
> >>>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> Does anyone have an idea how to pass latitude and longitude as
> >> hidden
> >>>>>> values in a login for with T5.4, or any other tricks to get this
> >> data
> >>>> into
> >>>>>> a component?
> >>>>>>
> >>>>>> John
> >>>>>
> >>>>> ------------------------------------------------------------
> >> ---------
> >>>>> To unsubscribe, e-mail: [hidden email]
> >>>>> For additional commands, e-mail: [hidden email]
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>