ComponentNotFoundException when using AbstractAjaxTimerBehavior

2016-11-16 Thread René Hartwig

Hi,

in my application I have implemented a simple ajax-based navigation: 
Clicking the navigation link replaces the current panel with a new one.


One of the panels starts an ajax timer. If the user clicks another 
navigation link while the timer is still running a 
ComponentNotFoundException is raised.
I tried to work around this problem by unbinding the timer before I 
replace the current panel. However, if I do that I am running into a 
NullPointerException:


Do you have any suggestions on how I can solve this problem? I am using 
Wicket v7.4.0



Thanks and best regards,

René

--

Mit freundlichen Grüßen / Best regards,

René Hartwig**
Senior Developer

Mail: rene.hart...@cryptshare.com
Phone:   +49 761 38913 0
Fax:   +49 761 38913 115
Web: _www.cryptshare.com_ 

Befine Solutions AG - The Cryptshare company **
Werthmannstr. 15
79098 Freiburg
Germany
__

Are your attachments too large or confidential for common e-mail?
Get to know _Cryptshare_ !
__

Follow us for news and product updates:
_twitter_   l _Linkedin_ 
   l _XING_ 
   l _Youtube_ 
  l _Google+_ 
  l _RSS_

__
Register Court Freiburg HRB 6144, Board of Management: Mark Forrest, 
Dominik Lehr, Chairman of the Supervisor Board: Thilo Braun




Re: WebSocket close is being called if AjaxDownloader is used

2016-11-16 Thread Maxim Solodovnik
Done:
https://github.com/apache/wicket/pull/190
https://github.com/apache/wicket/pull/191

On Wed, Nov 16, 2016 at 5:14 PM, Martin Grigorov 
wrote:

