Ajax download stops AjaxSelfUpdatingTimer

2015-01-11 Thread elvis.ciocoiu
Hi,

I encounter a strange behavior related to AjaxSelfUpdatingTimerBahavior. I
triggers normally until I click a link that downloads a dynamic resource.
The ajax download link is constructed using after the recommendations from: 
https://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow

  

The problem is target.appendJavaScript("setTimeout(\"window.location.href='"
+ url + "'\", 100);"); but if i comment it the download doesn't work
anymore.

Is there another solution to download a file using Ajax or to restart the
timer? If I refresh the page everything is back to normal again.

Thank you.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-download-stops-AjaxSelfUpdatingTimer-tp4668978.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: About BasePage's BrandName setting

2015-01-11 Thread Martin Grigorov
Hi,

Yes, it works. It produces HTML like (check the produced HTML in your app):


Not sure why but you use your custom HTML element for the brand name, and
it is a :
https://github.com/cortix/project/blob/master/src/main/java/web/BasePage.html#L13

I see you use Wicket-Bootstrap. It's Navbar component provides a factory
method for the brand name link:
https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/navbar/Navbar.java#L229
Just use it. No need to add your own one.
Check http://getbootstrap.com/components/#navbar-default for more about
Bootstrap's expacted HTML.



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

On Sun, Jan 11, 2015 at 9:55 PM, Hasan Çelik  wrote:

> Hi Martin,
>
> Thanks for reply, In the future I may use these pages...brandname link
> doesn't work...Afer I click Management.page, I check the brandlink but
> again it forward the Homepage... What I want to do,
>
> when I click ManagementPage, brandlink ---> /management
> when I click HomePage, brandlink ---> /index
>
> I hope, I made myself clear
>
> Regards
>
>
>
> Web Sitesi : www.ab-hibe.com
> E-mail: hasance...@berkadem.com
> E-mail: i...@ab-hibe.com
> Gsm1: 0 544 640 96 25
> Adres : 1271. Sokak 33/14 Sabri Mermutlu İş Merkezi Balgat Ankara
>
> On Sun, Jan 11, 2015 at 10:45 PM, Martin Grigorov 
> wrote:
>
> > Hi,
> >
> > There is no need to provide BasePage1.html and BasePage2.html at all.
> > If there is no specific html for a page then Wicket will use the markup
> of
> > the parent page (i.e. BasePage.html)
> >
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Jan 9, 2015 at 4:09 PM, Hasan Çelik 
> wrote:
> >
> > > *Hi,*
> > >
> > > * I replied my old question but it didn't exist in the forum and I
> > choosed
> > > this way, sorry about that, I wanted to remind dioalog...Anyway I asked
> > > this question before,*
> > > --
> > > Hi,
> > >
> > > Normally I have one Base Page, but I want to create more than one..
> > >
> > > For example
> > >
> > > LoginPage extend BasePage1
> > > ManagmentPage extend BasePage2
> > >
> > > A user login in the website, redirect to ManagementPage... but  when
> user
> > > click BrandName,  redirect to LoginPage ...Can I change the brandname
> for
> > > other BasePages
> > >
> > > For example
> > >
> > > In the ManagmentPage brandName link may be/managementPage ,
> > > In the LoginPage brandName link may be /index
> > >
> > > Is there a way to change it ?
> > >
> > >
> >
> -
> > > *Martin Grigorov  said*
> > >
> > > Hi,
> > >
> > > class BasePage {
> > >
> > >   @Override protected void onInitialize() {super.onInitialize();
> > > add(brandLink("brandLink"))}
> > >
> > >   protected abstract AbstractLink brandLink(String id);
> > > }
> > >
> > > class BasePage1 extend BasePage {
> > >   ...
> > >   protected BookmarkablePageLink brandLink(String id) {return new
> > > BookmarkablePageLink(id, IndexPage.class)}
> > > }
> > >
> > > class BasePage2 extend BasePage {
> > >   ...
> > >   protected BookmarkablePageLink brandLink(String id) {return new
> > > BookmarkablePageLink(id, ManagementPage.class)}
> > > }
> > >
> > >
> >
> --
> > > According to this reply,
> > >
> > > I want to ask another question,
> > >
> > > Hi Martin,
> > >
> > > If I use these construction, How can I change my BasePage markup and
> java
> > > class
> > >
> > > Normally my BasePage.html
> > >
> > > https://gist.github.com/cortix/68b584310e9be62de4c6
> > >
> > > ​and BasePage.java
> > >
> > > https://gist.github.com/cortix/7a5453cddac75b90f29a
> > >
> > > According your code, I tried to create new BasePage, BasePage1,
> BasePage2
> > >
> > > but I didn't succeed to create markup for BasePage, BasePage1,
> BasePage2
> > > and also java pages...
> > >
> > > If BasePage.java would be my main page, How can I edit child and extend
> > tag
> > > for BasePage1, BasePage2
> > >
> > > because
> > >
> > > LoginPage extend BasePage1
> > > ManagmentPage extend BasePage2
> > >
> > > and
> > >
> > > BasePage1 extend BasePage
> > > BasePage2 extend BasePage
> > >
> > >
> > >
> >
> ---
> > > Martin Grigorov said
> > >
> > > Hi,
> > >
> > > Please create a quickstart application at GitHub and give us the url.
> > >
> > >
> > >
> >
> 
> > >
> > > Apologize for delay, I tried to learn to create quick start project on
> > the
> > > github...
> > >
> > > https://github.com/cortix/project
> > >
> >
>


