how to change the panel data from a modal window opened from AjaxLink.onClick() ?
Hi all, dear wicket experts! I have some issue in my code, I suspect that it is because of ajax behavior, that I not quite understand. I have a MyPanel extends CheckedFolderT, that I create in NestedTree.newContentComponent() {}. This MyPanel has some public data, boolean bChanged for example. MyPanel has an AjaxLink that creates and shows a ModalWindow using for edit a MyPanel data. MyPanel.java public class MyPanel extends CheckedFolderT { public MyPanel(String id, AbstractTree tree, IModelT model, ModalWindow dialog, ...) { ... AjaxLink link = new AjaxLink(editlink, model) { public void onClick(AjaxRequestTarget target) { MyPanel.this.dialog.setWindowClosedCallback(new WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { if*(bChanged == true)* { //update Panel model, to show an updated in ModalWindow data in a tree MyPanel.this.tree.updateNode(model.getObject(), target); } } } MyPanel.this.dialog.setPageCreator(new ModalWindow.PageCreator() { return new EditPage(MyPanel panel, ...); } MyPanel.this.dialog.show(target); } } } } In an EditPage I try to modify MyPanel.bChanged field when a user changed Panel data and try to close a Modal EditPage. EditPage.java ... protected void onSubmit(AjaxRequestTarget target, Form? form) { panel.bChanged = true; EditPage.this.modalWindow.close(target); } When ModalWindow closed, onClose(AjaxRequestTarget target) method in MyPanel fired. But a bChanged is always false in it. Why? And hence the more general question: How can I know that data in a modal EditPage is changed by user? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216.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: how to change the panel data from a modal window opened from AjaxLink.onClick() ?
Addition: NestedTree and ModalWindow is placed on a TreePage: TreePage.html div wicket:id=modaleditdialog/div div wicket:id=tree[tree]/div TreePage.java public TreePage () { dialog = new ModalEditDialog(modaleditdialog); dialog.setResizable(true); dialog.setAutoSize(true); dialog.setOutputMarkupId(true); ... add(dialog); NestedTreeT nestedTree = new NestedTreeT(id, provider) { protected Component newContentComponent(String id, IModelT model) { MyPanel panel = new MyPanel(id, this, model, dialog,...); panel.setOutputMarkupId(true); return panel; } } nestedTree.setOutputMarkupId(true); add(nestedTree); ... } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216p4666217.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: Empty FeedbackPanel
Hi, Do you use Ajax submit ? If YES then you need to override #onError(AjaxRequestTarget, Form) add add the feedback to the target manually. Martin Grigorov Wicket Training and Consulting On Wed, Jun 11, 2014 at 6:21 PM, Lucio Crusca lu...@sulweb.org wrote: Here is a form: http://158.58.168.198/quotaly/wicket/bookmarkable/it.quotaly.web.Register here is the relevant html snippet: form class=inputForm wicket:id=registrationform fieldset legendInserisci i tuoi dati/legend div id=feedbackPanel span wicket:id=feedback/ /div div class=campoform label wicket:for=nome span class=inputformlabelspanNome */span span class=inputWrapper input type=text class=text_reg placeholder=nome wicket:id=nome /span /label /div [...] and java code: registrationform.add(new TextField(nome).setRequired(true)); registrationform.add(new FeedbackPanel(feedback)); If you click the Invia button (italian for Submit), the validation takes place (in fact my onSubmit() does not get called since many required fields are not filled in), but the FeedbackPanel remains empty (take a look at generated html). Similar code works in other wicket projects I've done, so I don't know what I'm doing different/wrong here... any clue? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to change the panel data from a modal window opened from AjaxLink.onClick() ?
Hi, The problem is that EditPage when deserialized creates a new copy of MyPanel instance and its bChanged member field. The best/simplest way is to use a Panel as ModalWindow content instead of a Page. Another way to share bChanged between the pages is to store it in the session (i.e. MySession#bChanged). Yet another way is to get a reference to bChanged thru the first page: - pass a PageReference of page1 to editpage and later use it: pageRef.getPage().setChanged(true) Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 9:54 AM, Duke warlock9...@gmail.com wrote: Addition: NestedTree and ModalWindow is placed on a TreePage: TreePage.html div wicket:id=modaleditdialog/div div wicket:id=tree[tree]/div TreePage.java public TreePage () { dialog = new ModalEditDialog(modaleditdialog); dialog.setResizable(true); dialog.setAutoSize(true); dialog.setOutputMarkupId(true); ... add(dialog); NestedTreeT nestedTree = new NestedTreeT(id, provider) { protected Component newContentComponent(String id, IModelT model) { MyPanel panel = new MyPanel(id, this, model, dialog,...); panel.setOutputMarkupId(true); return panel; } } nestedTree.setOutputMarkupId(true); add(nestedTree); ... } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216p4666217.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: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]
How about an AjaxBehavior with the onChange event? Assuming you mean AjaxEventBehavior (because I couldn't find any AjaxBehavior class), I tried with change, onChange and onchange strings as event, but none of them seemed to work: the onEvent method was never called. On Jun 11, 2014, at 9:10 AM, Lucio Crusca lu...@sulweb.org wrote: Martin was right, there were Javascript errors, but for some reason the webconsole didn't display them the first time I looked at it. However the problem is only partially solved. onUpdate() now gets called, but only when the TextField looses focus. I need it to be called on every single keypress... is there anything I should do for that? - 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: Wicket Hight chart issue
Hi, I am not sure that Wicket Charts developer is subscribed to the mailing lists. You can ask for help at https://github.com/thombergs/wicked-charts/issues Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 6:13 AM, prabu prabumc...@gmail.com wrote: Hello Team, I have started using Wicket Chart for my project (web based Java project) and I am facing some difficulties to meet requirement. I wanted to archive below chart using Wicket chart http://apache-wicket.1842946.n4.nabble.com/file/n4666214/image001.png I can’t able to get exactly like above. But I got into this level using some example (wicked-charts-highcharts-1.5.0.jar and wicked-charts-wicket6-1.5.0.jar) http://apache-wicket.1842946.n4.nabble.com/file/n4666214/image002.png Issue Currently I am facing 1.Not able to remove background rectangle white box 2.Not able to set values ( 23% 10% 8% ..) in all layer 3.Not able to move all links text ( Ex: 1,170,233 under 50 years ) to right like first example I am developing using java and attached java file I am currently using. ConsumerAnalysticsHome.java http://apache-wicket.1842946.n4.nabble.com/file/n4666214/ConsumerAnalysticsHome.java DonutOptions.java http://apache-wicket.1842946.n4.nabble.com/file/n4666214/DonutOptions.java ShowcaseOptions.java http://apache-wicket.1842946.n4.nabble.com/file/n4666214/ShowcaseOptions.java Please kindly help us. Thanks in advance Regards Prabu.N -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Hight-chart-issue-tp4666214.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: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]
OnChangeAjaxBehavior is the right way. It uses either 'input' event when supported or 'cut'+'paste'+'keydown' when 'input' is not supported by the browser. Which browser do you use ? You can always use AjaxFormComponentUpdatingBehavior(keyup) but it will fire even when you use keys like ESC, F2, etc. You can filter those with AjaxCallListener's precondition. Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 10:34 AM, Lucio Crusca lu...@sulweb.org wrote: How about an AjaxBehavior with the onChange event? Assuming you mean AjaxEventBehavior (because I couldn't find any AjaxBehavior class), I tried with change, onChange and onchange strings as event, but none of them seemed to work: the onEvent method was never called. On Jun 11, 2014, at 9:10 AM, Lucio Crusca lu...@sulweb.org wrote: Martin was right, there were Javascript errors, but for some reason the webconsole didn't display them the first time I looked at it. However the problem is only partially solved. onUpdate() now gets called, but only when the TextField looses focus. I need it to be called on every single keypress... is there anything I should do for that? - 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: Empty FeedbackPanel
Hi, Do you use Ajax submit ? If YES then you need to override #onError(AjaxRequestTarget, Form) add add the feedback to the target manually. What is Ajax submit? How do I check whether I'm using it? (I suspect the reply is no, you're not using it since you do not even know what it is). However I have a suspect, there's another strange thing in that form, maybe the two things are related: look at the five check boxes down the form, one of them doesn't show the image: http://158.58.168.198/quotaly/wicket/bookmarkable/it.quotaly.web.Register but if you look at the generated HTML, the image is actually there, and if you click the link in img src=... you actually see the image. Now, how that could be a cause or consequence of missing FeedbackPanel is beyond any stretch of my imagination, but those two things share a common fact: both do not show up when they should. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Empty FeedbackPanel
Ajax submit is when you use AjaxSubmitLink or AjaxButton for the input type=submit I just checked and it seems you don't use any of these. Do you override Form#onError() or Button#onError() and what do you do there ? Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 10:47 AM, Lucio Crusca lu...@sulweb.org wrote: Hi, Do you use Ajax submit ? If YES then you need to override #onError(AjaxRequestTarget, Form) add add the feedback to the target manually. What is Ajax submit? How do I check whether I'm using it? (I suspect the reply is no, you're not using it since you do not even know what it is). However I have a suspect, there's another strange thing in that form, maybe the two things are related: look at the five check boxes down the form, one of them doesn't show the image: http://158.58.168.198/quotaly/wicket/bookmarkable/it.quotaly.web.Register but if you look at the generated HTML, the image is actually there, and if you click the link in img src=... you actually see the image. Now, how that could be a cause or consequence of missing FeedbackPanel is beyond any stretch of my imagination, but those two things share a common fact: both do not show up when they should. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Empty FeedbackPanel
Wow! IMHO your answer is very un-respectful even if you don't notice it. Your first message to this list is from January 2013... and you still don't know what is an AJAX submit? Time to start reading a bit about the framework you are using? Instead of expecting people to solve your problems ;-) On Thu, Jun 12, 2014 at 10:47 AM, Lucio Crusca lu...@sulweb.org wrote: Hi, Do you use Ajax submit ? If YES then you need to override #onError(AjaxRequestTarget, Form) add add the feedback to the target manually. What is Ajax submit? How do I check whether I'm using it? (I suspect the reply is no, you're not using it since you do not even know what it is). However I have a suspect, there's another strange thing in that form, maybe the two things are related: look at the five check boxes down the form, one of them doesn't show the image: http://158.58.168.198/quotaly/wicket/bookmarkable/it.quotaly.web.Register but if you look at the generated HTML, the image is actually there, and if you click the link in img src=... you actually see the image. Now, how that could be a cause or consequence of missing FeedbackPanel is beyond any stretch of my imagination, but those two things share a common fact: both do not show up when they should. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro
Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]
OnChangeAjaxBehavior is the right way. It uses either 'input' event when supported or 'cut'+'paste'+'keydown' when 'input' is not supported by the browser. Which browser do you use ? Tested with IceWeasel 24.4.0, Chrome 33 for Linux and Firefox 27 for Windows. You can always use AjaxFormComponentUpdatingBehavior(keyup) but it will fire even when you use keys like ESC, F2, etc. You can filter those with AjaxCallListener's precondition. But I haven't any forms. May I use AjaxFormComponentUpdatingBehavior nevertheless? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to change the panel data from a modal window opened from AjaxLink.onClick() ?
Thanks Martin! I tried to use a reference to bChanged through the first page, but it permanently bind ModalWindow with first page and I cant use it in another pages. For the first way - There will be no serialization/deserialization when I will use Panel insted of a Page in ModalWindow? Best regards, -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216p4666227.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: rant level=8/10 Empty FeedbackPanel
Wow! IMHO your answer is very un-respectful even if you don't notice it. Your first message to this list is from January 2013... and you still don't know what is an AJAX submit? Time to start reading a bit about the framework you are using? Instead of expecting people to solve your problems ;-) *MY* reply is un-respectful? Did you really say *THAT*? FYI: I've been using wicket since then and I never needed an Ajax submit (I still don't need it now). Why should I study something I don't need? And, while I'm at it, Wicket is well known for being powerful but poorly documented. Wicket enthusiasts reply saying that Wicket has a wonderful active community that can help you and provide for the lack of documentation, hence people is more inclined to ask the community rather than to study a sub-optimal documentation. Moreover I don't expect anyone doing anything: I just ask, if someone is so kind as to reply, so good. If no one replies it means I asked in the wrong place or in the wrong way. But if I get such harsh replies like yours, I assume either you are a troll or you've had a bad day, now you choose, I suspect the latter, since you are into wicket much more than many others on this list. However please take note: I'm sorry for you but I'm not guilty for your bad day. And, while you spend your valuable time into looking at my past messages, please observe that I even tried to help others at least once I remember of, maybe a few times, the few times I felt like I could actually help. I know, you've done much more than me for this community, and I hope one day I will have your reputation and deserve your respect, but that day, if it ever comes, I'll try to be kind to others too, which is not an optional behavior even when you are a wicket expert. That being said, I wish you all the best nevertheless. /rant - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Empty FeedbackPanel
Ajax submit is when you use AjaxSubmitLink or AjaxButton for the input type=submit I just checked and it seems you don't use any of these. Do you override Form#onError() or Button#onError() and what do you do there ? None of them. I only override Button#onSubmit(). - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: rant level=8/10 Empty FeedbackPanel
Hi Lucio, People may complain that Wicket documentation is poor but it seems these people didn't bother to read either the reference guide [1], nor any of the published books [2]. All of them explain how to submit a form with Ajax 1. http://wicket.apache.org/guide/ 2. http://wicket.apache.org/learn/books/ P.S. Please don't change the subject of your mails because this breaks the way some mail clients follow a thread/discussion. Just create a new thread when you have a new question. Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 11:54 AM, Lucio Crusca lu...@sulweb.org wrote: Wow! IMHO your answer is very un-respectful even if you don't notice it. Your first message to this list is from January 2013... and you still don't know what is an AJAX submit? Time to start reading a bit about the framework you are using? Instead of expecting people to solve your problems ;-) *MY* reply is un-respectful? Did you really say *THAT*? FYI: I've been using wicket since then and I never needed an Ajax submit (I still don't need it now). Why should I study something I don't need? And, while I'm at it, Wicket is well known for being powerful but poorly documented. Wicket enthusiasts reply saying that Wicket has a wonderful active community that can help you and provide for the lack of documentation, hence people is more inclined to ask the community rather than to study a sub-optimal documentation. Moreover I don't expect anyone doing anything: I just ask, if someone is so kind as to reply, so good. If no one replies it means I asked in the wrong place or in the wrong way. But if I get such harsh replies like yours, I assume either you are a troll or you've had a bad day, now you choose, I suspect the latter, since you are into wicket much more than many others on this list. However please take note: I'm sorry for you but I'm not guilty for your bad day. And, while you spend your valuable time into looking at my past messages, please observe that I even tried to help others at least once I remember of, maybe a few times, the few times I felt like I could actually help. I know, you've done much more than me for this community, and I hope one day I will have your reputation and deserve your respect, but that day, if it ever comes, I'll try to be kind to others too, which is not an optional behavior even when you are a wicket expert. That being said, I wish you all the best nevertheless. /rant - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Empty FeedbackPanel
If you are able to reproduce this in a mini application (a quickstart app) then please attach it to a ticket in Jira and we will see what is going wrong. Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 11:55 AM, Lucio Crusca lu...@sulweb.org wrote: Ajax submit is when you use AjaxSubmitLink or AjaxButton for the input type=submit I just checked and it seems you don't use any of these. Do you override Form#onError() or Button#onError() and what do you do there ? None of them. I only override Button#onSubmit(). - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: rant level=8/10 Empty FeedbackPanel
Hi, Yes I have a bad day... but my answer has nothing to do with that. 1- You ask a question. Someone ask you about the details. 2- You answer very vaguely... If you have taken just two seconds to google for it https://www.google.com/search?q=wickt+AJAX+submitoq=wickt+AJAX+submitaqs=chrome..69i57j0l3.4663j0j1client=ubuntu-browsersourceid=chromeie=UTF-8#q=wicket+AJAX+submit you could have answered NO I DON'T USE AJAX or YES I DO USE AJAX. 3- The person that is answering your e-mail is a commiter. He spends many hours solving real problems/improving the framework. I know for sure that this person sacrifices his personal time to help other people and make the framework better. 4- Given what I said in 3, it is my opinion that you have to value better their time, and doing that, IMHO, is best way I know to show them respect. 5- I personally has spent many hours of my free time trying to help others and the community. This does not give me any rights whatsoever. It just sometimes makes me angry when I see people do not value the time the others spend helping (or trying to help) them. 6- Complaining about things is easy, e.g. lack of documentation, stepping forward and helping fix them is VERY hard. Having said the above, I apologize to you for my harsh words. On Thu, Jun 12, 2014 at 11:54 AM, Lucio Crusca lu...@sulweb.org wrote: Wow! IMHO your answer is very un-respectful even if you don't notice it. Your first message to this list is from January 2013... and you still don't know what is an AJAX submit? Time to start reading a bit about the framework you are using? Instead of expecting people to solve your problems ;-) *MY* reply is un-respectful? Did you really say *THAT*? FYI: I've been using wicket since then and I never needed an Ajax submit (I still don't need it now). Why should I study something I don't need? And, while I'm at it, Wicket is well known for being powerful but poorly documented. Wicket enthusiasts reply saying that Wicket has a wonderful active community that can help you and provide for the lack of documentation, hence people is more inclined to ask the community rather than to study a sub-optimal documentation. Moreover I don't expect anyone doing anything: I just ask, if someone is so kind as to reply, so good. If no one replies it means I asked in the wrong place or in the wrong way. But if I get such harsh replies like yours, I assume either you are a troll or you've had a bad day, now you choose, I suspect the latter, since you are into wicket much more than many others on this list. However please take note: I'm sorry for you but I'm not guilty for your bad day. And, while you spend your valuable time into looking at my past messages, please observe that I even tried to help others at least once I remember of, maybe a few times, the few times I felt like I could actually help. I know, you've done much more than me for this community, and I hope one day I will have your reputation and deserve your respect, but that day, if it ever comes, I'll try to be kind to others too, which is not an optional behavior even when you are a wicket expert. That being said, I wish you all the best nevertheless. /rant - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro
Re: Backward compatibility with URLs generated by HybridUrlCodingStrategy.
Many thanks Martin, I followed your advice and ended up overriding SystemMapper's mapRequest. I decided to simply strip away the page instance instead of moving it to the query string. It's just noise for me, after all. Quite rough probably, but it seems to do the job in all the cases I tried. Do you foresee any problem with this piece of code? I'm not really confident the way to identify the page instance is correct, and I'm afraid it could add too much overhead (note: isNumber is implemented using Character.isDigit, as suggested here: http://jdevelopment.nl/efficient-determine-string-number/). setRootRequestMapper(*new* SystemMapper(*this*) { @Override *public* IRequestHandler mapRequest(Request request) { *final* Url url = request.getUrl(); *final* String lastSegment = !url.getSegments().isEmpty() ? url.getSegments().get(url.getSegments().size() - 1) : *null*; *if* (lastSegment != *null* lastSegment.contains(.)) { *final* String presumedPageInstance = lastSegment.substring(lastSegment.lastIndexOf(.) + 1); *if* (isNumber(presumedPageInstance)) { // If it's a number, assume it's the page Id and strip it from the request URL. *final* String cleanedUpLastSegment = lastSegment.substring(0, lastSegment.lastIndexOf(.)); url.getSegments().set(url.getSegments().size() - 1, cleanedUpLastSegment); *return* *super*.mapRequest(request.cloneWithUrl(url)); } } *return* *super*.mapRequest(request); } }); Many thanks, Fabio On Wed, Jun 11, 2014 at 2:12 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi Fabio, You can create your own root request mapper that when detecting an old url can either : 1) return a redirect with code 301 (Moved permanently) 2) just move the page id from the last segment to the query string silently Martin Grigorov Wicket Training and Consulting On Wed, Jun 11, 2014 at 1:00 PM, Fabio Fioretti windom.macroso...@gmail.com wrote: Hi all, I am migrating an application from Wicket 1.4 to 6.15. This app makes use of HybridUrlCodingStrategy, that I replaced with a MountedMapped using UrlPathPageParametersEncoder. The problem is that many users have old bookmarks of URLs generated by HybridUrlCodingStrategy, in which the page instance number comes after a dot, like in the following example: http://myapp.com/mount/path/param/value.4 Now, with MountedMapper and UrlPathPageParametersEncoder, the same URL looks like this (mind the ? replacing the .): http://myapp.com/mount/path/param/value?4 The result is that the old dotted bookmarks do not work anymore (HTTP 404). Any suggestion on the best approach to guarantee backward compatibility with old URLs? Thanks very much in advance, Fabio Fioretti
Re: Empty FeedbackPanel
If you are able to reproduce this in a mini application (a quickstart app) then please attach it to a ticket in Jira and we will see what is going wrong. Thanks: https://issues.apache.org/jira/browse/WICKET-5614 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Empty FeedbackPanel
Hi, As far as I can see you are adding components on onBeforeRender(). So, all components are recreated any time page is rendered Move your logic to onInitialize and you will see your feedback messages appear. On Thu, Jun 12, 2014 at 2:22 PM, Lucio Crusca lu...@sulweb.org wrote: If you are able to reproduce this in a mini application (a quickstart app) then please attach it to a ticket in Jira and we will see what is going wrong. Thanks: https://issues.apache.org/jira/browse/WICKET-5614 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro
Re: Backward compatibility with URLs generated by HybridUrlCodingStrategy.
Hi Fabio, The code looks OK! Indeed it is not very easy to create really bookmarkable url! The page has to be stateless to have url that will produce the same result every time. With stateful pages (pages with pageId in their url) there is a chance to load something different than what you expect ... but all this is known. You can search the mail archives for NoVersionRequestMapper to workaround this. But it will lead to different kind of problems. Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 2:19 PM, Fabio Fioretti windom.macroso...@gmail.com wrote: Many thanks Martin, I followed your advice and ended up overriding SystemMapper's mapRequest. I decided to simply strip away the page instance instead of moving it to the query string. It's just noise for me, after all. Quite rough probably, but it seems to do the job in all the cases I tried. Do you foresee any problem with this piece of code? I'm not really confident the way to identify the page instance is correct, and I'm afraid it could add too much overhead (note: isNumber is implemented using Character.isDigit, as suggested here: http://jdevelopment.nl/efficient-determine-string-number/). setRootRequestMapper(*new* SystemMapper(*this*) { @Override *public* IRequestHandler mapRequest(Request request) { *final* Url url = request.getUrl(); *final* String lastSegment = !url.getSegments().isEmpty() ? url.getSegments().get(url.getSegments().size() - 1) : *null*; *if* (lastSegment != *null* lastSegment.contains(.)) { *final* String presumedPageInstance = lastSegment.substring(lastSegment.lastIndexOf(.) + 1); *if* (isNumber(presumedPageInstance)) { // If it's a number, assume it's the page Id and strip it from the request URL. *final* String cleanedUpLastSegment = lastSegment.substring(0, lastSegment.lastIndexOf(.)); url.getSegments().set(url.getSegments().size() - 1, cleanedUpLastSegment); *return* *super*.mapRequest(request.cloneWithUrl(url)); } } *return* *super*.mapRequest(request); } }); Many thanks, Fabio On Wed, Jun 11, 2014 at 2:12 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi Fabio, You can create your own root request mapper that when detecting an old url can either : 1) return a redirect with code 301 (Moved permanently) 2) just move the page id from the last segment to the query string silently Martin Grigorov Wicket Training and Consulting On Wed, Jun 11, 2014 at 1:00 PM, Fabio Fioretti windom.macroso...@gmail.com wrote: Hi all, I am migrating an application from Wicket 1.4 to 6.15. This app makes use of HybridUrlCodingStrategy, that I replaced with a MountedMapped using UrlPathPageParametersEncoder. The problem is that many users have old bookmarks of URLs generated by HybridUrlCodingStrategy, in which the page instance number comes after a dot, like in the following example: http://myapp.com/mount/path/param/value.4 Now, with MountedMapper and UrlPathPageParametersEncoder, the same URL looks like this (mind the ? replacing the .): http://myapp.com/mount/path/param/value?4 The result is that the old dotted bookmarks do not work anymore (HTTP 404). Any suggestion on the best approach to guarantee backward compatibility with old URLs? Thanks very much in advance, Fabio Fioretti
Re: Backward compatibility with URLs generated by HybridUrlCodingStrategy.
Hi Martin, Thanks for your time and help. Even though my 1.4 URLs contain pageIds, in the moment they were bookmarked they were basically made stateless to my application, as the pageId lost meaning. It is now just noise that gets misinterpreted by the migrated app because of the dotted notation. All I wanted to achieve is to make them work in Wicket 6.x and, to do that, it is sufficient to strip the bookmarked pageId away and let Wicket reassign a new one with the proper encoding (? instead of .). Kind regards, Fabio On Thu, Jun 12, 2014 at 2:54 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi Fabio, The code looks OK! Indeed it is not very easy to create really bookmarkable url! The page has to be stateless to have url that will produce the same result every time. With stateful pages (pages with pageId in their url) there is a chance to load something different than what you expect ... but all this is known. You can search the mail archives for NoVersionRequestMapper to workaround this. But it will lead to different kind of problems. Martin Grigorov Wicket Training and Consulting On Thu, Jun 12, 2014 at 2:19 PM, Fabio Fioretti windom.macroso...@gmail.com wrote: Many thanks Martin, I followed your advice and ended up overriding SystemMapper's mapRequest. I decided to simply strip away the page instance instead of moving it to the query string. It's just noise for me, after all. Quite rough probably, but it seems to do the job in all the cases I tried. Do you foresee any problem with this piece of code? I'm not really confident the way to identify the page instance is correct, and I'm afraid it could add too much overhead (note: isNumber is implemented using Character.isDigit, as suggested here: http://jdevelopment.nl/efficient-determine-string-number/). setRootRequestMapper(*new* SystemMapper(*this*) { @Override *public* IRequestHandler mapRequest(Request request) { *final* Url url = request.getUrl(); *final* String lastSegment = !url.getSegments().isEmpty() ? url.getSegments().get(url.getSegments().size() - 1) : *null*; *if* (lastSegment != *null* lastSegment.contains(.)) { *final* String presumedPageInstance = lastSegment.substring(lastSegment.lastIndexOf(.) + 1); *if* (isNumber(presumedPageInstance)) { // If it's a number, assume it's the page Id and strip it from the request URL. *final* String cleanedUpLastSegment = lastSegment.substring(0, lastSegment.lastIndexOf(.)); url.getSegments().set(url.getSegments().size() - 1, cleanedUpLastSegment); *return* *super*.mapRequest(request.cloneWithUrl(url)); } } *return* *super*.mapRequest(request); } }); Many thanks, Fabio On Wed, Jun 11, 2014 at 2:12 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi Fabio, You can create your own root request mapper that when detecting an old url can either : 1) return a redirect with code 301 (Moved permanently) 2) just move the page id from the last segment to the query string silently Martin Grigorov Wicket Training and Consulting On Wed, Jun 11, 2014 at 1:00 PM, Fabio Fioretti windom.macroso...@gmail.com wrote: Hi all, I am migrating an application from Wicket 1.4 to 6.15. This app makes use of HybridUrlCodingStrategy, that I replaced with a MountedMapped using UrlPathPageParametersEncoder. The problem is that many users have old bookmarks of URLs generated by HybridUrlCodingStrategy, in which the page instance number comes after a dot, like in the following example: http://myapp.com/mount/path/param/value.4 Now, with MountedMapper and UrlPathPageParametersEncoder, the same URL looks like this (mind the ? replacing the .): http://myapp.com/mount/path/param/value?4 The result is that the old dotted bookmarks do not work anymore (HTTP 404). Any suggestion on the best approach to guarantee backward compatibility with old URLs? Thanks very much in advance, Fabio Fioretti
Re: FileDownload hides the activity indicator
Ernesto, Well the change seems to work. I am using a button that shows an activity indicator with a veil for the request. So now that activity indicator and veil is shown while the file is generated. But they go away when the file is downloaded and the user can start clicking the button again. When the file download is completed the requests for previous clicks start again. BTW, I just realized that my code is actually based on your code on https://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Thanks for putting it up. Really helpful. May be you can update it so that it will take care of the problem that I have. That is showing the activity indicator during the complete file generation and download. Thanks again. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/FileDownload-hides-the-activity-indicator-tp4666181p4666241.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: UploadProgressBar broken with update to v6.13.0
Confirmed, see https://issues.apache.org/jira/browse/WICKET-5615. Thanks for reporting the issue. Sven On 06/12/2014 05:17 PM, René Hartwig wrote: Hi, I just recognized that the UploadProgressBar has been broken by changes made in Version 6.13.0 - I assume because of https://issues.apache.org/jira/browse/WICKET-5420 I tested with Firefox v.30.0, IE 10 and IE 11 - the progress bar is showing up with v6.12.0, but not with 6.13.0 Attached is a quickstart project I successfully tested this with. Can you confirm this? Thanks and best regards, René -- Mit freundlichen Grüßen / Best regards, René Hartwig Senior Developer *Befine Solutions AG - The Cryptshare Company* Bebelstraße 17 79108 Freiburg Germany Tel: +49 (0) 761 38913 0 Fax: +49 (0) 761 38913 115 E-Mail: _Rene.Hartwig@befine-solutions.com_ Internet: http://www.cryptshare.com = Your attachments are too large or too confidential for e-mail? Get to know Cryptshare! http://www.cryptshare.com = http://www.linkedin.com/company/befine-solutions/products Amtsgericht Freiburg HRB 6144 Vorstand Mark Forrest, Dominik Lehr Aufsichtsratsvorsitzender Thilo Braun - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAX update and file download on Wicket 1.5
Hi, Suppose there is some problem or exception in the file download. Let's say in the following method: protected IResourceStream getResourceStream() { return new AbstractResourceStreamWriter() { public void write(Response output) { WebResponse response = (WebResponse)output; byte[] buffer = new byte[256]; try { int read; while((read = is.read(buffer)) != -1) { response.write(buffer, 0, read); response.flush(); } response.close(); } catch (Exception e) { response.write(e.toString().getBytes()); response.close(); } } }; } And I want to show the error in the feedback panel for the page. How can I do that? The AjaxRequestTarget is not available here. I tried to do something like the following but it did not work: parentPage.getSession().error(error); WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(parentPage); target.add(parentPage.getFeedback()); I also tried saving the AjaxRequestTarget passed in the initiate method as a member variable of the class and use it later for posting the error. Well, for one it did not work. For second, I got the non serializable error for the target in the log. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAX-update-and-file-download-on-Wicket-1-5-tp4095241p4666243.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