Re: Wicket 6.13 link onclick behavior not working with ajax onclick row select
Hi, The 'click' event propagates from the (the link) to the (the row). This is normal behavior in JavaScript. You need to add something like: ... Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Jan 13, 2015 at 7:45 AM, avchavan wrote: > Hi, > I have recently upgraded to Wicket 6.13 from Wicket 1.5.11 After the > upgrade > i am facing an issue with onclick behavior of a link. > > We have a clickable row which contains few columns (one of which is a link > to new page). now, if we click on the link then we are taken to new page > and > we click on the row (apart from the link) the row get selected (using Ajax > call). > > This was working fine with Wicket 1.5.11, i am facing issues with Wicket > 6.13 > > Link class: > > public class MyLink extends Link { > > private static final long serialVersionUID = 5808539933400105591L; > private MyRow myRow; > > public MyLink(String id, MyRow myRow) { > super(id); > this.myRow = myRow; > } > > /** {@inheritDoc} */ > @Override > public void onClick() { > //sets the response page where this needs to be redirected. > this.setResponsePage(new ResponseReadPage(this.myRow)); > } > } > > Populate method: > > @Override > protected void populateItem(final ListItem item) { > final MyRow myRow = (MyRow) item.getModelObject(); > item.add(new Label("naam", myRow.getName())); > item.add(new Label("id", myRow.getCode())); > > MyLink myLink = new MyLink("myLink", myRow); > item.add(myLink); > final MyRow selectedRow = this.session.getSelectedRow(); > > if (selectedRow != null > && selectedRow.equals(myRow)) { > this.session.selectedRow(myRow); > item.add(new AttributeModifier("class", "activeRow")); > this.selecteditem = item; > > //some business logic > } > > item.add(new AjaxEventBehavior("onclick") { > /** {@inheritDoc} */ > @SuppressWarnings({ "unchecked", "rawtypes" }) > @Override > protected void onEvent(final AjaxRequestTarget target) { > final WebMarkupContainer container = (WebMarkupContainer) > MyListView.this.getParent() > .getParent().get("myContainer"); > > MyListView.this.session.setSelectedRow(myRow); > > if (MyListView.this.currentActiveItem != null) { > MyListView.this.previousActiveItem = > MyListView.this.currentActiveItem; > MyListView.this.previousActiveItem.add(new > AttributeModifier("class", "")); > } > item.add(new AttributeModifier("class", "activeRow")); > MyListView.this.currentActiveItem = item; > if (MyListView.this.previousActiveItem != null) { > target.add(MyListView.this.previousActiveItem); > } > > if (MyListView.this.selecteditem != null > && !MyView.this.selecteditem.equals(item)) { > MyListView.this.selecteditem.add(new > AttributeModifier("class", "")); > target.add(MyListView.this.selecteditem); > } > target.add(item); > target.add(container); > } > }); > } > > When i try to click on the LINK instead of onClick method of the link, the > onclick event of AjaxBehavior of row gets called. > When i right click on the link and open it in another tab the call to > onClick method of link happens successfully as expected. > Can anyone point me in the correct direction to get this sorted? > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-6-13-link-onclick-behavior-not-working-with-ajax-onclick-row-select-tp4668995.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: Page constructor calls multiple time
Hi, It is most probably a problem in your application. Are you able to reproduce it in a mini application ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Jan 13, 2015 at 3:55 AM, hoosssein wrote: > I use Wicket 6.18.0 and when i tries to create a page, It seems that it > call > constructor multiple time. > I add a break point in my constructor and I notice that it called 5 time! > then I start tracing the wicket. I go every where after calling constructor > using "step over" in debug mode but surprisingly, It never stuck into the > break point which I created in the constructor while my log file still > shows > that the constructor calls multiple time! > > does any body know why wicket call a constructor multiple time? > > I have a form in my page and when I submit it, it doesn't call "onSubmit" > of > the form. and it return to the page again. I think these two problem comes > from the same source of fault. > > the form action at the first time is something like > "./?0-1.IFormSubmitListener-loginForm". but when I refresh it, it change to > something like this "./?6-1.IFormSubmitListener-loginForm". those number > after question marks seems like version number. I test them in another > healthy form and I realize that if I refresh the page it increases by 1, > not > by 6. I need to mention that there is only one form in my page. > > any help on any of these problems and way to found and fix bug would > greatly > appreciated. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Page-constructor-calls-multiple-time-tp4668994.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 > >
Wicket 6.13 link onclick behavior not working with ajax onclick row select
Hi, I have recently upgraded to Wicket 6.13 from Wicket 1.5.11 After the upgrade i am facing an issue with onclick behavior of a link. We have a clickable row which contains few columns (one of which is a link to new page). now, if we click on the link then we are taken to new page and we click on the row (apart from the link) the row get selected (using Ajax call). This was working fine with Wicket 1.5.11, i am facing issues with Wicket 6.13 Link class: public class MyLink extends Link { private static final long serialVersionUID = 5808539933400105591L; private MyRow myRow; public MyLink(String id, MyRow myRow) { super(id); this.myRow = myRow; } /** {@inheritDoc} */ @Override public void onClick() { //sets the response page where this needs to be redirected. this.setResponsePage(new ResponseReadPage(this.myRow)); } } Populate method: @Override protected void populateItem(final ListItem item) { final MyRow myRow = (MyRow) item.getModelObject(); item.add(new Label("naam", myRow.getName())); item.add(new Label("id", myRow.getCode())); MyLink myLink = new MyLink("myLink", myRow); item.add(myLink); final MyRow selectedRow = this.session.getSelectedRow(); if (selectedRow != null && selectedRow.equals(myRow)) { this.session.selectedRow(myRow); item.add(new AttributeModifier("class", "activeRow")); this.selecteditem = item; //some business logic } item.add(new AjaxEventBehavior("onclick") { /** {@inheritDoc} */ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected void onEvent(final AjaxRequestTarget target) { final WebMarkupContainer container = (WebMarkupContainer) MyListView.this.getParent() .getParent().get("myContainer"); MyListView.this.session.setSelectedRow(myRow); if (MyListView.this.currentActiveItem != null) { MyListView.this.previousActiveItem = MyListView.this.currentActiveItem; MyListView.this.previousActiveItem.add(new AttributeModifier("class", "")); } item.add(new AttributeModifier("class", "activeRow")); MyListView.this.currentActiveItem = item; if (MyListView.this.previousActiveItem != null) { target.add(MyListView.this.previousActiveItem); } if (MyListView.this.selecteditem != null && !MyView.this.selecteditem.equals(item)) { MyListView.this.selecteditem.add(new AttributeModifier("class", "")); target.add(MyListView.this.selecteditem); } target.add(item); target.add(container); } }); } When i try to click on the LINK instead of onClick method of the link, the onclick event of AjaxBehavior of row gets called. When i right click on the link and open it in another tab the call to onClick method of link happens successfully as expected. Can anyone point me in the correct direction to get this sorted? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-13-link-onclick-behavior-not-working-with-ajax-onclick-row-select-tp4668995.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
Page constructor calls multiple time
I use Wicket 6.18.0 and when i tries to create a page, It seems that it call constructor multiple time. I add a break point in my constructor and I notice that it called 5 time! then I start tracing the wicket. I go every where after calling constructor using "step over" in debug mode but surprisingly, It never stuck into the break point which I created in the constructor while my log file still shows that the constructor calls multiple time! does any body know why wicket call a constructor multiple time? I have a form in my page and when I submit it, it doesn't call "onSubmit" of the form. and it return to the page again. I think these two problem comes from the same source of fault. the form action at the first time is something like "./?0-1.IFormSubmitListener-loginForm". but when I refresh it, it change to something like this "./?6-1.IFormSubmitListener-loginForm". those number after question marks seems like version number. I test them in another healthy form and I realize that if I refresh the page it increases by 1, not by 6. I need to mention that there is only one form in my page. any help on any of these problems and way to found and fix bug would greatly appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Page-constructor-calls-multiple-time-tp4668994.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: Handling errors in dynamic Resource generation
I've done something similar before: - pass the page id to the resource - if there is an error then use the page id to lookup the page from the stores - if you send the request to the resource with Ajax -- create a new AjaxRequestHandler and schedule it after the current - if this is normal (non-Ajax) request -- just do RequestCycle.get().setResponsePage(page) - either do page.error(...) or broadcast a special event (with the ARH when in Ajax) so a more specific component may report the error Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 12, 2015 at 10:22 PM, Nick Pratt wrote: > Thanks Martin. How would this work though - from the callstack, I see > newResourceResponse() invoked, followed by flushResponseAfterHeaders(), and > then the writeData() callback invocation. So setting a flag in the > writeData callback occurs too late. If I try and load the data outside the > writeCallback, catch the error and then reset the headers there, the user > gets redirected to the standard Wicket error/exception page. > > What does the browser need to receive in order to notify the user that a > download failed (but keep them on the same page)? > > > We cant (dont want to) ensure that all linked resources are physically > available on disk (or on S3) since that would just kill page loading. We > have a set of links that should be present, and barring any network issues > or disk issues, they would ordinarily be available. > > > > On Mon, Jan 12, 2015 at 3:12 PM, Martin Grigorov > wrote: > > > Hi, > > > > Override #flushResponseAfterHeaders() (see > > > > > https://github.com/apache/wicket/blob/wicket-6.x/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java#L673 > > ) > > so that you are able to reset the response if an error occurs while > writing > > the body. > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Mon, Jan 12, 2015 at 8:46 PM, Nick Pratt wrote: > > > > > I have an AbstractResource modelled after section 15.9 in the Wicket > > Guide: > > > http://wicket.apache.org/guide/guide/resources.html > > > > > > What is the correct way to handle errors (such as expected dynamic data > > not > > > available) during the writeCallback? > > > > > > The specific line in the example is: output.output(getFeed(), writer); > > > > > > > > > While I throw a WicketRuntimeException during the writeCallback and the > > > server aborts the request and logs the error, the client sits waiting > for > > > the download. Worse still, after the client times out (Chrome on OS X), > > the > > > downloads bar displays what looks like a successfully downloaded valid > > file > > > with no indication of error, and while it does have some data in it (in > > my > > > case around 4800 bytes) its not valid (Im a little puzzled about the > > ~4800 > > > bytes or so). Ideally I'd like to give the user a notification that the > > > download failed. > > > > > > If I try and get the data before the writecallback, and then set the > > > ErrorCode on the ResourceResponse when the data is not available, the > > user > > > is redirected to an unstyled Jetty served error screen which we don't > > want > > > to see - we'd rather signal that the download failed and keep the user > on > > > the same page. Is this possible with ResourceLink/AbstractResource or > do > > > we have to use an alternative method to make this work more elegantly? > > > > > >
Re: Handling errors in dynamic Resource generation
Thanks Martin. How would this work though - from the callstack, I see newResourceResponse() invoked, followed by flushResponseAfterHeaders(), and then the writeData() callback invocation. So setting a flag in the writeData callback occurs too late. If I try and load the data outside the writeCallback, catch the error and then reset the headers there, the user gets redirected to the standard Wicket error/exception page. What does the browser need to receive in order to notify the user that a download failed (but keep them on the same page)? We cant (dont want to) ensure that all linked resources are physically available on disk (or on S3) since that would just kill page loading. We have a set of links that should be present, and barring any network issues or disk issues, they would ordinarily be available. On Mon, Jan 12, 2015 at 3:12 PM, Martin Grigorov wrote: > Hi, > > Override #flushResponseAfterHeaders() (see > > https://github.com/apache/wicket/blob/wicket-6.x/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java#L673 > ) > so that you are able to reset the response if an error occurs while writing > the body. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Mon, Jan 12, 2015 at 8:46 PM, Nick Pratt wrote: > > > I have an AbstractResource modelled after section 15.9 in the Wicket > Guide: > > http://wicket.apache.org/guide/guide/resources.html > > > > What is the correct way to handle errors (such as expected dynamic data > not > > available) during the writeCallback? > > > > The specific line in the example is: output.output(getFeed(), writer); > > > > > > While I throw a WicketRuntimeException during the writeCallback and the > > server aborts the request and logs the error, the client sits waiting for > > the download. Worse still, after the client times out (Chrome on OS X), > the > > downloads bar displays what looks like a successfully downloaded valid > file > > with no indication of error, and while it does have some data in it (in > my > > case around 4800 bytes) its not valid (Im a little puzzled about the > ~4800 > > bytes or so). Ideally I'd like to give the user a notification that the > > download failed. > > > > If I try and get the data before the writecallback, and then set the > > ErrorCode on the ResourceResponse when the data is not available, the > user > > is redirected to an unstyled Jetty served error screen which we don't > want > > to see - we'd rather signal that the download failed and keep the user on > > the same page. Is this possible with ResourceLink/AbstractResource or do > > we have to use an alternative method to make this work more elegantly? > > >
Re: Handling errors in dynamic Resource generation
Hi, Override #flushResponseAfterHeaders() (see https://github.com/apache/wicket/blob/wicket-6.x/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java#L673) so that you are able to reset the response if an error occurs while writing the body. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 12, 2015 at 8:46 PM, Nick Pratt wrote: > I have an AbstractResource modelled after section 15.9 in the Wicket Guide: > http://wicket.apache.org/guide/guide/resources.html > > What is the correct way to handle errors (such as expected dynamic data not > available) during the writeCallback? > > The specific line in the example is: output.output(getFeed(), writer); > > > While I throw a WicketRuntimeException during the writeCallback and the > server aborts the request and logs the error, the client sits waiting for > the download. Worse still, after the client times out (Chrome on OS X), the > downloads bar displays what looks like a successfully downloaded valid file > with no indication of error, and while it does have some data in it (in my > case around 4800 bytes) its not valid (Im a little puzzled about the ~4800 > bytes or so). Ideally I'd like to give the user a notification that the > download failed. > > If I try and get the data before the writecallback, and then set the > ErrorCode on the ResourceResponse when the data is not available, the user > is redirected to an unstyled Jetty served error screen which we don't want > to see - we'd rather signal that the download failed and keep the user on > the same page. Is this possible with ResourceLink/AbstractResource or do > we have to use an alternative method to make this work more elegantly? >
Handling errors in dynamic Resource generation
I have an AbstractResource modelled after section 15.9 in the Wicket Guide: http://wicket.apache.org/guide/guide/resources.html What is the correct way to handle errors (such as expected dynamic data not available) during the writeCallback? The specific line in the example is: output.output(getFeed(), writer); While I throw a WicketRuntimeException during the writeCallback and the server aborts the request and logs the error, the client sits waiting for the download. Worse still, after the client times out (Chrome on OS X), the downloads bar displays what looks like a successfully downloaded valid file with no indication of error, and while it does have some data in it (in my case around 4800 bytes) its not valid (Im a little puzzled about the ~4800 bytes or so). Ideally I'd like to give the user a notification that the download failed. If I try and get the data before the writecallback, and then set the ErrorCode on the ResourceResponse when the data is not available, the user is redirected to an unstyled Jetty served error screen which we don't want to see - we'd rather signal that the download failed and keep the user on the same page. Is this possible with ResourceLink/AbstractResource or do we have to use an alternative method to make this work more elegantly?
Re: About BasePage's BrandName setting
Thank you so so much :) Yes now it works 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 Mon, Jan 12, 2015 at 6:00 PM, Martin Grigorov wrote: > https://github.com/cortix/project/pull/1 > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Mon, Jan 12, 2015 at 3:52 PM, Hasan Çelik wrote: > > > Sorry about that, it's my fault, I didn't know that it was about > > wicket-bootstrap... By the way > > > > I googled and I have found that > > > > https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/385 > > > > But I didnt override newBrandNameLink in the BasePage...Where should I > > override it ? > > > > Thank you so much for these information and your patience > > > > Best 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 Mon, Jan 12, 2015 at 3:15 PM, Martin Grigorov > > wrote: > > > > > Hi, > > > > > > Please read again what I've explained in my previous mail. > > > Your 'brandName' component is broken. > > > 1) It is a . Must be > > > 2) It is not needed at all. You see Bootstrap's brandName link in the > > > produced UI. Your custom brand name produces without > > any > > > text so you don't see it in the UI at all. > > > 3) read Bootstrap docs for expected HTML template for Navbar and check > it > > > against what your application produces. > > > 4) You need to override > > > > > > > > > https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/navbar/Navbar.java#L229 > > > instead of using your own component for brandName. Your first messages > > > didn't explain that you use Wicket-Bootstrap so I wasn't able to > suggest > > > you this then > > > > > > > > > Martin Grigorov > > > Wicket Training and Consulting > > > https://twitter.com/mtgrigorov > > > > > > On Mon, Jan 12, 2015 at 2:08 PM, Hasan Çelik > > wrote: > > > > > > > Hi Martin, > > > > > > > > The reason why I'm using two BasePage, When the members visit the > > > website , > > > > I want to show only BasePage1 menu > > > > > > > > When the visitor login in , I want to show the Management Page menu > > > > (BasePage2)... but problem is, when they login in, if they click the > > > > brandname, wicket forward them to HomePage...I don't want to do this > :( > > > so > > > > I try to override brandname link in every BasePage... I used your > > saying > > > > but it doesn't work > > > > > > > > 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)} > > > > } > > > > > > > > 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 11:18 PM, Martin Grigorov < > > mgrigo...@apache.org> > > > > wrote: > > > > > > > > > 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...A
Re: About BasePage's BrandName setting
https://github.com/cortix/project/pull/1 Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 12, 2015 at 3:52 PM, Hasan Çelik wrote: > Sorry about that, it's my fault, I didn't know that it was about > wicket-bootstrap... By the way > > I googled and I have found that > > https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/385 > > But I didnt override newBrandNameLink in the BasePage...Where should I > override it ? > > Thank you so much for these information and your patience > > Best 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 Mon, Jan 12, 2015 at 3:15 PM, Martin Grigorov > wrote: > > > Hi, > > > > Please read again what I've explained in my previous mail. > > Your 'brandName' component is broken. > > 1) It is a . Must be > > 2) It is not needed at all. You see Bootstrap's brandName link in the > > produced UI. Your custom brand name produces without > any > > text so you don't see it in the UI at all. > > 3) read Bootstrap docs for expected HTML template for Navbar and check it > > against what your application produces. > > 4) You need to override > > > > > https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/navbar/Navbar.java#L229 > > instead of using your own component for brandName. Your first messages > > didn't explain that you use Wicket-Bootstrap so I wasn't able to suggest > > you this then > > > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Mon, Jan 12, 2015 at 2:08 PM, Hasan Çelik > wrote: > > > > > Hi Martin, > > > > > > The reason why I'm using two BasePage, When the members visit the > > website , > > > I want to show only BasePage1 menu > > > > > > When the visitor login in , I want to show the Management Page menu > > > (BasePage2)... but problem is, when they login in, if they click the > > > brandname, wicket forward them to HomePage...I don't want to do this :( > > so > > > I try to override brandname link in every BasePage... I used your > saying > > > but it doesn't work > > > > > > 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)} > > > } > > > > > > 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 11:18 PM, Martin Grigorov < > mgrigo...@apache.org> > > > wrote: > > > > > > > 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 > > > > >
Re: About BasePage's BrandName setting
Sorry about that, it's my fault, I didn't know that it was about wicket-bootstrap... By the way I googled and I have found that https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/385 But I didnt override newBrandNameLink in the BasePage...Where should I override it ? Thank you so much for these information and your patience Best 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 Mon, Jan 12, 2015 at 3:15 PM, Martin Grigorov wrote: > Hi, > > Please read again what I've explained in my previous mail. > Your 'brandName' component is broken. > 1) It is a . Must be > 2) It is not needed at all. You see Bootstrap's brandName link in the > produced UI. Your custom brand name produces without any > text so you don't see it in the UI at all. > 3) read Bootstrap docs for expected HTML template for Navbar and check it > against what your application produces. > 4) You need to override > > https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/navbar/Navbar.java#L229 > instead of using your own component for brandName. Your first messages > didn't explain that you use Wicket-Bootstrap so I wasn't able to suggest > you this then > > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Mon, Jan 12, 2015 at 2:08 PM, Hasan Çelik wrote: > > > Hi Martin, > > > > The reason why I'm using two BasePage, When the members visit the > website , > > I want to show only BasePage1 menu > > > > When the visitor login in , I want to show the Management Page menu > > (BasePage2)... but problem is, when they login in, if they click the > > brandname, wicket forward them to HomePage...I don't want to do this :( > so > > I try to override brandname link in every BasePage... I used your saying > > but it doesn't work > > > > 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)} > > } > > > > 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 11:18 PM, Martin Grigorov > > wrote: > > > > > 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 < > > mgrigo...@apache.org> > > > > 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 > > > > > > > > > > O
Re: About BasePage's BrandName setting
Hi, Please read again what I've explained in my previous mail. Your 'brandName' component is broken. 1) It is a . Must be 2) It is not needed at all. You see Bootstrap's brandName link in the produced UI. Your custom brand name produces without any text so you don't see it in the UI at all. 3) read Bootstrap docs for expected HTML template for Navbar and check it against what your application produces. 4) You need to override https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/navbar/Navbar.java#L229 instead of using your own component for brandName. Your first messages didn't explain that you use Wicket-Bootstrap so I wasn't able to suggest you this then Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 12, 2015 at 2:08 PM, Hasan Çelik wrote: > Hi Martin, > > The reason why I'm using two BasePage, When the members visit the website , > I want to show only BasePage1 menu > > When the visitor login in , I want to show the Management Page menu > (BasePage2)... but problem is, when they login in, if they click the > brandname, wicket forward them to HomePage...I don't want to do this :( so > I try to override brandname link in every BasePage... I used your saying > but it doesn't work > > 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)} > } > > 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 11:18 PM, Martin Grigorov > wrote: > > > 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 < > mgrigo...@apache.org> > > > 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 > > > > > > > > > >
Re: Ajax download stops AjaxSelfUpdatingTimer
Enable Ajax debug panel and see whether there are any interesting log messages. For example: https://github.com/apache/wicket/blob/4d2e5680b23e55984e8ac159bdce63629e57df12/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L288 If your JS knowledge is good enough then you may try to debug Wicket.Ajax.ajax() yourself. The timer should fire calls to this method but they are suppressed for some reason. Either the channel is busy, or there is a precondition that stops the ajax calls. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 12, 2015 at 1:58 PM, elvis.ciocoiu wrote: > Hi again, > > Basically I have a label refreshed automatically with: > > > It is refreshed automatically by the timer until I click an ajax link like > the following: > > > After I click the download link the file is downloaded but the ajax timer > behavior is not triggered anymore. > > Thank you. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Ajax-download-stops-AjaxSelfUpdatingTimer-tp4668978p4668983.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
Hi Martin, The reason why I'm using two BasePage, When the members visit the website , I want to show only BasePage1 menu When the visitor login in , I want to show the Management Page menu (BasePage2)... but problem is, when they login in, if they click the brandname, wicket forward them to HomePage...I don't want to do this :( so I try to override brandname link in every BasePage... I used your saying but it doesn't work 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)} } 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 11:18 PM, Martin Grigorov wrote: > 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, > > > > > > > >
Re: Ajax download stops AjaxSelfUpdatingTimer
Hi again, Basically I have a label refreshed automatically with: It is refreshed automatically by the timer until I click an ajax link like the following: After I click the download link the file is downloaded but the ajax timer behavior is not triggered anymore. Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-download-stops-AjaxSelfUpdatingTimer-tp4668978p4668983.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: Change in configuring AtmosphereServlet init-params
You are right. The filter allows the client to know the length of pushed messages. I believe it was also needed for very long messages. The problem with the default filter was, that the separator was far too common to use for wicket's Ajax responses and the default implementation did not offer a way to change the separator. This was fixed in recent versions of Atmosphere. In fact, changes to the API broke the old one, so I needed to replace it with the improved default. Best regards, Emond On Sunday 11 January 2015 21:54:36 Martin Grigorov wrote: > 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 > lue>> > > >> > > >> > > >> To: > > >> > > >> > > >> org.atmosphere.cpr.AtmosphereInterceptor > > > > org.atmosphere.client.TrackMessageSizeInterceptor > e>> > > >> > > >> > > > > org.atmosphere.client.TrackMessageSizeInterceptor.delimiter > aram-name>> > > >> > > >> > > >> > > >> > > >> 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax download stops AjaxSelfUpdatingTimer
Hi, On Mon, Jan 12, 2015 at 7:48 AM, elvis.ciocoiu wrote: > 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 > < > 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. > I think this was added by Martin Grigorov to give a chance to AJAX channels to be freed: initially it was window.location.href='" + url;. If you comment it, of course, download will not work: because this what triggers download. > 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. > Can you create a quick-start reproducing this problem? > > 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 > > -- Regards - Ernesto Reinaldo Barreiro