Re: AJAX-Behavior that decides activation of a link

2015-01-11 Thread Martin Grigorov
Hi,

On Thu, Jan 8, 2015 at 10:45 PM, Joachim Schrod  wrote:

> On 01/08/15 08:15, Ernesto Reinaldo Barreiro wrote:
> > Hi,
> >
> > I would  use server side activation. Implemented as in
> >
> > 1- You can create your own events, e.g. [1]. One that is a wrapper of
> AJAX
> > request target (e.g. AtivateLinksEvent).
> > 2- Your  links will listen for AtivateLinksEvents and decide if they
> should
> > be enabled or not (and add themselves to ART on AtivateLinksEvent).
> >
> >
> > References:
> >
> > 1-
> >
> https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TaskLaunchedEvent.java
>
> I don't grasp your intent completely. I get that I can define my
> own event classes server-side. I don't get how that helps me client
> side.
>
> My problem is: How do I communicate to client-side within an event
> handler that attrs.event.preventDefault() shall be called for
> exactly that event handler or not. Wicket provides a static
> pre-made decision via AjaxRequestAttributes; I want a dynamic one.
>

Ajax is asynchronous.
event.preventDefault() is processed long before the request is processed by
the server. Even longer that the processing of the response at the client.

You can use synchronous Ajax call to accomplish this but this is not
recommended. It will freeze the browser tab until the response is processed.


