Re: Feedback Panel
Enable DEBUG logging for org.apache.wicket.Localizer and see what is attempted. On Wed, Aug 17, 2011 at 3:38 PM, McDulin, Bill bmcdu...@cardinalsolutions.com wrote: Hi, I am using the BigDecimalConverter which is being fired before the Validation occurs inside of a form. This is then in turn calling the onError inside of my Form. I was curious as to what the resource key value is that is being returned so that I can customize it for some custom message. Thanks, Bill McDulin Cardinal Solutions Group, Inc. cell: (513) 889-6686 http://www.cardinalsolutions.com/ bmcdu...@cardinalsolutions.commailto:bmcdu...@cardinalsolutions.com This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain private, confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, employee or agent responsible for delivering this message, please contact the sender by reply e-mail and destroy all copies of the original e-mail message. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onchane not working with jquery numeric plugin
Hi Rebecca, I'm quite new to wicket but I've had a similar problem before. I would imagine that the jquery function must be binded to the same behaviour (onchange) that you're using in your code. If you change your code to be triggered onblur, does this happen as well? On 18 Aug 2011 06:31, rebecca rivka.shis...@gmail.com wrote: hello, I'm using wicket 1.4.16. I have a simple text field component on a phone number panel. I used TexoTela's jquery plugin jquery.numeric to enable only numeric input to the text field. I added it in a script block in the html file of this phone number panel: $(function(){ $('.numericPhone').numeric(); } Everything worked fine. Than I added AjaxFormComponentUpdatingBehavior(onchange) to this number text field. The onchage was not called (ie - it didn't get into onUpdate/onError). Only when i removed the use of the numeric plugin - the ajax worked. Do you have an idea what am i doing wrong? Thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3751788.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: Simple non ajax callback
ok that was also what I looked into but was unsure if there was another even simpler way. Thanks -Nino 2011/8/17 Igor Vaynberg igor.vaynb...@gmail.com: see how Link does it... all you need to do is implement one of the listener interfaces and call urlfor(component, interface) to generate a callback url.. -igor On Wed, Aug 17, 2011 at 10:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi i could not find a simple way todo non ajax callbacks. Its very simple to extend the abstractajaxdefaultbehavior. But could not find something similar for non ajax. Did i miss something? I figure its because if youre using javascript you might aswell do ajax? - 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: Simple non ajax callback
mount a Page or Resource at given url and fire requests to that url ... On Thu, Aug 18, 2011 at 10:33 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: ok that was also what I looked into but was unsure if there was another even simpler way. Thanks -Nino 2011/8/17 Igor Vaynberg igor.vaynb...@gmail.com: see how Link does it... all you need to do is implement one of the listener interfaces and call urlfor(component, interface) to generate a callback url.. -igor On Wed, Aug 17, 2011 at 10:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi i could not find a simple way todo non ajax callbacks. Its very simple to extend the abstractajaxdefaultbehavior. But could not find something similar for non ajax. Did i miss something? I figure its because if youre using javascript you might aswell do ajax? - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onchange not working with jquery numeric plugin
The ajax did work with onkeyup but i really need the onchange event. What do you mean by the jquery function must be binded to the same behaviour ? Thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3752004.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
onValidate() not called by FormTester.submit()
Hi all, I have a little problem to test a form in my application. I have a FileUploadField with an abstractValidator like that : FileUploadField fuploadField = new FileUploadField(uploadImage, new ModelFileUpload()); fuploadField.add(new AbstractValidatorFileUpload() { @Override protected void onValidate(IValidatableFileUpload validatable) { System.err.println(Passage dans le validateur); FileUpload fupload = (FileUpload) validatable.getValue(); if(fupload != null){ if(fupload.getSize() == 0){ error(validatable); } else if(!Utils.checkContentType(fupload.getContentType())){ error(validatable); } } } }); when I test manually this form with wrong image type, validation works well. I try to test this validator with wicketTester like that : @Test @Transactional @Rollback public void testStory23_TA13(){ tester.startPage(CreationQuestionnairePage.class); tester.assertRenderedPage(CreationQuestionnairePage.class); String titre = nouveau questionnaire; FormTester formTester = tester.newFormTester(formCreationQuestionnaire); formTester.setValue(titre, titre); formTester.setValue(numero, 10); formTester.select(sexeDestinataire, 0); formTester.setValue(conteneurQuestions:question:1:texteQuestion, question 1); formTester.setValue(conteneurQuestions:question:1:legende, legende question 1); formTester.setValue(conteneurQuestions:question:1:uploadImage, /Users/mathildepellerin/Desktop/moto.JPG); formTester.submit(); tester.assertErrorMessages(new String[]{Question 1 : Image trop volumineuse. La taille des images est limitée à 50k.}); } but onValidate() method of my validator is never called. It's not an ajax form, and I can check error messages send by required fields without any problem. Is there something else to do to test our own validator? Thanks. M. -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr
Re: onchane not working with jquery numeric plugin
It sounds like TexoTela plugin kills the JavaScript event, i.e. it does something like: event.preventDefault(), event.stopPropagation(). Better check the plugin code and see what happens. On Thu, Aug 18, 2011 at 8:30 AM, rebecca rivka.shis...@gmail.com wrote: hello, I'm using wicket 1.4.16. I have a simple text field component on a phone number panel. I used TexoTela's jquery plugin jquery.numeric to enable only numeric input to the text field. I added it in a script block in the html file of this phone number panel: $(function(){ $('.numericPhone').numeric(); } Everything worked fine. Than I added AjaxFormComponentUpdatingBehavior(onchange) to this number text field. The onchage was not called (ie - it didn't get into onUpdate/onError). Only when i removed the use of the numeric plugin - the ajax worked. Do you have an idea what am i doing wrong? Thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3751788.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onchange not working with jquery numeric plugin
I mean that the numeric() function may have logic that changes / overrides wicket's onchange calls, either the numeric() function works or (if removed) the AjaxFormComponentUpdatingBehavior works. On Thu, Aug 18, 2011 at 9:03 AM, rebecca rivka.shis...@gmail.com wrote: The ajax did work with onkeyup but i really need the onchange event. What do you mean by the jquery function must be binded to the same behaviour ? Thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3752004.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 -- Rodrigo H M Bezerra
Re: Wicket-auth issue
Indeed this check looks wrong. Please file a ticket in our Jira to fix it. On Wed, Aug 17, 2011 at 4:11 PM, mathieu.marcotte-gag...@bell.ca mathieu.marcotte-gag...@bell.ca wrote: Hi wicket developers and users, I am developing a web application that uses the wicket-auth framework 1.4.17, more specifically the following class : org.apache.wicket.authorization.strategies.role.annotations.AnnotationsRoleAuthorizationStrategy and I am experiencing an issue that I think might be a bug (but I'm not sure, it might be that I'm doing something wrong). I am using an annotation like below : @AuthorizeAction(action = ..., roles = ...) However I have found that I am always denied access to the page. I have traced the reason of the access to the following code, in method check of the above class : if (hasAny(new Roles(authorizeActionAnnotation.deny( { return false; } The deny list returned by authorizeActionAnnotation.deny() is empty, therefore hasAny always returns true, which means that when the deny list is empty you are always denied access to the page! Maybe it's a feature but it sounds like counter-intuitive to me :) Using the following annotation did fix the issue : @AuthorizeAction(action = ..., deny=dummyRoleToDeny, roles = ...) Am I doing something wrong, or is it really intended that if you don't specify a deny list then you are always denied access? Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onValidate() not called by FormTester.submit()
little precision : it the same thing for file size validation. I have a maxSize to my form : form.setMaxSize(Bytes.kilobytes(50)); when I test it manually, I have error message, but not when I test it by wicketTester and formTester... I don't understand what I forgot or what I doing wrong in my test. 2011/8/18 Mathilde Pellerin mathilde.pelle...@statlife.fr Hi all, I have a little problem to test a form in my application. I have a FileUploadField with an abstractValidator like that : FileUploadField fuploadField = new FileUploadField(uploadImage, new ModelFileUpload()); fuploadField.add(new AbstractValidatorFileUpload() { @Override protected void onValidate(IValidatableFileUpload validatable) { System.err.println(Passage dans le validateur); FileUpload fupload = (FileUpload) validatable.getValue(); if(fupload != null){ if(fupload.getSize() == 0){ error(validatable); } else if(!Utils.checkContentType(fupload.getContentType())){ error(validatable); } } } }); when I test manually this form with wrong image type, validation works well. I try to test this validator with wicketTester like that : @Test @Transactional @Rollback public void testStory23_TA13(){ tester.startPage(CreationQuestionnairePage.class); tester.assertRenderedPage(CreationQuestionnairePage.class); String titre = nouveau questionnaire; FormTester formTester = tester.newFormTester(formCreationQuestionnaire); formTester.setValue(titre, titre); formTester.setValue(numero, 10); formTester.select(sexeDestinataire, 0); formTester.setValue(conteneurQuestions:question:1:texteQuestion, question 1); formTester.setValue(conteneurQuestions:question:1:legende, legende question 1); formTester.setValue(conteneurQuestions:question:1:uploadImage, /Users/mathildepellerin/Desktop/moto.JPG); formTester.submit(); tester.assertErrorMessages(new String[]{Question 1 : Image trop volumineuse. La taille des images est limitée à 50k.}); } but onValidate() method of my validator is never called. It's not an ajax form, and I can check error messages send by required fields without any problem. Is there something else to do to test our own validator? Thanks. M. -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr
Re: onValidate() not called by FormTester.submit()
Which version of Wicket ? Looking at both 1.4.x and 1.5-SNAPSHOT code I think validation should be executed. 1.5 code is much cleaner ... On Thu, Aug 18, 2011 at 11:26 AM, Mathilde Pellerin mathilde.pelle...@statlife.fr wrote: little precision : it the same thing for file size validation. I have a maxSize to my form : form.setMaxSize(Bytes.kilobytes(50)); when I test it manually, I have error message, but not when I test it by wicketTester and formTester... I don't understand what I forgot or what I doing wrong in my test. 2011/8/18 Mathilde Pellerin mathilde.pelle...@statlife.fr Hi all, I have a little problem to test a form in my application. I have a FileUploadField with an abstractValidator like that : FileUploadField fuploadField = new FileUploadField(uploadImage, new ModelFileUpload()); fuploadField.add(new AbstractValidatorFileUpload() { @Override protected void onValidate(IValidatableFileUpload validatable) { System.err.println(Passage dans le validateur); FileUpload fupload = (FileUpload) validatable.getValue(); if(fupload != null){ if(fupload.getSize() == 0){ error(validatable); } else if(!Utils.checkContentType(fupload.getContentType())){ error(validatable); } } } }); when I test manually this form with wrong image type, validation works well. I try to test this validator with wicketTester like that : @Test @Transactional @Rollback public void testStory23_TA13(){ tester.startPage(CreationQuestionnairePage.class); tester.assertRenderedPage(CreationQuestionnairePage.class); String titre = nouveau questionnaire; FormTester formTester = tester.newFormTester(formCreationQuestionnaire); formTester.setValue(titre, titre); formTester.setValue(numero, 10); formTester.select(sexeDestinataire, 0); formTester.setValue(conteneurQuestions:question:1:texteQuestion, question 1); formTester.setValue(conteneurQuestions:question:1:legende, legende question 1); formTester.setValue(conteneurQuestions:question:1:uploadImage, /Users/mathildepellerin/Desktop/moto.JPG); formTester.submit(); tester.assertErrorMessages(new String[]{Question 1 : Image trop volumineuse. La taille des images est limitée à 50k.}); } but onValidate() method of my validator is never called. It's not an ajax form, and I can check error messages send by required fields without any problem. Is there something else to do to test our own validator? Thanks. M. -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onValidate() not called by FormTester.submit()
I use Wicket 1.4.17. Validation is not execute only when testing. I mean, only validation of my FileUploadField : maxSize error and my own abstractValidation errors are not executed. It's why I thought I made a mistake in my test...
Re: onValidate() not called by FormTester.submit()
ticket+quickstart On Thu, Aug 18, 2011 at 11:44 AM, Mathilde Pellerin mathilde.pelle...@statlife.fr wrote: I use Wicket 1.4.17. Validation is not execute only when testing. I mean, only validation of my FileUploadField : maxSize error and my own abstractValidation errors are not executed. It's why I thought I made a mistake in my test... -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onchane not working with jquery numeric plugin
Hi Martin, I checked the plug-in js file and did not find use of the functions you mentioned. Anyways, even with my poor JS knowledge i understood that there is a clash with the plug-in. Can you recommend of another package that i can use for client side numeric restriction on text field. Is there a wicket way to do it? Thanks a lot Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3752095.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: onchane not working with jquery numeric plugin
The question is: do you really need this client side validation ? If YES then override getAjaxCallDecorator of the AjaxFormComponentUpdatingBehavior and do something like: onDecorateScript(String script) { return if (parseInt(this.value) !== NaN) { + script + }; } On Thu, Aug 18, 2011 at 12:00 PM, rebecca rivka.shis...@gmail.com wrote: Hi Martin, I checked the plug-in js file and did not find use of the functions you mentioned. Anyways, even with my poor JS knowledge i understood that there is a clash with the plug-in. Can you recommend of another package that i can use for client side numeric restriction on text field. Is there a wicket way to do it? Thanks a lot Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3752095.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onValidate() not called by FormTester.submit()
you can find it here : https://issues.apache.org/jira/browse/WICKET-3973
Re: onValidate() not called by FormTester.submit()
thanks! On Thu, Aug 18, 2011 at 12:45 PM, Mathilde Pellerin mathilde.pelle...@statlife.fr wrote: you can find it here : https://issues.apache.org/jira/browse/WICKET-3973 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onchane not working with jquery numeric plugin
I wish things were dependent on what i need (it's a business requirement) :-) About your example - I don't want to show a message on parse error, I just don't want to let the user to input characters that are not numbers. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onchane-not-working-with-jquery-numeric-plugin-tp3751788p3752224.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: onValidate() not called by FormTester.submit()
problem solved on Jira : I used formTester.setValue() instead of formTester.setFile() in my tests. With FormTester.setFile() it works well. Thank you Martin for your help.
Log bookmarkable page link execution
Hi, i would like to log execution of bookmarkable page links. I know that they are only renderered in markup and call the page from the browser. Maybe someone has a hint for me here? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Opening Wicket Page in New Browser Tab/Window
How can I make a Wicket page open in a new browser tab/window? I'm not talking about a popup, but a standard window. I have an app that needs to open a GIS map viewer in a separate window, based on the user's current context. The map viewer requires that I submit a form with GPS coordinates, so I need Wicket to render some simple HTML with the coordinates in hidden form fields, then submit the form to the map viewer URL as soon as the page renders. This part is no problem. The problem is that Wicket renders the HTML in the wrong window. Currently, I'm using code to generate the link to invoke the map viewer: *final MenuItem mapMenu = new EnmMenuItem(Map) { private static final long serialVersionUID = 1L; @Override protected AbstractLink newLink(final String componentId) { final SubmitLink link = new SubmitLink(componentId, form) { private static final long serialVersionUID = 1L; @Override public void onSubmit() { selectMapMenu(); } }; link.setDefaultFormProcessing(false); link.setEnabled(true); link.setRenderBodyOnly(false); link.add(new SimpleAttributeModifier(target, _blank)); return link; } };* When the menu item is chosen, the following is invoked: *@Override protected void selectMapMenu() { for (final TrackSummary summary : grid.getSelectedItems()) { try { setResponsePage(new TrackMapRequestPage(summary.getSystemNumber())); } catch (final UnauthorizedPageError ex) { error(ex.getMessage()); } } }* Despite setting the link target to _blank, the TrackMapRequestPage opens in the SAME window as the application. How can I make it open in a DIFFERENT window so both windows are visible at the same time? My design specs says the new window shouldn't be a popup. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3752465.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 1.5 and Automatic Link Disabling
Well, even with HEAD of trunk, I'm still not getting link disabling so I may try to create a quickstart. However, those funny errors trying to resolve style.css have a workaround: simply stop using mountPackage and they go away. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-Automatic-Link-Disabling-tp3748072p3752598.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 1.5 and Automatic Link Disabling
add style.css problem in the quickstart too On Thu, Aug 18, 2011 at 4:28 PM, Jonathan Locke jonathan.lo...@gmail.com wrote: Well, even with HEAD of trunk, I'm still not getting link disabling so I may try to create a quickstart. However, those funny errors trying to resolve style.css have a workaround: simply stop using mountPackage and they go away. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-Automatic-Link-Disabling-tp3748072p3752598.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Simple non ajax callback
how could it possibly be _even_ simpler? -igor On Thu, Aug 18, 2011 at 12:33 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: ok that was also what I looked into but was unsure if there was another even simpler way. Thanks -Nino 2011/8/17 Igor Vaynberg igor.vaynb...@gmail.com: see how Link does it... all you need to do is implement one of the listener interfaces and call urlfor(component, interface) to generate a callback url.. -igor On Wed, Aug 17, 2011 at 10:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi i could not find a simple way todo non ajax callbacks. Its very simple to extend the abstractajaxdefaultbehavior. But could not find something similar for non ajax. Did i miss something? I figure its because if youre using javascript you might aswell do ajax? - 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: How to Handle ResourceStreamNotFoundException
Firstly, thank you very much for your advice, it helps to a certain extend, but it also raises new questions. Unfortunately, there's only one way to determine whether a zip-file contains an installation manual. Since the zip-file is on another server (where the nexus repository resides), I have to read it from an InputStream. If there isn't an installation manual, this reading can take up to 10 seconds. Initially - when there's not a user entry yet, I can disable the download-button. But once an application code is entered, I only render meta information from all the zip-file versions, so the user can pick a desired version (usually the most recent build). Only when the form is submitted, or the new download button pressed, the corresponding zip-file is read, and only then I can determine whether it contains an installation manual. But I have to enable the button if there is a user entry. That can be a very disapointing user experience. He/she starts the appication, the button is disabled. He/she then enters an application code, en presses the now enabled button, only to find out that there isn't an installation manual... One question that comes to mind is: is my use case so exceptional? A button for a resource is pressed, all I want is a nice feedback in case a resource isn't available... Personally, I'm not a great fan of disabling or 'invisibling' buttons. I adhere to the five-year-old-boy-philosophy concerning buttons: you should /allways/ be able to press them, that's what buttons are for. Your alternative (using the RestartResponseException) solves the 'white screen-problem', but there are a few drawbacks: - The URL of my application after pressing the button changes from http://localhost:9081/deploy/ to http://localhost:9081/deploy/?wicket:interface=:3:deploytabs:panel:deployForm:downloadinstallationmanual::IResourceListener::. I really like Wicket, but this is so annoying. Who wants this? I just want my original url back - and yes, I read all the posts on mount strategies. - What's worse, the user has entered an application code that generates other field values (like a dropdownlists for the versions). When the page is reloaded after a RestartResponseException, I want to initialize it with the afore entered data. I managed to do that using PageParameters (or the Session), but in that case the refresh button will always generate a 'prefilled' page, with the values of the lat entered application code. Regards, Hans Friederichs -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-Handle-ResourceStreamNotFoundException-tp3749331p3752826.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 Handle ResourceStreamNotFoundException
Hans, Something like the following will probably work better for you. The key concept is changing the request target. Sorry if my previous suggestion put you down a dead end. add(new LinkDeployVersion(manualLink, deployVersionModel) { @Override public void onClick() { IResourceStream manualStream = getManualStream(getModelObject()); if (manualStream == null) { error(no manual, sorry!); } else { RequestCycle.get().setRequestTarget(new ResourceStreamRequestTarget(manualStream)); } } }); Regards, Dan On Thu, Aug 18, 2011 at 8:06 AM, hfriederichs h.friederi...@ohra.nl wrote: Firstly, thank you very much for your advice, it helps to a certain extend, but it also raises new questions. Unfortunately, there's only one way to determine whether a zip-file contains an installation manual. Since the zip-file is on another server (where the nexus repository resides), I have to read it from an InputStream. If there isn't an installation manual, this reading can take up to 10 seconds. Initially - when there's not a user entry yet, I can disable the download-button. But once an application code is entered, I only render meta information from all the zip-file versions, so the user can pick a desired version (usually the most recent build). Only when the form is submitted, or the new download button pressed, the corresponding zip-file is read, and only then I can determine whether it contains an installation manual. But I have to enable the button if there is a user entry. That can be a very disapointing user experience. He/she starts the appication, the button is disabled. He/she then enters an application code, en presses the now enabled button, only to find out that there isn't an installation manual... One question that comes to mind is: is my use case so exceptional? A button for a resource is pressed, all I want is a nice feedback in case a resource isn't available... Personally, I'm not a great fan of disabling or 'invisibling' buttons. I adhere to the five-year-old-boy-philosophy concerning buttons: you should /allways/ be able to press them, that's what buttons are for. Your alternative (using the RestartResponseException) solves the 'white screen-problem', but there are a few drawbacks: - The URL of my application after pressing the button changes from http://localhost:9081/deploy/ to http://localhost:9081/deploy/?wicket:interface=:3:deploytabs:panel:deployForm:downloadinstallationmanual::IResourceListener: :. I really like Wicket, but this is so annoying. Who wants this? I just want my original url back - and yes, I read all the posts on mount strategies. - What's worse, the user has entered an application code that generates other field values (like a dropdownlists for the versions). When the page is reloaded after a RestartResponseException, I want to initialize it with the afore entered data. I managed to do that using PageParameters (or the Session), but in that case the refresh button will always generate a 'prefilled' page, with the values of the lat entered application code. Regards, Hans Friederichs -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-Handle-ResourceStreamNotFoundException-tp3749331p3752826.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: Opening Wicket Page in New Browser Tab/Window
Did you try putting target=_black on the form tag? On Thu, Aug 18, 2011 at 5:30 AM, aksarben rwada...@up.com wrote: How can I make a Wicket page open in a new browser tab/window? I'm not talking about a popup, but a standard window. I have an app that needs to open a GIS map viewer in a separate window, based on the user's current context. The map viewer requires that I submit a form with GPS coordinates, so I need Wicket to render some simple HTML with the coordinates in hidden form fields, then submit the form to the map viewer URL as soon as the page renders. This part is no problem. The problem is that Wicket renders the HTML in the wrong window. Currently, I'm using code to generate the link to invoke the map viewer: *final MenuItem mapMenu = new EnmMenuItem(Map) { private static final long serialVersionUID = 1L; @Override protected AbstractLink newLink(final String componentId) { final SubmitLink link = new SubmitLink(componentId, form) { private static final long serialVersionUID = 1L; @Override public void onSubmit() { selectMapMenu(); } }; link.setDefaultFormProcessing(false); link.setEnabled(true); link.setRenderBodyOnly(false); link.add(new SimpleAttributeModifier(target, _blank)); return link; } };* When the menu item is chosen, the following is invoked: *@Override protected void selectMapMenu() { for (final TrackSummary summary : grid.getSelectedItems()) { try { setResponsePage(new TrackMapRequestPage(summary.getSystemNumber())); } catch (final UnauthorizedPageError ex) { error(ex.getMessage()); } } }* Despite setting the link target to _blank, the TrackMapRequestPage opens in the SAME window as the application. How can I make it open in a DIFFERENT window so both windows are visible at the same time? My design specs says the new window shouldn't be a popup. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3752465.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: Opening Wicket Page in New Browser Tab/Window
s/black/blank/ :) On Thu, Aug 18, 2011 at 10:41 AM, Dan Retzlaff dretzl...@gmail.com wrote: Did you try putting target=_black on the form tag? On Thu, Aug 18, 2011 at 5:30 AM, aksarben rwada...@up.com wrote: How can I make a Wicket page open in a new browser tab/window? I'm not talking about a popup, but a standard window. I have an app that needs to open a GIS map viewer in a separate window, based on the user's current context. The map viewer requires that I submit a form with GPS coordinates, so I need Wicket to render some simple HTML with the coordinates in hidden form fields, then submit the form to the map viewer URL as soon as the page renders. This part is no problem. The problem is that Wicket renders the HTML in the wrong window. Currently, I'm using code to generate the link to invoke the map viewer: *final MenuItem mapMenu = new EnmMenuItem(Map) { private static final long serialVersionUID = 1L; @Override protected AbstractLink newLink(final String componentId) { final SubmitLink link = new SubmitLink(componentId, form) { private static final long serialVersionUID = 1L; @Override public void onSubmit() { selectMapMenu(); } }; link.setDefaultFormProcessing(false); link.setEnabled(true); link.setRenderBodyOnly(false); link.add(new SimpleAttributeModifier(target, _blank)); return link; } };* When the menu item is chosen, the following is invoked: *@Override protected void selectMapMenu() { for (final TrackSummary summary : grid.getSelectedItems()) { try { setResponsePage(new TrackMapRequestPage(summary.getSystemNumber())); } catch (final UnauthorizedPageError ex) { error(ex.getMessage()); } } }* Despite setting the link target to _blank, the TrackMapRequestPage opens in the SAME window as the application. How can I make it open in a DIFFERENT window so both windows are visible at the same time? My design specs says the new window shouldn't be a popup. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3752465.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: Log bookmarkable page link execution
Is your goal to understand which links are used to open certain bookmarkable pages? If so, here's an approach that might get you started. Create a Behavior which appends a tracking query parameter to BookmarkablePageLinks. You could add it manually to each link you want to track, or apply it application-wide through an IComponentOnBeforeRenderListener registered with Application#addPreComponentOnBeforeRenderListener(). Then you you'd have to watch for these query parameters in subsequent application requests, maybe by inspecting the Request object in an Application#newRequestCycle() override. Hope that helps, Dan On Thu, Aug 18, 2011 at 4:51 AM, Mike Mander wicket-m...@gmx.de wrote: Hi, i would like to log execution of bookmarkable page links. I know that they are only renderered in markup and call the page from the browser. Maybe someone has a hint for me here? Thanks Mike --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Opening Wicket Page in New Browser Tab/Window
Unfortunately, by that point, it's too late. The small HTML form has already appeared in my app window, even the map viewer subsequently opens in a new window, my app content has been destroyed. Since I posted this topic, I decided to go with PopupSettings. Since my corporate target audience all has Internet Explorer, I can tell them to configure the browser to open popups in a new tab. However, this fix means that in Firefox (which doesn't offer this option) users still get a free floating popup, even if that's not what they want. Sounds like the powers that be ought to think about this for Wicket 1.5. This is such a standard browser feature it's absence seems (IMHO) like a serious deficiency in the framework. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3753218.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: Opening Wicket Page in New Browser Tab/Window
On Thu, Aug 18, 2011 at 11:03 AM, aksarben rwada...@up.com wrote: Unfortunately, by that point, it's too late. The small HTML form has already appeared in my app window, even the map viewer subsequently opens in a new window, my app content has been destroyed. Is it necessary to replace your app window's contents with the form? Can't you just put the form in the existing page (using panel swapping) and submit it with some dom ready JavaScript? Dan
Cache Wicket Pages rather than Construct New Objects
We have several Wicket pages that get constructed and then are available to the user via hyperlinks. There is no need to re-construct those Wicket pages because they never change from that point on. They are static info pages. However, each time the user accesses a page, we construct a new instance, which decreases memory by 3 MB. We have a profiler running and we see that each time an existing page is accessed, free memory drops by a few MB. The link's action is to setResponsePage(MyPage.class), but that creates a new object. Suppose we were keeping all our Page objects in a Session. Is there a way to setResponsePage() to an existing Page instance? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cache-Wicket-Pages-rather-than-Construct-New-Objects-tp3753362p3753362.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: Cache Wicket Pages rather than Construct New Objects
The problem is elsewhere. setResponsePage(Class) creates a new instance but this instance is later reclaimed by the GC. If you keep any reference to the created Page instance then it will stay around until this reference is GC-ed. You can use setResponsePage(Page) method to link to an existing instance. On Thu, Aug 18, 2011 at 9:58 PM, eugenebalt eugeneb...@yahoo.com wrote: We have several Wicket pages that get constructed and then are available to the user via hyperlinks. There is no need to re-construct those Wicket pages because they never change from that point on. They are static info pages. However, each time the user accesses a page, we construct a new instance, which decreases memory by 3 MB. We have a profiler running and we see that each time an existing page is accessed, free memory drops by a few MB. The link's action is to setResponsePage(MyPage.class), but that creates a new object. Suppose we were keeping all our Page objects in a Session. Is there a way to setResponsePage() to an existing Page instance? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cache-Wicket-Pages-rather-than-Construct-New-Objects-tp3753362p3753362.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Cache Wicket Pages rather than Construct New Objects
The link's action is to setResponsePage(MyPage.class), but that creates a new object. Suppose we were keeping all our Page objects in a Session. Is there a way to setResponsePage() to an existing Page instance? You can replace or extend the DefaultPageFactory (IPageFactory) Regards Hans - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Cache Wicket Pages rather than Construct New Objects
Yes, but AFAIR there could be multithreading issues if you share a page object among differents threads. Am I wrong? Regards. On Thu, Aug 18, 2011 at 4:26 PM, Hans Lesmeister hans.lesmeis...@lessy-software.de wrote: The link's action is to setResponsePage(MyPage.class), but that creates a new object. Suppose we were keeping all our Page objects in a Session. Is there a way to setResponsePage() to an existing Page instance? You can replace or extend the DefaultPageFactory (IPageFactory) Regards Hans - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Mauro Ciancio http://about.me/maurociancio
Re: Cache Wicket Pages rather than Construct New Objects
Hi, each time the user accesses a page, we construct a new instance, which decreases memory by 3 MB. hopefully the memory is reclaimed by the garbage collector afterwards, isn't it? Sven On 08/18/2011 08:58 PM, eugenebalt wrote: We have several Wicket pages that get constructed and then are available to the user via hyperlinks. There is no need to re-construct those Wicket pages because they never change from that point on. They are static info pages. However, each time the user accesses a page, we construct a new instance, which decreases memory by 3 MB. We have a profiler running and we see that each time an existing page is accessed, free memory drops by a few MB. The link's action is to setResponsePage(MyPage.class), but that creates a new object. Suppose we were keeping all our Page objects in a Session. Is there a way to setResponsePage() to an existing Page instance? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cache-Wicket-Pages-rather-than-Construct-New-Objects-tp3753362p3753362.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Opening Wicket Page in New Browser Tab/Window
Some months ago I had the same/similar problem. You have to add the attribute by overriding onComponentTag(ComponentTag tag). As far as I remember you should use the usual org.apache.wicket.markup.html.form.Button with it, AjaxButton won't work. FormVoid form = new FormVoid(ConvertForm) { @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(target, _blank); } }; -- How to find files on the Internet? FindFiles.net http://findfiles.net! On 08/18/2011 02:30 PM, aksarben wrote: How can I make a Wicket page open in a new browser tab/window? I'm not talking about a popup, but a standard window. I have an app that needs to open a GIS map viewer in a separate window, based on the user's current context. The map viewer requires that I submit a form with GPS coordinates, so I need Wicket to render some simple HTML with the coordinates in hidden form fields, then submit the form to the map viewer URL as soon as the page renders. This part is no problem. The problem is that Wicket renders the HTML in the wrong window. Currently, I'm using code to generate the link to invoke the map viewer: *final MenuItem mapMenu = new EnmMenuItem(Map) { private static final long serialVersionUID = 1L; @Override protected AbstractLink newLink(final String componentId) { final SubmitLink link = new SubmitLink(componentId, form) { private static final long serialVersionUID = 1L; @Override public void onSubmit() { selectMapMenu(); } }; link.setDefaultFormProcessing(false); link.setEnabled(true); link.setRenderBodyOnly(false); link.add(new SimpleAttributeModifier(target, _blank)); return link; } };* When the menu item is chosen, the following is invoked: *@Override protected void selectMapMenu() { for (final TrackSummary summary : grid.getSelectedItems()) { try { setResponsePage(new TrackMapRequestPage(summary.getSystemNumber())); } catch (final UnauthorizedPageError ex) { error(ex.getMessage()); } } }* Despite setting the link target to _blank, the TrackMapRequestPage opens in the SAME window as the application. How can I make it open in a DIFFERENT window so both windows are visible at the same time? My design specs says the new window shouldn't be a popup. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3752465.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: Unexpected RuntimeException when trying a project with a DataTable
It looks like you have multiple versions of the Wicket JARs on your classpath. Since that function was removed in https://issues.apache.org/jira/browse/WICKET-3702, I'd guess that your extensions JAR is older than your main wicket JAR. Hope that helps, Dan On Thu, Aug 18, 2011 at 5:47 PM, aabfattah ahmed.abdelfattah.elshem...@gmail.com wrote: Hello , I copied some code from a tutorial about creating a simple datatable from here https://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html Also , I tried the example in repeaters section in wicketstuff website But I get the same exact exception in the 2 projects . Can anybody help as I am new to wicket ? Last cause: org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByBorder.addToBorder([Lorg/apache/wicket/Component;)Lorg/apache/wicket/MarkupContainer; WicketMessage: Can't instantiate page using constructor public foo.DataTablePage() StackTrace: Root cause: java.lang.NoSuchMethodError: org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByBorder.addToBorder([Lorg/apache/wicket/Component;)Lorg/apache/wicket/MarkupContainer; at org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByBorder.init(OrderByBorder.java:58) at org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByBorder.init(OrderByBorder.java:106) at org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar$2.init(HeadersToolbar.java:115) at org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.newSortableHeader(HeadersToolbar.java:110) at org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.init(HeadersToolbar.java:67) at org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable.init(DefaultDataTable.java:64) at foo.DataTablePage.init(DataTablePage.java:22) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:155) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:59) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:95) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:43) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:107) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:266) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:160) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:219) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:139) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:935) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:870) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:346) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596) at