> Hi Maxim,
>
> Please do!
>
> Thank you!
>
> On Nov 16, 2016 10:58 AM, "Maxim Solodovnik"  wrote:
>
> > I believe all comments are now addressed,
> > Should I create PR to add AjaxDownload to wicket-extensions? both 7.x and
> > 8.x?
> >
> > On Fri, Nov 11, 2016 at 6:11 PM, Sven Meier  wrote:
> >
> > > +1 on putting it into wicket-extensions.
> > >
> > > Sven
> > >
> > >
> > > Am 11.11.2016 um 10:54 schrieb Martin Grigorov:
> > >
> > >> One class + one .js might be too much for a new module but I don't
> want
> > >> all
> > >> the useless stuff in minis in my application too.
> > >> I still prefer this to be in Wicket core.
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >>
> > >> On Fri, Nov 11, 2016 at 10:28 AM, Sven Meier  wrote:
> > >>
> > >> I don't think this warrants a new module - just add it to
> > >>> wicketstuff-minis.
> > >>>
> > >>> Sven
> > >>>
> > >>>
> > >>>
> > >>> Am 11.11.2016 um 08:42 schrieb Martin Grigorov:
> > >>>
> > >>> Great work, Maxim!
> > 
> >  Let's move it to WicketStuff as a new module.
> >  I'd like to add -examples module with different use cases so we can
> > see
> >  whether the iframes leak or not for example.
> >  Also I'd like to try to add events like beforeDownload/afterDownload
> > so
> >  apps can show indicators that something is happening.
> > 
> >  Martin Grigorov
> >  Wicket Training and Consulting
> >  https://twitter.com/mtgrigorov
> > 
> >  On Wed, Nov 9, 2016 at 9:13 AM, Ernesto Reinaldo Barreiro <
> >  reier...@gmail.com> wrote:
> > 
> >  Thanks for sharing. I just added a couple of comments/
> > 
> > > On Wed, Nov 9, 2016 at 4:23 AM, Maxim Solodovnik <
> > solomax...@gmail.com
> > > >
> > > wrote:
> > >
> > > Hello Martin,
> > >
> > >> sorry for the delay
> > >>
> > >> here is the repo: https://github.com/solomax/wicket-ajax-download
> > >> here is the commit with the ajax-download-via-iframe
> implementation:
> > >> https://github.com/solomax/wicket-ajax-download/commit/
> > >> 407936d6f506aa047d9a12a3ecb7aa6c866eb052
> > >>
> > >> Looking forward for your comments :)
> > >>
> > >> On Wed, Nov 9, 2016 at 5:02 AM, Martin Grigorov <
> > mgrigo...@apache.org
> > >> >
> > >> wrote:
> > >>
> > >> Hi Maxim,
> > >>>
> > >>> Do you have progress on this ?
> > >>>
> > >>> Martin Grigorov
> > >>> Wicket Training and Consulting
> > >>> https://twitter.com/mtgrigorov
> > >>>
> > >>> On Thu, Nov 3, 2016 at 9:46 AM, Maxim Solodovnik <
> > >>> solomax...@gmail.com
> > >>> wrote:
> > >>>
> > >>> I was hoping to get answer like: in 7.x you should use .xxx
> > :)))
> > >>>
> >  Going to create example on github and will send it for review :)
> > 
> >  On Thu, Nov 3, 2016 at 3:43 PM, Martin Grigorov <
> >  mgrigo...@apache.org
> >  wrote:
> > 
> >  On Thu, Nov 3, 2016 at 9:40 AM, Maxim Solodovnik <
> >  solomax...@gmail.com>
> > 
> > >>> wrote:
> > >>>
> >  It seems iframe is the only option :(((
> > >
> > >> Why so sad ?
> > >>
> > > iframe is a good option
> > >
> > >
> > > here is the JS plugin wrapping this idea:
> > >
> > >> http://johnculviner.com/jquery-file-download-plugin-
> > >> for-ajax-like-feature-rich-file-downloads/
> > >> going to perform additional search
> > >>
> > >> Thanks for the idea!
> > >>
> > >> On Thu, Nov 3, 2016 at 3:36 PM, Ernesto Reinaldo Barreiro <
> > >> reier...@gmail.com> wrote:
> > >>
> > >> or maybe use a hidden iframe to trigger download...
> > >>
> > >>> On Thu, Nov 3, 2016 at 9:28 AM, Ernesto Reinaldo Barreiro <
> > >>> reier...@gmail.com> wrote:
> > >>>
> > >>> I do not know if this is possible but
> > >>>
> >  1- Open a new tab
> >  2- Set location to download URL
> >  3- Close the new tab
> > 
> >  That way (maybe) page does not close WebSocket connection.
> It
> > 
> >  would
> > >>>
> > >> still
> > >>>
> >  be "AJAX"...
> > >>>
> > 
> >  On Thu, Nov 3, 2016 at 9:04 AM, Maxim Solodovnik <
> > 
> >  solomax...@gmail.com
> > >>>
> > >> wrote:
> > >>
> > >>> I'm afraid It would be not really Ajax .
> > 
> > > On Thu, Nov 3, 2016 at 3:03 PM, Ernesto 

Re: Single page app as custom resource?

2016-11-16 Thread Lars Törner
Ok, thanks Martin!

It would be really interesting to hear the opinion of someone that tried
the approach.

2016-11-16 12:43 GMT+01:00 Martin Grigorov :

> Hi Lars,
>
> AFAIK some people use this approach in their applications.
>
> You can use Wicket resources as endpoints or any other, e.g. Spring MVC,
> just make sure you "wrap" them in WicketSessionFilter so you have access to
> Application.get() and Session.get() inside them.
>
> On Nov 16, 2016 7:41 AM, "Lars Törner"  wrote:
>
> > Ok, now I found wicketstuff-rest-annotations... so, can I create a
> wicket
> > page, load resources for a java scriptframework and then use
> > wicket-rest-requests with ajax to integrate a SPA in my
> > wicket-web-application?
> >
> > tisdag 15 november 2016 skrev Lars Törner :
> >
> > > Hi,
> > >
> > > we're developing a webbapplication to our legacy product and we're
> doing
> > > it in wicket.
> > >
> > > We have a few pages which are using a lot of ajax, and therefore each
> one
> > > of them could be seen as kind of a SPA. (Does that make sense?)
> > >
> > > Now we might have a case when a client (or we our selves) would like to
> > > extend the wicket webbapplication with a page/spa written in javascript
> > > (angular/react etc). From the users point of view, there should be no
> > > difference. It should be the same session etc.
> > >
> > > Can this be done with a dynamic resource? Or in some other way? Is it a
> > > bad idea or just another way to do things?
> > >
> > > Cheers
> > > Lars
> > >
> >
>


Re: Single page app as custom resource?

2016-11-16 Thread Martin Grigorov
Hi Lars,

AFAIK some people use this approach in their applications.

You can use Wicket resources as endpoints or any other, e.g. Spring MVC,
just make sure you "wrap" them in WicketSessionFilter so you have access to
Application.get() and Session.get() inside them.

On Nov 16, 2016 7:41 AM, "Lars Törner"  wrote:

> Ok, now I found wicketstuff-rest-annotations... so, can I create a wicket
> page, load resources for a java scriptframework and then use
> wicket-rest-requests with ajax to integrate a SPA in my
> wicket-web-application?
>
> tisdag 15 november 2016 skrev Lars Törner :
>
> > Hi,
> >
> > we're developing a webbapplication to our legacy product and we're doing
> > it in wicket.
> >
> > We have a few pages which are using a lot of ajax, and therefore each one
> > of them could be seen as kind of a SPA. (Does that make sense?)
> >
> > Now we might have a case when a client (or we our selves) would like to
> > extend the wicket webbapplication with a page/spa written in javascript
> > (angular/react etc). From the users point of view, there should be no
> > difference. It should be the same session etc.
> >
> > Can this be done with a dynamic resource? Or in some other way? Is it a
> > bad idea or just another way to do things?
> >
> > Cheers
> > Lars
> >
>


Re: WebSocket close is being called if AjaxDownloader is used

2016-11-16 Thread Martin Grigorov
Hi Maxim,

Please do!

Thank you!

On Nov 16, 2016 10:58 AM, "Maxim Solodovnik"  wrote:

> I believe all comments are now addressed,
> Should I create PR to add AjaxDownload to wicket-extensions? both 7.x and
> 8.x?
>
> On Fri, Nov 11, 2016 at 6:11 PM, Sven Meier  wrote:
>
> > +1 on putting it into wicket-extensions.
> >
> > Sven
> >
> >
> > Am 11.11.2016 um 10:54 schrieb Martin Grigorov:
> >
> >> One class + one .js might be too much for a new module but I don't want
> >> all
> >> the useless stuff in minis in my application too.
> >> I still prefer this to be in Wicket core.
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Fri, Nov 11, 2016 at 10:28 AM, Sven Meier  wrote:
> >>
> >> I don't think this warrants a new module - just add it to
> >>> wicketstuff-minis.
> >>>
> >>> Sven
> >>>
> >>>
> >>>
> >>> Am 11.11.2016 um 08:42 schrieb Martin Grigorov:
> >>>
> >>> Great work, Maxim!
> 
>  Let's move it to WicketStuff as a new module.
>  I'd like to add -examples module with different use cases so we can
> see
>  whether the iframes leak or not for example.
>  Also I'd like to try to add events like beforeDownload/afterDownload
> so
>  apps can show indicators that something is happening.
> 
>  Martin Grigorov
>  Wicket Training and Consulting
>  https://twitter.com/mtgrigorov
> 
>  On Wed, Nov 9, 2016 at 9:13 AM, Ernesto Reinaldo Barreiro <
>  reier...@gmail.com> wrote:
> 
>  Thanks for sharing. I just added a couple of comments/
> 
> > On Wed, Nov 9, 2016 at 4:23 AM, Maxim Solodovnik <
> solomax...@gmail.com
> > >
> > wrote:
> >
> > Hello Martin,
> >
> >> sorry for the delay
> >>
> >> here is the repo: https://github.com/solomax/wicket-ajax-download
> >> here is the commit with the ajax-download-via-iframe implementation:
> >> https://github.com/solomax/wicket-ajax-download/commit/
> >> 407936d6f506aa047d9a12a3ecb7aa6c866eb052
> >>
> >> Looking forward for your comments :)
> >>
> >> On Wed, Nov 9, 2016 at 5:02 AM, Martin Grigorov <
> mgrigo...@apache.org
> >> >
> >> wrote:
> >>
> >> Hi Maxim,
> >>>
> >>> Do you have progress on this ?
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Thu, Nov 3, 2016 at 9:46 AM, Maxim Solodovnik <
> >>> solomax...@gmail.com
> >>> wrote:
> >>>
> >>> I was hoping to get answer like: in 7.x you should use .xxx
> :)))
> >>>
>  Going to create example on github and will send it for review :)
> 
>  On Thu, Nov 3, 2016 at 3:43 PM, Martin Grigorov <
>  mgrigo...@apache.org
>  wrote:
> 
>  On Thu, Nov 3, 2016 at 9:40 AM, Maxim Solodovnik <
>  solomax...@gmail.com>
> 
> >>> wrote:
> >>>
>  It seems iframe is the only option :(((
> >
> >> Why so sad ?
> >>
> > iframe is a good option
> >
> >
> > here is the JS plugin wrapping this idea:
> >
> >> http://johnculviner.com/jquery-file-download-plugin-
> >> for-ajax-like-feature-rich-file-downloads/
> >> going to perform additional search
> >>
> >> Thanks for the idea!
> >>
> >> On Thu, Nov 3, 2016 at 3:36 PM, Ernesto Reinaldo Barreiro <
> >> reier...@gmail.com> wrote:
> >>
> >> or maybe use a hidden iframe to trigger download...
> >>
> >>> On Thu, Nov 3, 2016 at 9:28 AM, Ernesto Reinaldo Barreiro <
> >>> reier...@gmail.com> wrote:
> >>>
> >>> I do not know if this is possible but
> >>>
>  1- Open a new tab
>  2- Set location to download URL
>  3- Close the new tab
> 
>  That way (maybe) page does not close WebSocket connection. It
> 
>  would
> >>>
> >> still
> >>>
>  be "AJAX"...
> >>>
> 
>  On Thu, Nov 3, 2016 at 9:04 AM, Maxim Solodovnik <
> 
>  solomax...@gmail.com
> >>>
> >> wrote:
> >>
> >>> I'm afraid It would be not really Ajax .
> 
> > On Thu, Nov 3, 2016 at 3:03 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > maybe open a second browser tab and do the download
> > there...
> >
>  On Thu, Nov 3, 2016 at 8:51 AM, Maxim Solodovnik <
> >>
> >>> solomax...@gmail.com>
> >
>  wrote:
> 
> > I'll try to create quick-start ASAP
> >>
> >>> On Thu, Nov 3, 2016 at 2:51 PM, Maxim Solodovnik <

Re: WebSocket close is being called if AjaxDownloader is used

2016-11-16 Thread Maxim Solodovnik
I believe all comments are now addressed,
Should I create PR to add AjaxDownload to wicket-extensions? both 7.x and
8.x?

On Fri, Nov 11, 2016 at 6:11 PM, Sven Meier  wrote:

> +1 on putting it into wicket-extensions.
>
> Sven
>
>
> Am 11.11.2016 um 10:54 schrieb Martin Grigorov:
>
>> One class + one .js might be too much for a new module but I don't want
>> all
>> the useless stuff in minis in my application too.
>> I still prefer this to be in Wicket core.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Fri, Nov 11, 2016 at 10:28 AM, Sven Meier  wrote:
>>
>> I don't think this warrants a new module - just add it to
>>> wicketstuff-minis.
>>>
>>> Sven
>>>
>>>
>>>
>>> Am 11.11.2016 um 08:42 schrieb Martin Grigorov:
>>>
>>> Great work, Maxim!

 Let's move it to WicketStuff as a new module.
 I'd like to add -examples module with different use cases so we can see
 whether the iframes leak or not for example.
 Also I'd like to try to add events like beforeDownload/afterDownload so
 apps can show indicators that something is happening.

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Wed, Nov 9, 2016 at 9:13 AM, Ernesto Reinaldo Barreiro <
 reier...@gmail.com> wrote:

 Thanks for sharing. I just added a couple of comments/

> On Wed, Nov 9, 2016 at 4:23 AM, Maxim Solodovnik  >
> wrote:
>
> Hello Martin,
>
>> sorry for the delay
>>
>> here is the repo: https://github.com/solomax/wicket-ajax-download
>> here is the commit with the ajax-download-via-iframe implementation:
>> https://github.com/solomax/wicket-ajax-download/commit/
>> 407936d6f506aa047d9a12a3ecb7aa6c866eb052
>>
>> Looking forward for your comments :)
>>
>> On Wed, Nov 9, 2016 at 5:02 AM, Martin Grigorov > >
>> wrote:
>>
>> Hi Maxim,
>>>
>>> Do you have progress on this ?
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Thu, Nov 3, 2016 at 9:46 AM, Maxim Solodovnik <
>>> solomax...@gmail.com
>>> wrote:
>>>
>>> I was hoping to get answer like: in 7.x you should use .xxx :)))
>>>
 Going to create example on github and will send it for review :)

 On Thu, Nov 3, 2016 at 3:43 PM, Martin Grigorov <
 mgrigo...@apache.org
 wrote:

 On Thu, Nov 3, 2016 at 9:40 AM, Maxim Solodovnik <
 solomax...@gmail.com>