>
> I looked at the code you cited, and the enable/disable decision is
> done server-side, right? But how does introduction of a new event
> type help with my problem client-side? Adding the links to ART on
> some event won't change anything, as this won't influence the
> _original DOM event_ (attrs.event) that controls if default action
> is taken or not. I also can't see how that new Wicket event type
> would give me access to that DOM event I want to influence.
>
> Sorry, but I don't get it. Maybe your Wicket usage is way above my
> head?
>
> Or, do you mean that the server shall decide, according to previous
> user actions, that the link is enabled from now on and then shall
> change the link in an ART? Also disabling it back, as needed?
> That's hard to do, some parameter for the enable/disable decision
> are external availability of resources that are checked at the
> moment of link activation. (The actual link almost always works.
> The behavior shall implement proper error checking and reporting in
> case of unavailable resources or other errors that are beyond the
> user's realm.)
>
> Thanks for your answer, and for digging out that link,
>
> Joachim
>
> > On Thu, Jan 8, 2015 at 2:15 AM, Joachim Schrod  wrote:
> >
> >> Hi,
> >>
> >> I have a class of links where some of them sometimes shall not
> >> trigger. The decision is made server-side according to current state.
> >>
> >> At first sight, the realization seems to be not that straight forward:
> >>  -- I add an AJAX behavior to these link that allows default action
> >> and computes if the link action shall be prevented.
> >>  -- The AJAX behavior has an AJAX call listener (complete handler)
> >> that may call attrs.event.preventDefault() if the link shall
> >> not be triggered.
> >>  -- The decision if the link shall not be triggered is
> >> communicated by the AJAX request to the complete handler via
> >> an HiddenField that is updated in the AJAX request. Delivery
> >> of the decision via JSON is difficult, as we also want to
> >> update other DOM elements with the response (feedback why the
> >> link was not triggered).
> >>
> >> Do I miss something? Is there a completely different approach that
> >> I could take?
> >>
> >> Or: Is there a better way to communicate the decision if the link
> >> shall be triggered to the call listener? Introducing a hidden field
> >> for that purpose seems to be awkward, for me.
> >>
> >> I would be thankful for any comments or recommendations.
> >>
> >> Joachim
> >>
> >> --
> >> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> >> Joachim Schrod, Roedermark, Germany
> >> Email: jsch...@acm.org
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Joachim Schrod, Roedermark, Germany
> Email: jsch...@acm.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: About BasePage's BrandName setting

2015-01-11 Thread Hasan Çelik
Hi Martin,

Thanks for reply, In the future I may use these pages...brandname link
doesn't work...Afer I click Management.page, I check the brandlink but
again it forward the Homepage... What I want to do,

when I click ManagementPage, brandlink ---> /management
when I click HomePage, brandlink ---> /index

I hope, I made myself clear

Regards



Web Sitesi : www.ab-hibe.com
E-mail: hasance...@berkadem.com
E-mail: i...@ab-hibe.com
Gsm1: 0 544 640 96 25
Adres : 1271. Sokak 33/14 Sabri Mermutlu İş Merkezi Balgat Ankara

On Sun, Jan 11, 2015 at 10:45 PM, Martin Grigorov 
wrote:

> Hi,
>
> There is no need to provide BasePage1.html and BasePage2.html at all.
> If there is no specific html for a page then Wicket will use the markup of
> the parent page (i.e. BasePage.html)
>
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Jan 9, 2015 at 4:09 PM, Hasan Çelik  wrote:
>
> > *Hi,*
> >
> > * I replied my old question but it didn't exist in the forum and I
> choosed
> > this way, sorry about that, I wanted to remind dioalog...Anyway I asked
> > this question before,*
> > --
> > Hi,
> >
> > Normally I have one Base Page, but I want to create more than one..
> >
> > For example
> >
> > LoginPage extend BasePage1
> > ManagmentPage extend BasePage2
> >
> > A user login in the website, redirect to ManagementPage... but  when user
> > click BrandName,  redirect to LoginPage ...Can I change the brandname for
> > other BasePages
> >
> > For example
> >
> > In the ManagmentPage brandName link may be/managementPage ,
> > In the LoginPage brandName link may be /index
> >
> > Is there a way to change it ?
> >
> >
> -
> > *Martin Grigorov  said*
> >
> > Hi,
> >
> > class BasePage {
> >
> >   @Override protected void onInitialize() {super.onInitialize();
> > add(brandLink("brandLink"))}
> >
> >   protected abstract AbstractLink brandLink(String id);
> > }
> >
> > class BasePage1 extend BasePage {
> >   ...
> >   protected BookmarkablePageLink brandLink(String id) {return new
> > BookmarkablePageLink(id, IndexPage.class)}
> > }
> >
> > class BasePage2 extend BasePage {
> >   ...
> >   protected BookmarkablePageLink brandLink(String id) {return new
> > BookmarkablePageLink(id, ManagementPage.class)}
> > }
> >
> >
> --
> > According to this reply,
> >
> > I want to ask another question,
> >
> > Hi Martin,
> >
> > If I use these construction, How can I change my BasePage markup and java
> > class
> >
> > Normally my BasePage.html
> >
> > https://gist.github.com/cortix/68b584310e9be62de4c6
> >
> > ​and BasePage.java
> >
> > https://gist.github.com/cortix/7a5453cddac75b90f29a
> >
> > According your code, I tried to create new BasePage, BasePage1, BasePage2
> >
> > but I didn't succeed to create markup for BasePage, BasePage1, BasePage2
> > and also java pages...
> >
> > If BasePage.java would be my main page, How can I edit child and extend
> tag
> > for BasePage1, BasePage2
> >
> > because
> >
> > LoginPage extend BasePage1
> > ManagmentPage extend BasePage2
> >
> > and
> >
> > BasePage1 extend BasePage
> > BasePage2 extend BasePage
> >
> >
> >
> ---
> > Martin Grigorov said
> >
> > Hi,
> >
> > Please create a quickstart application at GitHub and give us the url.
> >
> >
> >
> 
> >
> > Apologize for delay, I tried to learn to create quick start project on
> the
> > github...
> >
> > https://github.com/cortix/project
> >
>


Re: Change in configuring AtmosphereServlet init-params

2015-01-11 Thread Martin Grigorov
Only Emond knows the details ...
AFAIK TrackMessageSizeFilter was needed to overcome a problem in Atmosphere
+ Wicket's XML response.
It seems Atmosphere 2.20+ provides the solution by itself so Wicket's one
is not needed anymore.

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

On Fri, Jan 9, 2015 at 3:41 PM, Daniel Stoch  wrote:

> On Fri, Jan 9, 2015 at 2:37 PM, Martin Grigorov 
> wrote:
> > Hi,
> >
> > I think this changes was needed to upgrade from Atmosphere 2.18 to 2.22.
> > AFAIK this change is needed by Atmosphere itself.
> > Wicket-Atmosphere doesn't use these parameters.
>
> Ok, I know that. But how did you (or Emond ;)) know how to changed it,
> maybe I should look into Atmosphere documentation?
> The old TrackMessageSizeFilter comes from Wicket-Atmosphere, so there
> was some reason to setup such parameter.
>
> --
> Daniel
>
>
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Jan 9, 2015 at 11:07 AM, Daniel Stoch 
> > wrote:
> >
> >> Hi,
> >>
> >> In the most recent version of atmosphere-example the init-params were
> >> changed in servlet configuration (in web.xml).
> >>
> >> From:
> >> 
> >>   org.atmosphere.cpr.broadcastFilterClasses
> >>
> >>
> org.apache.wicket.atmosphere.TrackMessageSizeFilter
> >> 
> >>
> >> To:
> >> 
> >>   org.atmosphere.cpr.AtmosphereInterceptor
> >>
> >>
> org.atmosphere.client.TrackMessageSizeInterceptor
> >> 
> >> 
> >>
> >>
> org.atmosphere.client.TrackMessageSizeInterceptor.delimiter
> >>   
> >> 
> >>
> >> What is the reason of this change, what these parameters are used for?
> >> Actual version does not work for me and I need to know how to debug
> >> this. Any tip will be helpful.
> >>
> >> --
> >> Best regards,
> >> Daniel
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: About BasePage's BrandName setting

