You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sibgha Nazir <si...@gmail.com> on 2019/09/20 18:25:34 UTC

Wicket first time visit check

Hi,

I have a wicket application and I want to do something when the user opens
the webpage for the first time.

Could anyone give me a clue on how to check if this is the first visit on a
certain webpage?

Best Regards,
Sibgha

Re: Wicket first time visit check

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,
just go for a JavaScript solution, something like the 'Accept our cookies'
modal you see  the first time you visit a site. Wicket hook methods like
onInitialize are executed on server side so the can't directly trigger
JavaScript code.

On Sun, Sep 22, 2019, 3:42 PM Sibgha Nazir <si...@gmail.com> wrote:

> Hi,
>
> Thanks But it calls the constructor every time the page is rendered. What I
> want is, once the user has seen that page before, I don't want to execute
> that logic again.
>
> I want to trigger a javascript function for the first time users. If I have
> seen the webpage once, the next time I open it, then that javascript must
> not trigger.
>
> Also, can I trigger the javascript in onInitialize() method and how?
>
> Best Regards,
> Sibgha
>
> On Sat, Sep 21, 2019 at 7:08 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > You can execute your logic in the page's constructor or onInitialize()
> > method.
> >
> > On Fri, Sep 20, 2019, 21:25 Sibgha Nazir <si...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I have a wicket application and I want to do something when the user
> > opens
> > > the webpage for the first time.
> > >
> > > Could anyone give me a clue on how to check if this is the first visit
> > on a
> > > certain webpage?
> > >
> > > Best Regards,
> > > Sibgha
> > >
> >
>

Re: Wicket first time visit check

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

For this you'd need to persist some flag somewhere. E.g. in a cookie or in
a database.

On Sun, Sep 22, 2019, 16:42 Sibgha Nazir <si...@gmail.com> wrote:

> Hi,
>
> Thanks But it calls the constructor every time the page is rendered. What I
> want is, once the user has seen that page before, I don't want to execute
> that logic again.
>
> I want to trigger a javascript function for the first time users. If I have
> seen the webpage once, the next time I open it, then that javascript must
> not trigger.
>
> Also, can I trigger the javascript in onInitialize() method and how?
>
> Best Regards,
> Sibgha
>
> On Sat, Sep 21, 2019 at 7:08 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > You can execute your logic in the page's constructor or onInitialize()
> > method.
> >
> > On Fri, Sep 20, 2019, 21:25 Sibgha Nazir <si...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I have a wicket application and I want to do something when the user
> > opens
> > > the webpage for the first time.
> > >
> > > Could anyone give me a clue on how to check if this is the first visit
> > on a
> > > certain webpage?
> > >
> > > Best Regards,
> > > Sibgha
> > >
> >
>

Re: Wicket first time visit check

Posted by Sibgha Nazir <si...@gmail.com>.
Hi,

Thanks But it calls the constructor every time the page is rendered. What I
want is, once the user has seen that page before, I don't want to execute
that logic again.

I want to trigger a javascript function for the first time users. If I have
seen the webpage once, the next time I open it, then that javascript must
not trigger.

Also, can I trigger the javascript in onInitialize() method and how?

Best Regards,
Sibgha

On Sat, Sep 21, 2019 at 7:08 AM Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> You can execute your logic in the page's constructor or onInitialize()
> method.
>
> On Fri, Sep 20, 2019, 21:25 Sibgha Nazir <si...@gmail.com> wrote:
>
> > Hi,
> >
> > I have a wicket application and I want to do something when the user
> opens
> > the webpage for the first time.
> >
> > Could anyone give me a clue on how to check if this is the first visit
> on a
> > certain webpage?
> >
> > Best Regards,
> > Sibgha
> >
>

Re: Wicket first time visit check

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You can execute your logic in the page's constructor or onInitialize()
method.

On Fri, Sep 20, 2019, 21:25 Sibgha Nazir <si...@gmail.com> wrote:

> Hi,
>
> I have a wicket application and I want to do something when the user opens
> the webpage for the first time.
>
> Could anyone give me a clue on how to check if this is the first visit on a
> certain webpage?
>
> Best Regards,
> Sibgha
>