>>> wrote:
>>>
 It seems iframe is the only option :(((
>
>> Why so sad ?
>>
> iframe is a good option
>
>
> here is the JS plugin wrapping this idea:
>
>> http://johnculviner.com/jquery-file-download-plugin-
>> for-ajax-like-feature-rich-file-downloads/
>> going to perform additional search
>>
>> Thanks for the idea!
>>
>> On Thu, Nov 3, 2016 at 3:36 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>> or maybe use a hidden iframe to trigger download...
>>
>>> On Thu, Nov 3, 2016 at 9:28 AM, Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com> wrote:
>>>
>>> I do not know if this is possible but
>>>
 1- Open a new tab
 2- Set location to download URL
 3- Close the new tab

 That way (maybe) page does not close WebSocket connection. It

 would
>>>
>> still
>>>
 be "AJAX"...
>>>

 On Thu, Nov 3, 2016 at 9:04 AM, Maxim Solodovnik <

 solomax...@gmail.com
>>>
>> wrote:
>>
>>> I'm afraid It would be not really Ajax .

> On Thu, Nov 3, 2016 at 3:03 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> maybe open a second browser tab and do the download
> there...
>
 On Thu, Nov 3, 2016 at 8:51 AM, Maxim Solodovnik <
>>
>>> solomax...@gmail.com>
>
 wrote:

> I'll try to create quick-start ASAP
>>
>>> On Thu, Nov 3, 2016 at 2:51 PM, Maxim Solodovnik <
>>>
>>> solomax...@gmail.com>
>> wrote:
>>
>>> AjaxDownload was for wicket 1.5.x (or maybe 6.x)
>>>
 maybe it can be enhanced to work without unload?

 On Thu, Nov 3, 2016 at 2:46 PM, Sven Meier <

 s...@meiers.net
>>>
>> wrote:
>>>