2015-01-11 Thread Martin Grigorov
Hi,

There is no need to provide BasePage1.html and BasePage2.html at all.
If there is no specific html for a page then Wicket will use the markup of
the parent page (i.e. BasePage.html)


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

On Fri, Jan 9, 2015 at 4:09 PM, Hasan Çelik  wrote:

> *Hi,*
>
> * I replied my old question but it didn't exist in the forum and I choosed
> this way, sorry about that, I wanted to remind dioalog...Anyway I asked
> this question before,*
> --
> Hi,
>
> Normally I have one Base Page, but I want to create more than one..
>
> For example
>
> LoginPage extend BasePage1
> ManagmentPage extend BasePage2
>
> A user login in the website, redirect to ManagementPage... but  when user
> click BrandName,  redirect to LoginPage ...Can I change the brandname for
> other BasePages
>
> For example
>
> In the ManagmentPage brandName link may be/managementPage ,
> In the LoginPage brandName link may be /index
>
> Is there a way to change it ?
>
> -
> *Martin Grigorov  said*
>
> Hi,
>
> class BasePage {
>
>   @Override protected void onInitialize() {super.onInitialize();
> add(brandLink("brandLink"))}
>
>   protected abstract AbstractLink brandLink(String id);
> }
>
> class BasePage1 extend BasePage {
>   ...
>   protected BookmarkablePageLink brandLink(String id) {return new
> BookmarkablePageLink(id, IndexPage.class)}
> }
>
> class BasePage2 extend BasePage {
>   ...
>   protected BookmarkablePageLink brandLink(String id) {return new
> BookmarkablePageLink(id, ManagementPage.class)}
> }
>
> --
> According to this reply,
>
> I want to ask another question,
>
> Hi Martin,
>
> If I use these construction, How can I change my BasePage markup and java
> class
>
> Normally my BasePage.html
>
> https://gist.github.com/cortix/68b584310e9be62de4c6
>
> ​and BasePage.java
>
> https://gist.github.com/cortix/7a5453cddac75b90f29a
>
> According your code, I tried to create new BasePage, BasePage1, BasePage2
>
> but I didn't succeed to create markup for BasePage, BasePage1, BasePage2
> and also java pages...
>
> If BasePage.java would be my main page, How can I edit child and extend tag
> for BasePage1, BasePage2
>
> because
>
> LoginPage extend BasePage1
> ManagmentPage extend BasePage2
>
> and
>
> BasePage1 extend BasePage
> BasePage2 extend BasePage
>
>
> ---
> Martin Grigorov said
>
> Hi,
>
> Please create a quickstart application at GitHub and give us the url.
>
>
> 
>
> Apologize for delay, I tried to learn to create quick start project on the
> github...
>
> https://github.com/cortix/project
>


Re: Wicket request processing

2015-01-11 Thread Martin Makundi
It's easiest if you use maven, simply check box [x] download sources.

Also you can use mvn commandline mvn eclipse:eclipse -Dsources

2015-01-11 12:04 GMT+02:00 kumar ramanathan :

> Hi Martin,
> Am not using maven.But using eclipse,placed necessary jar files and run it
> via tomcat. Kindly tell what needs to do for this.
>
> Thanks,
> Kumar
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-request-processing-tp4668967p4668969.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket request processing

2015-01-11 Thread kumar ramanathan
Hi Martin,
Am not using maven.But using eclipse,placed necessary jar files and run it
via tomcat. Kindly tell what needs to do for this.

Thanks,
Kumar


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-request-processing-tp4668967p4668969.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org