Re: Configure Wicket to detect some special HTML characters?
In Spring framework, there is a concept called HTML escape. Does Wicket have sometihng similar? Thanks. --- On Tue, 7/6/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:23 AM Create a custom converter. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 12:16 AM, David Chang david_q_zh...@yahoo.com wrote: I dont want to save these characters into the database. --- On Tue, 7/6/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:09 AM Why would you want to do that? ** Martin 2010/7/6 David Chang david_q_zh...@yahoo.com... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Configure Wicket to detect some special HTML characters?
Martin, thanks so much for your attention on this question. You are right, it is should be done on display, not on storage. Best, David --- On Tue, 7/6/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 8:22 AM In Spring framework, there is a concept called HTML escape. Does Wicket have sometihng similar? Strings.escape However, I suspect you are trying to solve wrong problem. Html should be escaped upon display not upon storage. ** Martin --- On Tue, 7/6/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:23 AM Create a custom converter. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 12:16 AM, David Chang david_q_zh...@yahoo.com wrote: I dont want to save these characters into the database. --- On Tue, 7/6/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:09 AM Why would you want to do that? ** Martin 2010/7/6 David Chang david_q_zh...@yahoo.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Configure Wicket to detect some special HTML characters?
Can Wicket be configured to do this html escape without requiring a programmer to manually write calls to Strings#escapeMarkup? --- On Tue, 7/6/10, Pedro Santos pedros...@gmail.com wrote: From: Pedro Santos pedros...@gmail.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 8:25 AM Hi David, there are a lot of methods that escape the characters, for instance you can use org.apache.wicket.util.string.Strings.escapeMarkup method. But they make sense when you are writing an xml, like the page returned to browser. On Tue, Jul 6, 2010 at 9:08 AM, David Chang david_q_zh...@yahoo.com wrote: In Spring framework, there is a concept called HTML escape. Does Wicket have sometihng similar? Thanks. --- On Tue, 7/6/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:23 AM Create a custom converter. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 12:16 AM, David Chang david_q_zh...@yahoo.com wrote: I dont want to save these characters into the database. --- On Tue, 7/6/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:09 AM Why would you want to do that? ** Martin 2010/7/6 David Chang david_q_zh...@yahoo.com... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Configure Wicket to detect some special HTML characters?
Jeremy, thanks for the advice, which is indeed correct. I tried it and it the default behavior for labels. I do have annother related question. I read Component API, which Label and other components inherit, and notice that it has a method: public final Component setEscapeModelStrings(boolean escapeMarkup) I further traced its source code, and it seems to me that escaping HTML is true by default for Componnent and its decedents, correct? what if I want to the HTML escape is false by default for Components and all its decendents? Any elegant way? In Spring, it can be a system-wide configuration, which can be overriden on a particular page. Hope this is not too much asking. Regards. --- On Tue, 7/6/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 9:41 AM A label automatically escapes markup. It would take you about one minute to try this on an app you have. That would have saved you (and us) a lot of emails. Just give it a try. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 8:27 AM, David Chang david_q_zh...@yahoo.com wrote: Can Wicket be configured to do this html escape without requiring a programmer to manually write calls to Strings#escapeMarkup? --- On Tue, 7/6/10, Pedro Santos pedros...@gmail.com wrote: From: Pedro Santos pedros...@gmail.com Subject: Re: Configure Wicket to detect some special HTML characters? To: us...@wicket.apache.or... Date: Tuesday, July 6, 2010, 8:25 AM Hi David, there are a lot of methods that escape the characters, for instance you can use or... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Configure Wicket to detect some special HTML characters?
igor, thanks for chiming in. rgards. --- On Tue, 7/6/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 10:18 PM there is no system-wide setting to disable this because doing so opens a bunch of security holes. -igor On Tue, Jul 6, 2010 at 6:30 PM, David Chang david_q_zh...@yahoo.com wrote: Jeremy, thanks for the advice, which is indeed correct. I tried it and it the default behavior for labels. I do have annother related question. I read Component API, which Label and other components inherit, and notice that it has a method: public final Component setEscapeModelStrings(boolean escapeMarkup) I further traced its source code, and it seems to me that escaping HTML is true by default for Componnent and its decedents, correct? what if I want to the HTML escape is false by default for Components and all its decendents? Any elegant way? In Spring, it can be a system-wide configuration, which can be overriden on a particular page. Hope this is not too much asking. Regards. --- On Tue, 7/6/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 9:41 AM A label automatically escapes markup. It would take you about one minute to try this on an app you have. That would have saved you (and us) a lot of emails. Just give it a try. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 8:27 AM, David Chang david_q_zh...@yahoo.com wrote: Can Wicket be configured to do this html escape without requiring a programmer to manually write calls to Strings#escapeMarkup? --- On Tue, 7/6/10, Pedro Santos pedros...@gmail.com wrote: From: Pedro Santos pedros...@gmail.com Subject: Re: Configure Wicket to detect some special HTML characters? To: us...@wicket.apache.or... Date: Tuesday, July 6, 2010, 8:25 AM Hi David, there are a lot of methods that escape the characters, for instance you can use or... - 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
Configure Wicket to detect some special HTML characters?
If someone enters scriptalert(1)/script in a wicket form's text field, can Wicket be configured to detect special characters such as angle brackets and translate them into HTML entities before sending user input to database? If yes, any pointers? Best, David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Configure Wicket to detect some special HTML characters?
I dont want to save these characters into the database. --- On Tue, 7/6/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Configure Wicket to detect some special HTML characters? To: users@wicket.apache.org Date: Tuesday, July 6, 2010, 1:09 AM Why would you want to do that? ** Martin 2010/7/6 David Chang david_q_zh...@yahoo.com: If someone enters scriptalert(1)/script in a wicket form's text field, can Wicket be configured to detect special characters such as angle brackets and translate them into HTML entities before sending user input to database? If yes, any pointers? Best, David - 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
How to clear a TextField input?
I have a form where it has two elements: AjaxCheckbox and TextField. When the checkbox is un-checked, the TextField in browser should look blank. Here is the code I have: final TextField input = new TextField(myinput) { void onBeforeRender() { super.onBeforeRender(); if (certain way to get model and check is myproperty and if it is not true) this.clearInput(); } } }; AjaxCheckBox box = new AjaxCheckBox(mycheckbox, new PropertyModel(model, myproperty)) { @Override protected void onUpdate(AjaxRequestTarget target) { if (target != null) { target.addComponent(input); } } }; However, when I uncheck the checkbox, this.clearInput() in TextField is called, but the in the browser, the text field value in the browser is always there. Spent sometime and unable to find a way to solve this issue. In javascript, this task is so easy. I must have missed something. Can somebody show me how to clear the TextField value in the browser? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to clear a TextField input?
igor, thank you for the tip. that works. best. --- On Thu, 7/1/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: How to clear a TextField input? To: users@wicket.apache.org Date: Thursday, July 1, 2010, 6:32 PM set the model object to null as well. -igor On Thu, Jul 1, 2010 at 3:25 PM, David Chang david_q_zh...@yahoo.com wrote: I have a form where it has two elements: AjaxCheckbox and TextField. When the checkbox is un-checked, the TextField in browser should look blank. Here is the code I have: final TextField input = new TextField(myinput) { void onBeforeRender() { super.onBeforeRender(); if (certain way to get model and check is myproperty and if it is not true) this.clearInput(); } } }; AjaxCheckBox box = new AjaxCheckBox(mycheckbox, new PropertyModel(model, myproperty)) { @Override protected void onUpdate(AjaxRequestTarget target) { if (target != null) { target.addComponent(input); } } }; However, when I uncheck the checkbox, this.clearInput() in TextField is called, but the in the browser, the text field value in the browser is always there. Spent sometime and unable to find a way to solve this issue. In javascript, this task is so easy. I must have missed something. Can somebody show me how to clear the TextField value in the browser? Thanks! - 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 Ajax-validate CheckBoxMultipleChoice?
Yes. When I click Save button, wickets reports required error message for the CheckBoxMultipleChoice component. Thanks for chiming in! Best. --- On Sat, 6/26/10, yaniv kessler yan...@gmail.com wrote: From: yaniv kessler yan...@gmail.com Subject: Re: How to Ajax-validate CheckBoxMultipleChoice? To: users@wicket.apache.org Cc: wic...@indeterminate.org Date: Saturday, June 26, 2010, 8:47 AM Is that element placed / added to a form ? On Sat, Jun 26, 2010 at 5:32 AM, David Chang david_q_zh...@yahoo.comwrote: Hi, I am unable to addres this need and have to ask the group. I am using the ajax approach to validate each field on a form. See the following: div wicket:id=fullNameBorder input type=text wicket:id=fullName / /div If the above field gets focus and loses the focus without any value in it, there will be a red box around the input field. If it gets a value and loses its mouse focus, the red box disappears. All this happens without the user submitting the form. The backend code is similar to the following: ... inputComponent.add(new AjaxFormComponentUpdatingBehavior(onblur) { @Override protected void onUpdate(AjaxRequestTarget target) { if (target != null) { //add border and feedback panel here } } @Override protected void onError(AjaxRequestTarget target, RuntimeException e) { if (target != null) { //add border and feedback panel here } }); This approach works well for TextFields. Now I have a list of check boxes (implemented via CheckBoxMultipleChoice). At least one of them must be checked. The above Ajax approach is NOT working. Can anybody there help me out on this? All the best. - 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
How to Ajax-validate CheckBoxMultipleChoice?
Hi, I am unable to addres this need and have to ask the group. I am using the ajax approach to validate each field on a form. See the following: div wicket:id=fullNameBorder input type=text wicket:id=fullName / /div If the above field gets focus and loses the focus without any value in it, there will be a red box around the input field. If it gets a value and loses its mouse focus, the red box disappears. All this happens without the user submitting the form. The backend code is similar to the following: ... inputComponent.add(new AjaxFormComponentUpdatingBehavior(onblur) { @Override protected void onUpdate(AjaxRequestTarget target) { if (target != null) { //add border and feedback panel here } } @Override protected void onError(AjaxRequestTarget target, RuntimeException e) { if (target != null) { //add border and feedback panel here } }); This approach works well for TextFields. Now I have a list of check boxes (implemented via CheckBoxMultipleChoice). At least one of them must be checked. The above Ajax approach is NOT working. Can anybody there help me out on this? All the best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Suggestion about wicket's Wizard
Did not hear any feedback. Just curious about whether I explained clearly or about what others may think about my suggestions. Regards. --- On Fri, 6/18/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Suggestion about wicket's Wizard To: users@wicket.apache.org Date: Friday, June 18, 2010, 5:39 PM I have been playing wicket's Wizard (1.4.9) and feel it is quite helpful but lacking in some ways. Here is what I suggest: 1. Add a method (called size or something else) to WizardModel to provide the number of wizard steps it contains. 2. Add a method to Wizard or WizardModel to provide the index of a IWizardStep in a number of the wizard steps 3. The current WizardModel#previous remembers the click history in a browser style. Put it another way, it remembers whatever steps were visited and return to them in reversing (FILO) order. I call it browser style. This visit order does not reflect the actual order of wizard steps defined when a Wizard is created. I would like to see an added style (called Linear, for example) that strictly ask WizardModel#previous or another new method to return Wizard to step that is defined (NOT visited) before the current active wizard step. (The background for this request is that I created a few links each of which takes me directly to individual wizard steps in a Wizard. So i can visit the wizard steps in any order instead of following the default Previous and Next button. When I click a link and then click the Prevoius button, the wizard takes me to the previously visited wizard step, not the one defined before the current active step. I feel my need is a useful usecase. I inherited WizardModel and modified the previous method in order to satisfy the usecase). Best! - 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
Suggestion about wicket's Wizard
I have been playing wicket's Wizard (1.4.9) and feel it is quite helpful but lacking in some ways. Here is what I suggest: 1. Add a method (called size or something else) to WizardModel to provide the number of wizard steps it contains. 2. Add a method to Wizard or WizardModel to provide the index of a IWizardStep in a number of the wizard steps 3. The current WizardModel#previous remembers the click history in a browser style. Put it another way, it remembers whatever steps were visited and return to them in reversing (FILO) order. I call it browser style. This visit order does not reflect the actual order of wizard steps defined when a Wizard is created. I would like to see an added style (called Linear, for example) that strictly ask WizardModel#previous or another new method to return Wizard to step that is defined (NOT visited) before the current active wizard step. (The background for this request is that I created a few links each of which takes me directly to individual wizard steps in a Wizard. So i can visit the wizard steps in any order instead of following the default Previous and Next button. When I click a link and then click the Prevoius button, the wizard takes me to the previously visited wizard step, not the one defined before the current active step. I feel my need is a useful usecase. I inherited WizardModel and modified the previous method in order to satisfy the usecase). Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to remove css class from a component?
Use a model like it's intended? You mean I should use AbstractReadOnlyModel? protected void onBeforeRender() { super.onBeforeRender(); inputComponent.add(new SimpleAttributeModifier(class, true, new AbstractReadOnlyModelString() { public String getObject() { return inputComponent.getFeedbackMessage() != null ? errorField : ; } }); } There is no such constructor forSimpleAttributeModifier. Thanks. --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Date: Wednesday, June 16, 2010, 1:52 AM On Wed, Jun 16, 2010 at 12:48 AM, David Chang david_q_zh...@yahoo.comwrote: Jeremy, glad to hear from you! My situation is a little different. The CSS class is added in the following way. Please see the following code. protected void onBeforeRender() { super.onBeforeRender(); if (inputComponent.getFeedbackMessage() != null) { inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); } else { // how to remove CSS class here?? } } Thanks! --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Cc: John Krasnay j...@krasnay.ca Date: Wednesday, June 16, 2010, 1:40 AM onComponentTag(...) { tag.remove(class); } On Wed, Jun 16, 2010 at 12:37 AM, David Chang david_q_zh...@yahoo.com wrote: Hello, I add a CSS class to component dynamcially the following way: inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); How can I remove this CSS class in java code? Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Use a model like it's intended? protected void onBeforeRender() { super.onBeforeRender(); inputComponent.add(new SimpleAttributeModifier(class, true, new AbstractReadOnlyModelString() { public String getObject() { return inputComponent.getFeedbackMessage() != null ? errorField : ; } }); } -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to remove css class from a component?
Zoltan, thanks for your input. The isTemporary works for me! Best. --- On Wed, 6/16/10, Zoltan Luspai zlus...@gmail.com wrote: From: Zoltan Luspai zlus...@gmail.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Date: Wednesday, June 16, 2010, 1:59 AM Hi, Two alternative solutions: - If you want the CSS class be appened only in one response then set the AttributeAppender as temporary ...new AttributeAppender(...) { �...@override isTemporary() { return true} } }... - Or disable/enable AttributeAppender as needed by overriding isEnabled() method of it: ...new AttributeAppender(...) { �...@override isEnabled() { return inputComponent.getFeedbackMessage() != null } }... Cheers, Zoltan On 06/16/2010 07:48 AM, David Chang wrote: Jeremy, glad to hear from you! My situation is a little different. The CSS class is added in the following way. Please see the following code. protected void onBeforeRender() { super.onBeforeRender(); if (inputComponent.getFeedbackMessage() != null) { inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); } else { // how to remove CSS class here?? } } Thanks! --- On Wed, 6/16/10, Jeremy Thomersonjer...@wickettraining.com wrote: From: Jeremy Thomersonjer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Cc: John Krasnayj...@krasnay.ca Date: Wednesday, June 16, 2010, 1:40 AM onComponentTag(...) { tag.remove(class); } On Wed, Jun 16, 2010 at 12:37 AM, David Changdavid_q_zh...@yahoo.comwrote: Hello, I add a CSS class to component dynamcially the following way: inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); How can I remove this CSS class in java code? Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Jeremy Thomerson http://www.wickettraining.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to remove css class from a component?
Thanks for the explanation! All the best. --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Date: Wednesday, June 16, 2010, 2:10 AM On Wed, Jun 16, 2010 at 1:05 AM, David Chang david_q_zh...@yahoo.comwrote: Use a model like it's intended? You mean I should use AbstractReadOnlyModel? protected void onBeforeRender() { super.onBeforeRender(); inputComponent.add(new SimpleAttributeModifier(class, true, new AbstractReadOnlyModelString() { public String getObject() { return inputComponent.getFeedbackMessage() != null ? errorField : ; } }); } There is no such constructor forSimpleAttributeModifier. Thanks. --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Date: Wednesday, June 16, 2010, 1:52 AM On Wed, Jun 16, 2010 at 12:48 AM, David Chang david_q_zh...@yahoo.comwrote: Jeremy, glad to hear from you! My situation is a little different. The CSS class is added in the following way. Please see the following code. protected void onBeforeRender() { super.onBeforeRender(); if (inputComponent.getFeedbackMessage() != null) { inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); } else { // how to remove CSS class here?? } } Thanks! --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Cc: John Krasnay j...@krasnay.ca Date: Wednesday, June 16, 2010, 1:40 AM onComponentTag(...) { tag.remove(class); } On Wed, Jun 16, 2010 at 12:37 AM, David Chang david_q_zh...@yahoo.com wrote: Hello, I add a CSS class to component dynamcially the following way: inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); How can I remove this CSS class in java code? Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Use a model like it's intended? protected void onBeforeRender() { super.onBeforeRender(); inputComponent.add(new SimpleAttributeModifier(class, true, new AbstractReadOnlyModelString() { public String getObject() { return inputComponent.getFeedbackMessage() != null ? errorField : ; } }); } -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org I wrote the code in gmail, without the benefit of autocomplete or compile errors. What I'm really getting at is that you should *always* add the attribute modifier, which takes a model for the value to set the attribute to. The model (either Model or AbstractReadOnlyModel, although the latter is more appropriate for this) should then return the correct value based on the logic -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to remove css class from a component?
Hello, I add a CSS class to component dynamcially the following way: inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); How can I remove this CSS class in java code? Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to remove css class from a component?
Jeremy, glad to hear from you! My situation is a little different. The CSS class is added in the following way. Please see the following code. protected void onBeforeRender() { super.onBeforeRender(); if (inputComponent.getFeedbackMessage() != null) { inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); } else { // how to remove CSS class here?? } } Thanks! --- On Wed, 6/16/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: How to remove css class from a component? To: users@wicket.apache.org Cc: John Krasnay j...@krasnay.ca Date: Wednesday, June 16, 2010, 1:40 AM onComponentTag(...) { tag.remove(class); } On Wed, Jun 16, 2010 at 12:37 AM, David Chang david_q_zh...@yahoo.comwrote: Hello, I add a CSS class to component dynamcially the following way: inputComponent.add(new AttributeAppender(class, new ModelString(errorField), )); How can I remove this CSS class in java code? Best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to do a multiple page form?
Hi, I would like to do a multiple page form. For example, I have a two-page form. Both pages have a few fields that need validation. The first page has a button called Next and the second page has a Previous button and a Submit button. Any pointers or how-to info will be greatly appreciated. Best and have a great weekend! -David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can I develop without recompiling/restarting after every change?
Alex, 1) Run-jetty-run plugin: http://code.google.com/p/run-jetty-run/ You are right. I googled it out yesterday and tested it. It works perfect. Thanks for chiming! Best, David --- On Sun, 5/30/10, Alex Objelean alex.objel...@gmail.com wrote: From: Alex Objelean alex.objel...@gmail.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Sunday, May 30, 2010, 6:27 AM If you are using eclipse IDE for your development, I find the best tools the following: 1) Run-jetty-run plugin: http://code.google.com/p/run-jetty-run/ 2) jRebel With these two, you require absolutely no restart, no matter what you have changed in your wicket application (and not only wicket). Alex -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2236201.html Sent from the Wicket - User 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: Can I develop without recompiling/restarting after every change?
This is really a great discussion thread and turned up lot of good stuff. Love this forum! Cheers! --- On Sun, 5/30/10, Jason Lea ja...@kumachan.net.nz wrote: From: Jason Lea ja...@kumachan.net.nz Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Sunday, May 30, 2010, 3:57 PM I use DWP in Eclipse... In the server view, you have your Tomcat server listed that you can start/stop etc. When you double click it opens up the settings for runtime environment and other options. One option is something like 'serve module without publishing' - that one means it basically serves it from the target directory - and any changes to .html/.js/.css/.xml/.properties etc are available immediately without republishing. Doesn't deal with java changes though... that still requires republish - but I haven't experimented with other hot code replacement options and DWP. On 31/05/10 6:36 AM, Ray Weidner wrote: Nobody seems to have mentioned it, but I have been developing with Eclipse's Dynamic Web Projects, and it has greatly shortened my development cycle from when I was loading the project into Tomcat through the manager web interface. Basically, a DWP is able to run the server itself, and it automatically republishes a new build and restarts the server in the background. Even when I have to start it myself, it is fast, and I don't have to leave the Eclipse interface. More importantly, I am able to run my code in debug, allowing me to set breakpoints etc. I don't have enough experience with the other solutions to compare it, but it sure beats manual deployment and restarting the server every time you want to try a new build. DWP is built into Eclipse, not requiring any additional plug-ins. You just create the project as a DWP and take it from there. I ported a different project's web code into the DWP simply by copying over the relevant code, and making changes needed to build. The directory layout corresponds roughly to the internal structure of the resulting WAR file, so it's pretty easy to figure out where different files should go. When you want to create a WAR file for use outside the project, you just export the project to a WAR. Debugging and building can all be performed using Eclipses standard menu options. The only trick is that you have to create a server for your DWP, and you want to point that instance to an actual installed instance of Tomcat or JBoss. This presents you with new artifact on the Package View, and you might want to open up the Server View window for control over it (start, stop and publish are the main things to do here). That's all there is to it. On Fri, May 21, 2010 at 11:53 AM, ekallevige...@ekallevig.com wrote: I'm a front-end developer trying to learn Java (total n00b) and working on a wicket application at work. The whole process feels very slow primarily because I have to recompile and restart JBoss every time I make a change. So I'm wondering what the best way is to avoid having to do this when editing .java/.js/.css/.html files during development? I'd like to just make changes and then refresh the browser to test -- is this possible? -- Jason Lea - 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: Can I develop without recompiling/restarting after every change?
I am using Tomcat, any tips about how to develop out recompiling/restarting after every change? Best. --- On Fri, 5/21/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Friday, May 21, 2010, 12:17 PM the easiest way to do this is to use the Start class (Start.java) from the quickstart to run an embedded jetty instance in your IDE. then, if you run it in debug mode, it will hotswap any possible changes (and tell you if you must restart if it's an incompatible change) -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 21, 2010 at 10:53 AM, ekallevig e...@ekallevig.com wrote: I'm a front-end developer trying to learn Java (total n00b) and working on a wicket application at work. The whole process feels very slow primarily because I have to recompile and restart JBoss every time I make a change. So I'm wondering what the best way is to avoid having to do this when editing .java/.js/.css/.html files during development? I'd like to just make changes and then refresh the browser to test -- is this possible? I've seen in the FAQ that you can change the application settings to auto-reload markup .html files -- where would I insert this setting (remember I'm a total n00b). As to .css/.js/.java files -- do I need jRebel or something like that to get these files to reload automatically? Thanks for helping out a super-beginner :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html Sent from the Wicket - User 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: Can I develop without recompiling/restarting after every change?
Wouter, thanks for your input! I got tomcatPlugiin installed as you sugggested and I can start it from within eclipse to run a wicket app. But how can I do development without recompiling or restarting after every change? The quickstart's Start.java in Jeremy's suggestion uses Jetty as web server. How can I do a similar thing with Tomcat? Any pointers? I am using Tomcat 6.x. Best, David --- On Sat, 5/29/10, Wouter de Vaal wout...@gmail.com wrote: From: Wouter de Vaal wout...@gmail.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Saturday, May 29, 2010, 9:52 AM If you're using eclipse, use sysdeo: http://www.eclipsetotale.com/tomcatPlugin.html Wouter 2010/5/29 David Chang david_q_zh...@yahoo.com: I am using Tomcat, any tips about how to develop out recompiling/restarting after every change? Best. --- On Fri, 5/21/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Friday, May 21, 2010, 12:17 PM the easiest way to do this is to use the Start class (Start.java) from the quickstart to run an embedded jetty instance in your IDE. then, if you run it in debug mode, it will hotswap any possible changes (and tell you if you must restart if it's an incompatible change) -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 21, 2010 at 10:53 AM, ekallevig e...@ekallevig.com wrote: I'm a front-end developer trying to learn Java (total n00b) and working on a wicket application at work. The whole process feels very slow primarily because I have to recompile and restart JBoss every time I make a change. So I'm wondering what the best way is to avoid having to do this when editing .java/.js/.css/.html files during development? I'd like to just make changes and then refresh the browser to test -- is this possible? I've seen in the FAQ that you can change the application settings to auto-reload markup .html files -- where would I insert this setting (remember I'm a total n00b). As to .css/.js/.java files -- do I need jRebel or something like that to get these files to reload automatically? Thanks for helping out a super-beginner :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html Sent from the Wicket - User 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 -- check out https://www.memolio.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: Can I develop without recompiling/restarting after every change?
Yes. I am using tomcatPlugin 3.2.1. Here is what I followed as instructed by the download: Version 3.2 New features : - Tomcat 6.x supported. If you want to use DevLoader with Tomcat 6.x. Rename DevLoader.zip file to DevLoader.jar and put it in %Tomcat6_Home%/lib I modified parenet html or child html a few times, each trigger tomcat's restart. Did I miss something? Thanks! --- On Sat, 5/29/10, Wouter de Vaal wout...@gmail.com wrote: From: Wouter de Vaal wout...@gmail.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Saturday, May 29, 2010, 11:52 AM Did you use the DevLoader? If so, the eclipse classpath gets loaded directly into tomcat, making hotreplace and debugging possible. See http://www.eclipsetotale.com/tomcatPlugin/readmeDevLoader.html For heavy changes you might need restarts, but eclipse will prompt when necessary. When you use a tool like JRebel these restarts are let frequently needed. Wouter 2010/5/29 David Chang david_q_zh...@yahoo.com: Wouter, thanks for your input! I got tomcatPlugiin installed as you sugggested and I can start it from within eclipse to run a wicket app. But how can I do development without recompiling or restarting after every change? The quickstart's Start.java in Jeremy's suggestion uses Jetty as web server. How can I do a similar thing with Tomcat? Any pointers? I am using Tomcat 6.x. Best, David --- On Sat, 5/29/10, Wouter de Vaal wout...@gmail.com wrote: From: Wouter de Vaal wout...@gmail.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Saturday, May 29, 2010, 9:52 AM If you're using eclipse, use sysdeo: http://www.eclipsetotale.com/tomcatPlugin.html Wouter 2010/5/29 David Chang david_q_zh...@yahoo.com: I am using Tomcat, any tips about how to develop out recompiling/restarting after every change? Best. --- On Fri, 5/21/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: Can I develop without recompiling/restarting after every change? To: users@wicket.apache.org Date: Friday, May 21, 2010, 12:17 PM the easiest way to do this is to use the Start class (Start.java) from the quickstart to run an embedded jetty instance in your IDE. then, if you run it in debug mode, it will hotswap any possible changes (and tell you if you must restart if it's an incompatible change) -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 21, 2010 at 10:53 AM, ekallevig e...@ekallevig.com wrote: I'm a front-end developer trying to learn Java (total n00b) and working on a wicket application at work. The whole process feels very slow primarily because I have to recompile and restart JBoss every time I make a change. So I'm wondering what the best way is to avoid having to do this when editing .java/.js/.css/.html files during development? I'd like to just make changes and then refresh the browser to test -- is this possible? I've seen in the FAQ that you can change the application settings to auto-reload markup .html files -- where would I insert this setting (remember I'm a total n00b). As to .css/.js/.java files -- do I need jRebel or something like that to get these files to reload automatically? Thanks for helping out a super-beginner :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html Sent from the Wicket - User 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 -- check out https://www.memolio.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 -- check out https://www.memolio.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional
Re: When is AbstractBehavior#bind not called?
what i can do in onbeforerender to make the component 1's bind get called (in my case, the behavior contributes js and css to head)? components, not behaviors, have onbeforerender, correct? Thanks! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 10:26 PM behaviors have onbeforerender which will be called no matter what kind of link is used. -igor On Mon, May 17, 2010 at 6:30 PM, David Chang david_q_zh...@yahoo.com wrote: Any suggestion about minimal design changes? Thanks! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 11:27 AM the first link is a bookmarkable link, it recreates the page instance. bind is only called when the behavior is *added* to the component. link 2 is not a bookmarkable link, it doesnt recreate the page instance so the behavior is not added because a page instance where the behavior has already been added is used, thus no bind call -igor On Mon, May 17, 2010 at 6:22 AM, David Chang david_q_zh...@yahoo.com wrote: I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - 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 - 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
When is AbstractBehavior#bind not called?
I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: When is AbstractBehavior#bind not called?
igor, you imagined the exact situation I have regarding the link types. I did not say many details such as this in my original post because I was not sure whether that is useful, but you figured it perfectly. thanks!!! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 11:27 AM the first link is a bookmarkable link, it recreates the page instance. bind is only called when the behavior is *added* to the component. link 2 is not a bookmarkable link, it doesnt recreate the page instance so the behavior is not added because a page instance where the behavior has already been added is used, thus no bind call -igor On Mon, May 17, 2010 at 6:22 AM, David Chang david_q_zh...@yahoo.com wrote: I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - 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: When is AbstractBehavior#bind not called?
Any suggestion about minimal design changes? Thanks! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 11:27 AM the first link is a bookmarkable link, it recreates the page instance. bind is only called when the behavior is *added* to the component. link 2 is not a bookmarkable link, it doesnt recreate the page instance so the behavior is not added because a page instance where the behavior has already been added is used, thus no bind call -igor On Mon, May 17, 2010 at 6:22 AM, David Chang david_q_zh...@yahoo.com wrote: I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - 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: When is AbstractBehavior#bind not called?
One more thing regarding suggestion: The link on the second component points to a secured page (that needs login). --- On Mon, 5/17/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 9:30 PM Any suggestion about minimal design changes? Thanks! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 11:27 AM the first link is a bookmarkable link, it recreates the page instance. bind is only called when the behavior is *added* to the component. link 2 is not a bookmarkable link, it doesnt recreate the page instance so the behavior is not added because a page instance where the behavior has already been added is used, thus no bind call -igor On Mon, May 17, 2010 at 6:22 AM, David Chang david_q_zh...@yahoo.com wrote: I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: When is AbstractBehavior#bind not called?
Or can I trigger the bind method of the first component? Regards. --- On Mon, 5/17/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 9:33 PM One more thing regarding suggestion: The link on the second component points to a secured page (that needs login). --- On Mon, 5/17/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 9:30 PM Any suggestion about minimal design changes? Thanks! --- On Mon, 5/17/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: When is AbstractBehavior#bind not called? To: users@wicket.apache.org Date: Monday, May 17, 2010, 11:27 AM the first link is a bookmarkable link, it recreates the page instance. bind is only called when the behavior is *added* to the component. link 2 is not a bookmarkable link, it doesnt recreate the page instance so the behavior is not added because a page instance where the behavior has already been added is used, thus no bind call -igor On Mon, May 17, 2010 at 6:22 AM, David Chang david_q_zh...@yahoo.com wrote: I have a top page which has two panel-based components. Component 1 implements AbstractBehavior's bind method. Component 2 has a wicket Link pointing to a child page. When I am at the top page, refresh always gets #bind called. When I click the Link in Component 2, the bind method in Component 1 does not get called. Can anybody tell why this happened? I am quite puzzled. I am kind of new in wicket. I am using wicket 1.4.8 on tomcat. Regards. - 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 - 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
error in customize FormComponentFeedbackBorder
I am hoping to write a component customizing FormComponentFeedbackBorder. In the related HTML (please ingore the blank content for span), the following is okay. wicket:border span wicket:id = errorIndicator/span wicket:body/ /wicket:border But the following: wicket:border span wicket:id = errorIndicator wicket:body/ /span /wicket:border always produces runtime error saying WicketMessage: Expected close tag for dd wicket:id=fullNameBorder id=fullNameBorder3e The component (wicket:id=fullNameBorder) is what I am trying to attach the customized border component to. What is the wrong with the second way? Best, David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error in customize FormComponentFeedbackBorder
Igor, thanks for chiming. I got what you mean. Regards, David --- On Mon, 5/10/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: error in customize FormComponentFeedbackBorder To: users@wicket.apache.org Date: Monday, May 10, 2010, 7:16 PM you cannot change the nesting of components, it has to be in sync with java code -igor On Mon, May 10, 2010 at 2:42 PM, David Chang david_q_zh...@yahoo.com wrote: I am hoping to write a component customizing FormComponentFeedbackBorder. In the related HTML (please ingore the blank content for span), the following is okay. wicket:border span wicket:id = errorIndicator/span wicket:body/ /wicket:border But the following: wicket:border span wicket:id = errorIndicator wicket:body/ /span /wicket:border always produces runtime error saying WicketMessage: Expected close tag for dd wicket:id=fullNameBorder id=fullNameBorder3e The component (wicket:id=fullNameBorder) is what I am trying to attach the customized border component to. What is the wrong with the second way? Best, David - 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
Is there any out-of-box form validator for checkbox input?
I am curious about this. I am playing wicket based on the book WIA. I am unable to find an out-of-box form validator for checkbox input. I know I can write one. But just wanted to ask folks here to confirm. Regards, David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
how to build two-state (edit/view) form and form components?
I would like to have a form in which each component (such as input, textarea) has two states. Clicking on a form component's label or something else switches the component between edit (shown as usual input, textarea, etc) or view (normal html display) modes. Finally when a user is okay with everything, he/she can clicks the submit button to send the whole form to the server for further actions. Can anyone give me some pointers or tips for doing it in Wicket? Thanks and all the best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to centrally handle common exceptions from the databsae layer?
Since I did not hear any response, I would like to ask folks here, humbly, one more time. Am I asking the right question? Or Is my question confusing or unclear? Here is some background info why I am asking this quesiton. I did a spring web app before. I have a base form controller and its onSubmit method contains an abstract method as follows: public abstract ModelAndView doOnSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception; This base form controller's onSubmit centrally handles exceptions thrown from the service layer (most often the erros are database errors) and each specific form controller that inherits the base form controller handles business related to the specific form. In this way, I only need to do it once for handling errors and display right messages in user interface. Hope this helps. I really would like to hear from folks here about how to do the right thing. Best, David --- On Sun, 4/11/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: How to centrally handle common exceptions from the databsae layer? To: users@wicket.apache.org Date: Sunday, April 11, 2010, 11:38 AM I am hoping to understand how to write a good wicket app regarding handling exceptions from the databsae layer? For a wickt form, I can have the following to handle user submission: @Override protected void onSubmit() { User u = getModelObject(); userDao.saveUser(u); setResponsePage(Results.class); } For a wikcet web app, I can have many forms. But what is the best way to handle common database exceptions such as foreign key constraint violation, larger than a column width, etc. and displaying meaningful error messages? I could easily add try/catch around userDao#saveUser to handle them, but that would be bad in terms of code replication and maintenance. It may be good to handle in a central place. How do you deal with this issue in your wicket apps? Thanks for input! Best. - 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
How to centrally handle common exceptions from the databsae layer?
I am hoping to understand how to write a good wicket app regarding handling exceptions from the databsae layer? For a wickt form, I can have the following to handle user submission: @Override protected void onSubmit() { User u = getModelObject(); userDao.saveUser(u); setResponsePage(Results.class); } For a wikcet web app, I can have many forms. But what is the best way to handle common database exceptions such as foreign key constraint violation, larger than a column width, etc. and displaying meaningful error messages? I could easily add try/catch around userDao#saveUser to handle them, but that would be bad in terms of code replication and maintenance. It may be good to handle in a central place. How do you deal with this issue in your wicket apps? Thanks for input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Any mature work on integrating Hibernate Validator with Wicket?
hi, did you get the jsr 303 validation code released? where can i find it? i am really excited looking forward to it. all the best, david --- On Mon, 4/5/10, Uwe Schäfer u...@thomas-daily.de wrote: From: Uwe Schäfer u...@thomas-daily.de Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:08 AM David Chang schrieb: Any comment or pointers regarding relatively mature work in this regard? we did something that does not need spring, though it need some polishing and is not yet released. i´ll contact you later this week. cu uwe - 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
Use Spring's LocalValidatorFactoryBean
I am hoping to use Spring's LocalValidatorFactoryBean and define it in a Spring context file as follows: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:util=http://www.springframework.org/schema/util; xmlns:mvc=http://www.springframework.org/schema/mvc; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd; bean id=validator class=org.springframework.validation.beanvalidation.LocalValidatorFactoryBean / /beans However, Spring-configured validator in code is always null: @SpringBean protected Validator validator; In the same Spring context file, I defined other DAO beans used by wicket components and they are just fine. Did anyone have success in configuring and using LocalValidatorFactoryBean? What did I do is wrong? I am using Spring 3.0.2, Hibernate Validator 4.0.2, and Wicket 1.4.7. Thanks for any input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Use Spring's LocalValidatorFactoryBean
Carlos, thanks for the info. I remember I saw it somewhere but totally forgot this. It worked. Thanks! -David --- On Fri, 4/9/10, Carlos Vara bashfl...@gmail.com wrote: From: Carlos Vara bashfl...@gmail.com Subject: Re: Use Spring's LocalValidatorFactoryBean To: users@wicket.apache.org Date: Friday, April 9, 2010, 12:54 PM Just a quick check, in case you are using @SpringBean outside of a Wicket component, you have to inject it manually using: InjectorHolder.getInjector().inject(this); On Fri, Apr 9, 2010 at 5:32 PM, David Chang david_q_zh...@yahoo.com wrote: I am hoping to use Spring's LocalValidatorFactoryBean and define it in a Spring context file as follows: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:util=http://www.springframework.org/schema/util; xmlns:mvc=http://www.springframework.org/schema/mvc; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd; bean id=validator class=org.springframework.validation.beanvalidation.LocalValidatorFactoryBean / /beans However, Spring-configured validator in code is always null: @SpringBean protected Validator validator; In the same Spring context file, I defined other DAO beans used by wicket components and they are just fine. Did anyone have success in configuring and using LocalValidatorFactoryBean? What did I do is wrong? I am using Spring 3.0.2, Hibernate Validator 4.0.2, and Wicket 1.4.7. Thanks for any input! Best. - 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: Properties of model are set to NULL even though we have setRequired set to true
Hello Wayne, I understand your frustration. Recently, I got a similar case but it eventually turned out that it was my fault due to being new in Wicket. Long story short, for a dropdownchoice list with loadabledetachablemodel, I set up a load method, but in another place, I used dropdownchoice#setChoices to update the list for ajax update. This method actually changes the model, but i did not know about its impact. I spent almost a whole day to figure out why the load method did not get called again. So in your case, there MUST be a reason. Look everywhere these fields get changed. Good luck! David --- On Tue, 4/6/10, nino martinez wael nino.martinez.w...@gmail.com wrote: From: nino martinez wael nino.martinez.w...@gmail.com Subject: Re: Properties of model are set to NULL even though we have setRequired set to true To: users@wicket.apache.org Date: Tuesday, April 6, 2010, 9:51 AM Hi Wayne I guess you've tried debugging it, so it's not a consistent error? Are you using any special web container or is wrapped somehow (like terracotta)? 2010/4/6 Wayne Pope waynemailingli...@googlemail.com: Hi, has anyone got any idea about this? I'm still 'spinning my wheels' on it. thanks for any help. On Fri, Apr 2, 2010 at 5:00 PM, Wayne Pope waynemailingli...@googlemail.com wrote: Hi, we've got several examples in our logs of properties of the model being set to null even though the textfield is set to required. I have NO idea how on earth this can happen - its just doesn't make sense - and its really frustrating me!! here's an example: Caused by: java.lang.NullPointerException at org.apache.commons.codec.digest.DigestUtils.md5(DigestUtils.java:86) at org.apache.commons.codec.digest.DigestUtils.md5Hex(DigestUtils.java:108) at hub.app.wicket.admin.ChangePasswordPage$1.onSubmit(ChangePasswordPage.java:49) at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1518) ... FormUser form = new FormUser(form, new CompoundPropertyModelUser(new HibernateEntityModelUser(User.class, u.getId( { �...@override protected void onSubmit() { User u = getModelObject(); u.setPassword(DigestUtils.md5Hex(u.getPassword()); userDAO.save(u); setRedirect(true); setResponsePage(HubApplication.get().getHomePage()); } }; form.add(new Label(email)); PasswordTextField password = new PasswordTextField(password); form.add(password); PasswordTextField repeatPassword = new PasswordTextField(repeatPassword); repeatPassword.setModel(password.getModel()); form.add(repeatPassword); form.add(new EqualPasswordInputValidator(password, repeatPassword)); form.add(new SubmitLink(submitLink)); add(form); This is just one example - we see elsewhere in the logs sometimes a textfield that is setrequired(true) ends up nullpointering somewhere when saving the object. What could do this? - 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: Any mature work on integrating Hibernate Validator with Wicket?
Hi folks, I feel a bit puzzled about not getting any response on this topic. I have to say that I am new in Wicket. If this a bad or wrong question or if this is something not worthy to explore, please feel free to let me know. Thanks for any input! --- On Sun, 4/4/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Sunday, April 4, 2010, 11:31 PM Found another related work. http://42lines.net/content/integrating-hibernate-validator-and-wicket Any comment or pointers regarding relatively mature work in this regard? Regards. --- On Sat, 4/3/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Saturday, April 3, 2010, 1:45 PM Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - 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: Any mature work on integrating Hibernate Validator with Wicket?
thanks for chiming in. sorry if i was not clear in prevoius posts. i would like to hear comments whether it is worthy to explore or any benefits. i also would like to know whether there is more mature work since i only found experimental work. i am unable to find anything aobut it on wicketstuff. regards. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:21 AM you have answered your own question twice, why does anyone else need to reply? -igor On Mon, Apr 5, 2010 at 8:01 AM, David Chang david_q_zh...@yahoo.com wrote: Hi folks, I feel a bit puzzled about not getting any response on this topic. I have to say that I am new in Wicket. If this a bad or wrong question or if this is something not worthy to explore, please feel free to let me know. Thanks for any input! --- On Sun, 4/4/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Sunday, April 4, 2010, 11:31 PM Found another related work. http://42lines.net/content/integrating-hibernate-validator-and-wicket Any comment or pointers regarding relatively mature work in this regard? Regards. --- On Sat, 4/3/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Saturday, April 3, 2010, 1:45 PM Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - 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 - 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: Any mature work on integrating Hibernate Validator with Wicket?
Using Hibernate Validator may bring a few good things: 1. On the data end, it helps to improve data, performance, etc. Also the annotation you write on domain objects get translated into database creation and objects save/update. You can find more on in this area. Obviously, this has nothing to do with wicket. 2. Regarding the web tier, it is often needed to write validation rules such as not null or the maximum chars in an input field being less than 10. In pure wicket, you have to add many validation rules yourself manually for each field. Why should I do so second time in wicket if I can explicitly specify them on domain objects via Hibernate Validator (or Bean Validation, JSR 303, now official)? I hope to see wicket can take adavantage of bean validation to let us code faster and have more maintainable code. Please feel free to comment I am wrong. Best. --- On Mon, 4/5/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:31 AM Do you have any user stories on the topic? It would be useful to evaluate how interesting the use case is. Me myself I cannot immagine anything useful could come out of hibernate validators, only something very trivial. Could be wrong, thoug. ** Martin 2010/4/5 David Chang david_q_zh...@yahoo.com: thanks for chiming in. sorry if i was not clear in prevoius posts. i would like to hear comments whether it is worthy to explore or any benefits. i also would like to know whether there is more mature work since i only found experimental work. i am unable to find anything aobut it on wicketstuff. regards. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:21 AM you have answered your own question twice, why does anyone else need to reply? -igor On Mon, Apr 5, 2010 at 8:01 AM, David Chang david_q_zh...@yahoo.com wrote: Hi folks, I feel a bit puzzled about not getting any response on this topic. I have to say that I am new in Wicket. If this a bad or wrong question or if this is something not worthy to explore, please feel free to let me know. Thanks for any input! --- On Sun, 4/4/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Sunday, April 4, 2010, 11:31 PM Found another related work. http://42lines.net/content/integrating-hibernate-validator-and-wicket Any comment or pointers regarding relatively mature work in this regard? Regards. --- On Sat, 4/3/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Saturday, April 3, 2010, 1:45 PM Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - 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 - 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 - To unsubscribe
Re: Any mature work on integrating Hibernate Validator with Wicket?
so if somebody took the code from the blogs and put them on a project in wicketstuff that would make it more mature? I dont think so. wicketstuff is just one place to look at. But I dont think people would put their blogs there. Yes, they can. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:35 AM so if somebody took the code from the blogs and put them on a project in wicketstuff that would make it more mature? there is not much to integrating the validators with wicket so each project probably built out their own way to do it that suits that project. -igor On Mon, Apr 5, 2010 at 8:27 AM, David Chang david_q_zh...@yahoo.com wrote: thanks for chiming in. sorry if i was not clear in prevoius posts. i would like to hear comments whether it is worthy to explore or any benefits. i also would like to know whether there is more mature work since i only found experimental work. i am unable to find anything aobut it on wicketstuff. regards. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:21 AM you have answered your own question twice, why does anyone else need to reply? -igor On Mon, Apr 5, 2010 at 8:01 AM, David Chang david_q_zh...@yahoo.com wrote: Hi folks, I feel a bit puzzled about not getting any response on this topic. I have to say that I am new in Wicket. If this a bad or wrong question or if this is something not worthy to explore, please feel free to let me know. Thanks for any input! --- On Sun, 4/4/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Sunday, April 4, 2010, 11:31 PM Found another related work. http://42lines.net/content/integrating-hibernate-validator-and-wicket Any comment or pointers regarding relatively mature work in this regard? Regards. --- On Sat, 4/3/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Saturday, April 3, 2010, 1:45 PM Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Any mature work on integrating Hibernate Validator with Wicket?
Ben, Thanks for sharing your code, which, IMHO, definately helps not only me but also others. I believe that using Hibernate Validator really kills more than one bird in one stone. All the best, David P.S. folks, please feel free to comment how you feel about the Bean Validation/Hiberate Validator thing. Just wanted to do the right/good thing for me and everybody. There might be cases where using Hibernate Validator will not be helpful or bad. Please feel free to let us know if you can think of them. --- On Mon, 4/5/10, Ben Tilford bentilf...@gmail.com wrote: From: Ben Tilford bentilf...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 3:39 PM So far this is what I've got. Doesn't do anything with groups or the more advanced stuff but this may be all it takes. public class BeanComponentValidatorT extends AbstractValidatorT { public BeanComponentValidator() { super(); } @Override protected void onValidate(IValidatableT validatable) { for(ConstraintViolationT violation : validate(validatable.getValue())) { validatable.error(new ValidationError().addMessageKey(violation.getMessage())); } } SetConstraintViolationT validate(T value) { Validator validator = Validation.buildDefaultValidatorFactory().getValidator();//this may only be working because I'm using Spring 3.0.2 and Hibernate 3.5 I don't know for sure. return validator.validate(value); } } On Mon, Apr 5, 2010 at 12:15 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! It's quite easy to add trivial min/max/required validators using (any) helper method. Maybe bindgen project would be closest to this.. it's already working with annotations, it could perhaps parse also annotations of property target objects. ** Martin 2010/4/5 David Chang david_q_zh...@yahoo.com: Using Hibernate Validator may bring a few good things: 1. On the data end, it helps to improve data, performance, etc. Also the annotation you write on domain objects get translated into database creation and objects save/update. You can find more on in this area. Obviously, this has nothing to do with wicket. 2. Regarding the web tier, it is often needed to write validation rules such as not null or the maximum chars in an input field being less than 10. In pure wicket, you have to add many validation rules yourself manually for each field. Why should I do so second time in wicket if I can explicitly specify them on domain objects via Hibernate Validator (or Bean Validation, JSR 303, now official)? I hope to see wicket can take adavantage of bean validation to let us code faster and have more maintainable code. Please feel free to comment I am wrong. Best. --- On Mon, 4/5/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:31 AM Do you have any user stories on the topic? It would be useful to evaluate how interesting the use case is. Me myself I cannot immagine anything useful could come out of hibernate validators, only something very trivial. Could be wrong, thoug. ** Martin 2010/4/5 David Chang david_q_zh...@yahoo.com: thanks for chiming in. sorry if i was not clear in prevoius posts. i would like to hear comments whether it is worthy to explore or any benefits. i also would like to know whether there is more mature work since i only found experimental work. i am unable to find anything aobut it on wicketstuff. regards. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:21 AM you have answered your own question twice, why does anyone else need to reply? -igor On Mon, Apr 5, 2010 at 8:01 AM, David Chang david_q_zh...@yahoo.com wrote: Hi folks, I feel a bit puzzled about not getting any response on this topic. I have to say that I am new in Wicket. If this a bad or wrong question or if this is something not worthy to explore, please feel free to let me know. Thanks for any input! --- On Sun, 4/4/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users
Re: Any mature work on integrating Hibernate Validator with Wicket?
Carlos, Thanks for chiming in and for good work and sharing! so picking the code from my or others blog, The code may be simple, but the idea/benefits I see may be great. Wouldn't be better to make it available on wicketstuff in good shape instead of me or others googling it out? :) Just my 2 cents. Regards, David --- On Mon, 4/5/10, Carlos Vara bashfl...@gmail.com wrote: From: Carlos Vara bashfl...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 4:52 PM Hi David, I'm the author of the first article that you linked to: http://carinae.net/tag/hibernate-validator/ http://carinae.net/2009/12/integration-of-jsr-303-bean-validation-standard-and-wicket-1-4/Basically, you hardly need more than the two provided validators (for property validation on field input, and full bean validation on form input). I added some extra code to integrate it with Spring and to centralize the locale, but if you don't need it, you can easily use only those validators without anything else. The way I see it, there is no code in wicketstuff because it is quite simple to integrate jsr303 and wicket, so picking the code from my or others blog, and maybe tweaking it a little for your needs is probably all you need. On Mon, Apr 5, 2010 at 9:39 PM, Ben Tilford bentilf...@gmail.com wrote: So far this is what I've got. Doesn't do anything with groups or the more advanced stuff but this may be all it takes. public class BeanComponentValidatorT extends AbstractValidatorT { public BeanComponentValidator() { super(); } @Override protected void onValidate(IValidatableT validatable) { for(ConstraintViolationT violation : validate(validatable.getValue())) { validatable.error(new ValidationError().addMessageKey(violation.getMessage())); } } SetConstraintViolationT validate(T value) { Validator validator = Validation.buildDefaultValidatorFactory().getValidator();//this may only be working because I'm using Spring 3.0.2 and Hibernate 3.5 I don't know for sure. return validator.validate(value); } } On Mon, Apr 5, 2010 at 12:15 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! It's quite easy to add trivial min/max/required validators using (any) helper method. Maybe bindgen project would be closest to this.. it's already working with annotations, it could perhaps parse also annotations of property target objects. ** Martin 2010/4/5 David Chang david_q_zh...@yahoo.com: Using Hibernate Validator may bring a few good things: 1. On the data end, it helps to improve data, performance, etc. Also the annotation you write on domain objects get translated into database creation and objects save/update. You can find more on in this area. Obviously, this has nothing to do with wicket. 2. Regarding the web tier, it is often needed to write validation rules such as not null or the maximum chars in an input field being less than 10. In pure wicket, you have to add many validation rules yourself manually for each field. Why should I do so second time in wicket if I can explicitly specify them on domain objects via Hibernate Validator (or Bean Validation, JSR 303, now official)? I hope to see wicket can take adavantage of bean validation to let us code faster and have more maintainable code. Please feel free to comment I am wrong. Best. --- On Mon, 4/5/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010, 11:31 AM Do you have any user stories on the topic? It would be useful to evaluate how interesting the use case is. Me myself I cannot immagine anything useful could come out of hibernate validators, only something very trivial. Could be wrong, thoug. ** Martin 2010/4/5 David Chang david_q_zh...@yahoo.com: thanks for chiming in. sorry if i was not clear in prevoius posts. i would like to hear comments whether it is worthy to explore or any benefits. i also would like to know whether there is more mature work since i only found experimental work. i am unable to find anything aobut it on wicketstuff. regards. --- On Mon, 4/5/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Monday, April 5, 2010
Re: Any mature work on integrating Hibernate Validator with Wicket?
Found another related work. http://42lines.net/content/integrating-hibernate-validator-and-wicket Any comment or pointers regarding relatively mature work in this regard? Regards. --- On Sat, 4/3/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: Any mature work on integrating Hibernate Validator with Wicket? To: users@wicket.apache.org Date: Saturday, April 3, 2010, 1:45 PM Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - 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
Any mature work on integrating Hibernate Validator with Wicket?
Is there any mature work on integrating Hibernate Validator with Wicket? I am unable to find any at wicketstuff. Googled and found this work is interesting. http://carinae.net/tag/hibernate-validator/ Any pointers? Any comment? Thanks and Happy Easter! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
My first WiQuery app does not work
Here is what I have: JDK 1.6, Wicket 1.4.7, WiQuery 1.0, Tomcat 6.0.24 I downloaded wiquery and put its jar on the classpath. I copied the Hello World sample from http://code.google.com/p/wiquery/wiki/QuickStart Here is my code: HTML:- html head titleWiQuery Quickstart Archetype Homepage/title /head body button wicket:id=open-dialogOpen dialog !/button p wicket:id=dialog Hello world, yes we can ! /p /body /html Java: import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.odlabs.wiquery.core.events.Event; import org.odlabs.wiquery.core.events.MouseEvent; import org.odlabs.wiquery.core.events.WiQueryEventBehavior; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.ui.dialog.Dialog; public class WiqueryDialog extends WebPage { public WiqueryDialog() { final Dialog dialog = new Dialog(dialog); add(dialog); Button button = new Button(open-dialog); button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) { @Override public JsScope callback() { return JsScope.quickScope(dialog.open().render()); } })); add(button); } } -- I did not get any compiler error and I can run the wicket app and see the html in the browser. However, I did not get any respone when clicking the button. What I did is wrong? Thanks. -- here is generated html -- html head titleWiQuery Quickstart Archetype Homepage/title script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.CoreJavaScriptResourceReference/jquery/jquery-1.3.2.js/script script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.WiqueryGeneratedJavaScriptResourceReference/1269950176687wiquery-gen.js/script /head body button name=open-dialog id=open_dialog1Open dialog !/button p id=dialog2 Hello world, yes we can ! /p /body /html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: My first WiQuery app does not work
Julien, Thanks for your reply and it works now. Strangely, I copied the example on that page, which does not ask me to extend WiQueryWebApplication. Something wrong with that Hello World example? Two quick questions: 1. My environment is JDK 1.6 and Wicket 1.4.7. WiQuery 1.0 should have no problem with it. Correct? 2. Why the example requires double-click? Regards. -David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 8:02 AM Hi, Have you enable wiquery in your Wicket application ? This link is an implementation of the WebApplication with the linked with Wiquery: http://code.google.com/p/wiquery/source/browse/branches/1.0.1/src/main/java/org/odlabs/wiquery/utils/WiQueryWebApplication.java Hope that helped you Julien Roche On Tue, Mar 30, 2010 at 1:56 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I have: JDK 1.6, Wicket 1.4.7, WiQuery 1.0, Tomcat 6.0.24 I downloaded wiquery and put its jar on the classpath. I copied the Hello World sample from http://code.google.com/p/wiquery/wiki/QuickStart Here is my code: HTML:- html head titleWiQuery Quickstart Archetype Homepage/title /head body button wicket:id=open-dialogOpen dialog !/button p wicket:id=dialog Hello world, yes we can ! /p /body /html Java: import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.odlabs.wiquery.core.events.Event; import org.odlabs.wiquery.core.events.MouseEvent; import org.odlabs.wiquery.core.events.WiQueryEventBehavior; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.ui.dialog.Dialog; public class WiqueryDialog extends WebPage { public WiqueryDialog() { final Dialog dialog = new Dialog(dialog); add(dialog); Button button = new Button(open-dialog); button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) { @Override public JsScope callback() { return JsScope.quickScope(dialog.open().render()); } })); add(button); } } -- I did not get any compiler error and I can run the wicket app and see the html in the browser. However, I did not get any respone when clicking the button. What I did is wrong? Thanks. -- here is generated html -- html head titleWiQuery Quickstart Archetype Homepage/title script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.CoreJavaScriptResourceReference/jquery/jquery-1.3.2.js/script script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.WiqueryGeneratedJavaScriptResourceReference/1269950176687wiquery-gen.js/script /head body button name=open-dialog id=open_dialog1Open dialog !/button p id=dialog2 Hello world, yes we can ! /p /body /html - 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: My first WiQuery app does not work
Julien, thanks for reply. Silly me. I should have looked at the sample code. I was too excited seeing the first app works. Best, David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 11:41 AM Hi, The dialog display on dbclick because we bind the event on it : MouseEvent.DBLCLICK If you want to display on a simple click, use MouseEvent.CLICK Regards Julien Roche On Tue, Mar 30, 2010 at 4:29 PM, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: David, Adding the component instantiation listener is more flexible than extending WiQueryWebApplication. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com On 30 March 2010 15:18, David Chang david_q_zh...@yahoo.com wrote: Julien, Thanks for your reply and it works now. Strangely, I copied the example on that page, which does not ask me to extend WiQueryWebApplication. Something wrong with that Hello World example? Two quick questions: 1. My environment is JDK 1.6 and Wicket 1.4.7. WiQuery 1.0 should have no problem with it. Correct? 2. Why the example requires double-click? Regards. -David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 8:02 AM Hi, Have you enable wiquery in your Wicket application ? This link is an implementation of the WebApplication with the linked with Wiquery: http://code.google.com/p/wiquery/source/browse/branches/1.0.1/src/main/java/org/odlabs/wiquery/utils/WiQueryWebApplication.java Hope that helped you Julien Roche On Tue, Mar 30, 2010 at 1:56 PM, David Chang david_q_zh...@yahoo.com wrote: Here is what I have: JDK 1.6, Wicket 1.4.7, WiQuery 1.0, Tomcat 6.0.24 I downloaded wiquery and put its jar on the classpath. I copied the Hello World sample from http://code.google.com/p/wiquery/wiki/QuickStart Here is my code: HTML:- html head titleWiQuery Quickstart Archetype Homepage/title /head body button wicket:id=open-dialogOpen dialog !/button p wicket:id=dialog Hello world, yes we can ! /p /body /html Java: import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.odlabs.wiquery.core.events.Event; import org.odlabs.wiquery.core.events.MouseEvent; import org.odlabs.wiquery.core.events.WiQueryEventBehavior; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.ui.dialog.Dialog; public class WiqueryDialog extends WebPage { public WiqueryDialog() { final Dialog dialog = new Dialog(dialog); add(dialog); Button button = new Button(open-dialog); button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) { @Override public JsScope callback() { return JsScope.quickScope(dialog.open().render()); } })); add(button); } } -- I did not get any compiler error and I can run the wicket app and see the html in the browser. However, I did not get any respone when clicking the button. What I did is wrong? Thanks. -- here is generated html -- html head titleWiQuery Quickstart Archetype Homepage/title script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.CoreJavaScriptResourceReference/jquery/jquery-1.3.2.js/script script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.WiqueryGeneratedJavaScriptResourceReference/1269950176687wiquery-gen.js/script /head body button name=open-dialog id=open_dialog1Open dialog !/button p id=dialog2 Hello world, yes we can ! /p /body /html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: My first WiQuery app does not work
In my experiment, the app does not work without extending WiQueryWebApplication. Is extending WiQueryWebApplication a must? The Hello World example does not extend WiQueryWebApplication and I copied the example code but it does not work. Best, David --- On Tue, 3/30/10, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: From: Cemal Bayramoglu jweekend_for...@cabouge.com Subject: Re: My first WiQuery app does not work To: users users@wicket.apache.org Date: Tuesday, March 30, 2010, 10:29 AM David, Adding the component instantiation listener is more flexible than extending WiQueryWebApplication. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com On 30 March 2010 15:18, David Chang david_q_zh...@yahoo.com wrote: Julien, Thanks for your reply and it works now. Strangely, I copied the example on that page, which does not ask me to extend WiQueryWebApplication. Something wrong with that Hello World example? Two quick questions: 1. My environment is JDK 1.6 and Wicket 1.4.7. WiQuery 1.0 should have no problem with it. Correct? 2. Why the example requires double-click? Regards. -David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 8:02 AM Hi, Have you enable wiquery in your Wicket application ? This link is an implementation of the WebApplication with the linked with Wiquery: http://code.google.com/p/wiquery/source/browse/branches/1.0.1/src/main/java/org/odlabs/wiquery/utils/WiQueryWebApplication.java Hope that helped you Julien Roche On Tue, Mar 30, 2010 at 1:56 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I have: JDK 1.6, Wicket 1.4.7, WiQuery 1.0, Tomcat 6.0.24 I downloaded wiquery and put its jar on the classpath. I copied the Hello World sample from http://code.google.com/p/wiquery/wiki/QuickStart Here is my code: HTML:- html head titleWiQuery Quickstart Archetype Homepage/title /head body button wicket:id=open-dialogOpen dialog !/button p wicket:id=dialog Hello world, yes we can ! /p /body /html Java: import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.odlabs.wiquery.core.events.Event; import org.odlabs.wiquery.core.events.MouseEvent; import org.odlabs.wiquery.core.events.WiQueryEventBehavior; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.ui.dialog.Dialog; public class WiqueryDialog extends WebPage { public WiqueryDialog() { final Dialog dialog = new Dialog(dialog); add(dialog); Button button = new Button(open-dialog); button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) { @Override public JsScope callback() { return JsScope.quickScope(dialog.open().render()); } })); add(button); } } -- I did not get any compiler error and I can run the wicket app and see the html in the browser. However, I did not get any respone when clicking the button. What I did is wrong? Thanks. -- here is generated html -- html head titleWiQuery Quickstart Archetype Homepage/title script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.CoreJavaScriptResourceReference/jquery/jquery-1.3.2.js/script script type=text/javascript src=resources/org.odlabs.wiquery.core.commons.WiqueryGeneratedJavaScriptResourceReference/1269950176687wiquery-gen.js/script /head body button name=open-dialog id=open_dialog1Open dialog !/button p id=dialog2 Hello world, yes we can ! /p /body /html - 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: better way setting up ID for a Wicket component?
Martin and Jeremy, thanks for chiming. The suggested solutions work but IMHO none of them seem ideal in terms of less code, error-less, and refactoring. The best is to have that convenience method or use Wickt 1.5 where HTMLElement's id will be kept. All the best, David --- On Tue, 3/30/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 12:32 AM Hi! Actually one line that he wants is more like: { Label label; add(label = new Label(abc, abcdef).setOutputMarkupId(true).setMarkupId(label.getId())); } ;) ** Martin 2010/3/30 Jeremy Thomerson jer...@wickettraining.com: You can still do this in one line: add(new Label(abc, abcdef).setOutputMarkupId(true).setMarkupId(foo)); -- Jeremy Thomerson http://www.wickettraining.com On Mon, Mar 29, 2010 at 10:32 PM, David Chang david_q_zh...@yahoo.comwrote: Well, it is not bad to tell people what you believe is right:) We are wicket programmers, aren't we? :) Feel good to say what I wanted to say and thanks for the initial JIRA idea --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 11:06 PM See...told you. :) On Mon, Mar 29, 2010 at 10:32 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: im letting you know. we dont need to litter the public api with such trivial methods, the api has a large surface area as it is. i am sure as you code more with wicket you will find another 30 such trivial methods that will be useful to you, this is what static imports are for. -igor On Mon, Mar 29, 2010 at 6:18 PM, James Carman jcar...@carmanconsulting.com wrote: Perhaps. File a JIRA report ( https://issues.apache.org/jira/browse/WICKET) and ask for it as a New Feature. If the core developers don't like the idea, I'm sure they'll let you know. :) On Mon, Mar 29, 2010 at 9:13 PM, David Chang david_q_zh...@yahoo.com wrote: Using an external helper should do the trick, but it feels not so natural as a convenince method as mentioned in my previous email. Would it be possible for such a method make its way into a future release? Regards. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 9:07 PM You could make your own helper method that sets both to the same thing and returns the component. Just modify what I sent earlier. On Mon, Mar 29, 2010 at 9:03 PM, David Chang david_q_zh...@yahoo.com wrote: Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.com wrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks
Re: better way setting up ID for a Wicket component?
Craig, I really appreciate your input. If a panel is reused more than one time on the same page, then the panel's components should not use IDs in the first place. It would always violate valid HTML. Correct? Regards. --- On Tue, 3/30/10, McIlwee, Craig craig.mcil...@openroadsconsulting.com wrote: From: McIlwee, Craig craig.mcil...@openroadsconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 7:49 AM There's a good reason that markup ID doesn't match wicket ID. If I have a panel with a few form components, and then put 2 of those panels on the same page, then your approach would break things like document.getElementId(...) because there would be more than 1 element w/ same ID. Craig _ From: David Chang [mailto:david_q_zh...@yahoo.com] To: users@wicket.apache.org Sent: Mon, 29 Mar 2010 21:03:46 -0400 Subject: Re: better way setting up ID for a Wicket component? Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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: My first WiQuery app does not work
Julie, Thanks for asking. The code is in the beggining of this thread. For that, I copied the Hello World example from wiquery site. If I make my wicket application extend WiQueryWebApplication, then everything is working fine. Thanks, David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 2:50 PM Hi, That's really odd. Can we see your code ? Thanks Julien Roche On Tue, Mar 30, 2010 at 6:31 PM, David Chang david_q_zh...@yahoo.comwrote: In my experiment, the app does not work without extending WiQueryWebApplication. Is extending WiQueryWebApplication a must? The Hello World example does not extend WiQueryWebApplication and I copied the example code but it does not work. Best, David --- On Tue, 3/30/10, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: From: Cemal Bayramoglu jweekend_for...@cabouge.com Subject: Re: My first WiQuery app does not work To: users users@wicket.apache.org Date: Tuesday, March 30, 2010, 10:29 AM David, Adding the component instantiation listener is more flexible than extending WiQueryWebApplication. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com On 30 March 2010 15:18, David Chang david_q_zh...@yahoo.com wrote: Julien, Thanks for your reply and it works now. Strangely, I copied the example on that page, which does not ask me to extend WiQueryWebApplication. Something wrong with that Hello World example? Two quick questions: 1. My environment is JDK 1.6 and Wicket 1.4.7. WiQuery 1.0 should have no problem with it. Correct? 2. Why the example requires double-click? Regards. -David --- On Tue, 3/30/10, julien roche AKA indiana_jules roche@gmail.com wrote: From: julien roche AKA indiana_jules roche@gmail.com Subject: Re: My first WiQuery app does not work To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 8:02 AM Hi, Have you enable wiquery in your Wicket application ? This link is an implementation of the WebApplication with the linked with Wiquery: http://code.google.com/p/wiquery/source/browse/branches/1.0.1/src/main/java/org/odlabs/wiquery/utils/WiQueryWebApplication.java Hope that helped you Julien Roche On Tue, Mar 30, 2010 at 1:56 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I have: JDK 1.6, Wicket 1.4.7, WiQuery 1.0, Tomcat 6.0.24 I downloaded wiquery and put its jar on the classpath. I copied the Hello World sample from http://code.google.com/p/wiquery/wiki/QuickStart Here is my code: HTML:- html head titleWiQuery Quickstart Archetype Homepage/title /head body button wicket:id=open-dialogOpen dialog !/button p wicket:id=dialog Hello world, yes we can ! /p /body /html Java: import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; import org.odlabs.wiquery.core.events.Event; import org.odlabs.wiquery.core.events.MouseEvent; import org.odlabs.wiquery.core.events.WiQueryEventBehavior; import org.odlabs.wiquery.core.javascript.JsScope; import org.odlabs.wiquery.ui.dialog.Dialog; public class WiqueryDialog extends WebPage { public WiqueryDialog() { final Dialog dialog = new Dialog(dialog); add(dialog); Button button = new Button(open-dialog); button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) { @Override public JsScope callback() { return JsScope.quickScope(dialog.open().render()); } })); add(button); } } -- I did not get any compiler error and I can run the wicket app and see the html in the browser. However, I did not get any respone when clicking the button. What I did is wrong? Thanks. -- here is generated html -- html head titleWiQuery Quickstart Archetype Homepage/title script type=text/javascript src=resources
About WiQueryWebApplication
IMHO, I am not quite sure this class (another indirection) is really necessary. All this class does is having a member variable: private WiQueryInstantiationListener wiqueryPluginInstantiationListener; and insert the following two lines into init(). wiqueryPluginInstantiationListener = new WiQueryInstantiationListener(); addComponentInstantiationListener(wiqueryPluginInstantiationListener); If this class is really necessary in terms of design, then we could have a similar request for another class just for Spring Annotation to work. This list may go on and on. It may feel more beautiful to have ALL your wicket applications simply extend WicketApplication. Just my 2 cents. All the best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: better way setting up ID for a Wicket component?
I feel there is some misunderstanding on this thread now. Two things need to clear: 1. There is no need to call this convenience method on each wicket component. Nobody asks for that. 2. The method is there simply for the programmer to decide to use it or not and use it right. Without this method, it is still equally likely to have duplicate wicket ids due multiple use of the same panel. Just my 2 cents. Best. --- On Tue, 3/30/10, Jeremy Thomerson jer...@wickettraining.com wrote: From: Jeremy Thomerson jer...@wickettraining.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 5:28 PM That's the point of what he's saying. It's easy to say that, but in practice, you may create a component that you don't think will ever be used on the same page twice, and then it is. That's why Wicket defaults to the safest practice of generating an ID for you. I typically avoid programmatically setting the markup ID for this very reason. There's (almost) always a way around it. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Mar 30, 2010 at 12:06 PM, David Chang david_q_zh...@yahoo.comwrote: Craig, I really appreciate your input. If a panel is reused more than one time on the same page, then the panel's components should not use IDs in the first place. It would always violate valid HTML. Correct? Regards. --- On Tue, 3/30/10, McIlwee, Craig craig.mcil...@openroadsconsulting.com wrote: From: McIlwee, Craig craig.mcil...@openroadsconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 7:49 AM There's a good reason that markup ID doesn't match wicket ID. If I have a panel with a few form components, and then put 2 of those panels on the same page, then your approach would break things like document.getElementId(...) because there would be more than 1 element w/ same ID. Craig _ From: David Chang [mailto:david_q_zh...@yahoo.com] To: users@wicket.apache.org Sent: Mon, 29 Mar 2010 21:03:46 -0400 Subject: Re: better way setting up ID for a Wicket component? Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: better way setting up ID for a Wicket component?
Boris, thanks for sharing your thoughts: IDs are needed for e.g. AJAX functionality. I cannot agree on this. In the context of wicket for the web framework, you actually dont need to create ID. Let Wicket to create whatever ID wicket deems right. In my understanding, and actually in my case that initiated this thread, is to style certain elements and I hope to have meaningful markup IDs. I have meaningful wicket IDs in my case, and I simply want to do the same for markup IDs. Thanks, David --- On Tue, 3/30/10, Boris Goldowsky bgoldow...@cast.org wrote: From: Boris Goldowsky bgoldow...@cast.org Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Tuesday, March 30, 2010, 5:06 PM IDs are needed for e.g. AJAX functionality. The default Wicket implementation of markup IDs will create them smartly, never creating duplicate ids even in the case of multiple instances of panels, repeaters, etc. As I understand Wicket best practice, it is never to call setMarkupId() at all, and just let the smart default thing happen. If you *must* call it because you have some special requirement for particular IDs, then you take on the responsibility for making sure your IDs are unique yourself. In this light, a setMarkupIdToWicketId() method is a dangerous thing. Bng David Chang wrote: Craig, I really appreciate your input. If a panel is reused more than one time on the same page, then the panel's components should not use IDs in the first place. It would always violate valid HTML. Correct? Regards. - 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
Can I prevent Wicket from overwriting my markup IDs?
I am new in wicket. Just wanted to verify my understanding is right or not. If I have the following HTML: span id=hello wicket:id=helloworldsample text/span Does Wicket (as of version 1.4.7) always overwrite my markup ID? If not, what is the way of stoping Wicket doing that (i.e., keep my original markup id)? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
better way setting up ID for a Wicket component?
Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: better way setting up ID for a Wicket component?
Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.comwrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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: better way setting up ID for a Wicket component?
Using an external helper should do the trick, but it feels not so natural as a convenince method as mentioned in my previous email. Would it be possible for such a method make its way into a future release? Regards. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 9:07 PM You could make your own helper method that sets both to the same thing and returns the component. Just modify what I sent earlier. On Mon, Mar 29, 2010 at 9:03 PM, David Chang david_q_zh...@yahoo.comwrote: Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.com wrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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: better way setting up ID for a Wicket component?
I just created a JIRA before you replied. https://issues.apache.org/jira/browse/WICKET-2809 I understand your concern, but I dont fully agree with you. As you know, less and clean coding is always a good thing and best to be the part of the tool. Regards. --- On Mon, 3/29/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 10:32 PM im letting you know. we dont need to litter the public api with such trivial methods, the api has a large surface area as it is. i am sure as you code more with wicket you will find another 30 such trivial methods that will be useful to you, this is what static imports are for. -igor On Mon, Mar 29, 2010 at 6:18 PM, James Carman jcar...@carmanconsulting.com wrote: Perhaps. File a JIRA report (https://issues.apache.org/jira/browse/WICKET) and ask for it as a New Feature. If the core developers don't like the idea, I'm sure they'll let you know. :) On Mon, Mar 29, 2010 at 9:13 PM, David Chang david_q_zh...@yahoo.comwrote: Using an external helper should do the trick, but it feels not so natural as a convenince method as mentioned in my previous email. Would it be possible for such a method make its way into a future release? Regards. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 9:07 PM You could make your own helper method that sets both to the same thing and returns the component. Just modify what I sent earlier. On Mon, Mar 29, 2010 at 9:03 PM, David Chang david_q_zh...@yahoo.com wrote: Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.com wrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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 - 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: better way setting up ID for a Wicket component?
Well, it is not bad to tell people what you believe is right:) We are wicket programmers, aren't we? :) Feel good to say what I wanted to say and thanks for the initial JIRA idea --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 11:06 PM See...told you. :) On Mon, Mar 29, 2010 at 10:32 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: im letting you know. we dont need to litter the public api with such trivial methods, the api has a large surface area as it is. i am sure as you code more with wicket you will find another 30 such trivial methods that will be useful to you, this is what static imports are for. -igor On Mon, Mar 29, 2010 at 6:18 PM, James Carman jcar...@carmanconsulting.com wrote: Perhaps. File a JIRA report ( https://issues.apache.org/jira/browse/WICKET) and ask for it as a New Feature. If the core developers don't like the idea, I'm sure they'll let you know. :) On Mon, Mar 29, 2010 at 9:13 PM, David Chang david_q_zh...@yahoo.com wrote: Using an external helper should do the trick, but it feels not so natural as a convenince method as mentioned in my previous email. Would it be possible for such a method make its way into a future release? Regards. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 9:07 PM You could make your own helper method that sets both to the same thing and returns the component. Just modify what I sent earlier. On Mon, Mar 29, 2010 at 9:03 PM, David Chang david_q_zh...@yahoo.com wrote: Not sure whether the help method will do the trick of one-liner code. I feel that it would be much nice if Wicket could have the following additional method for a Componment: Component setMarkupIdToWicketId(). Re-using a Wicket Id as markup id as convention should be best practice. Am I right? I am new in wicket and sorry if I am wrong. Best. --- On Mon, 3/29/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: better way setting up ID for a Wicket component? To: users@wicket.apache.org Date: Monday, March 29, 2010, 7:16 PM helper method? protected T extends Component T setMarkupId(T component, String markupId) { component.setMarkupId(markupId); return component; } On Mon, Mar 29, 2010 at 7:00 PM, David Chang david_q_zh...@yahoo.com wrote: Here is what I am using the follow pattern to set up ID for a wicket component: Label abc = new Label(abcd, abcdedfg); abc.setOutputMarkupId(true).setMarkupId(abc.getId()); It takes two lines to do this. Can I do something like Label abc = new Label(abcd, abcdedfg).setOutputMarkupId(true).setMarkupId(???); Is this doable? If yes, then what should go to replace ??? Thanks! - 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 - 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
How to customize FormComponentFeedbackBorder's error indicator
I would like to replace the default indicator asterisk with an image. How can I do it? What is the most elegant way? Thanks for any info or pointer. All the best, David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Prevent messages from being displayed in FeedbackPanel if displayed in ComponentFeedbackPanel
I have a page which has a FeedbackPanel for collecting and displaying messages. On this page there is also a form. I use ComponentFeedbackPanel to display any validation error messages for fields. When a validation error happens, it ends up being displayed in both FeedbackPanel and ComponentFeedbackPanel. I wish to control the message diplay like this: If a message is displayed in ComponentFeedbackPanel, it will not be displayed again in FeedbackPanel. Is this doable? Any ideas of how do this? Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to put a validation error message near its field?
FeedbackPanel is great in in terms of gathering messages in a central place. But I saw many great sites have messages near their fields. How can we do this in Wicket? Thank in advance for any info or pointer! Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to put a validation error message near its field?
Jame, thanks for quick reply on a Saturday evening.. Exactly what I want. Best, David --- On Sat, 3/27/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: How to put a validation error message near its field? To: users@wicket.apache.org Date: Saturday, March 27, 2010, 10:19 PM http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/panel/ComponentFeedbackPanel.html On Sat, Mar 27, 2010 at 10:11 PM, David Chang david_q_zh...@yahoo.comwrote: FeedbackPanel is great in in terms of gathering messages in a central place. But I saw many great sites have messages near their fields. How can we do this in Wicket? Thank in advance for any info or pointer! Regards. - 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
How to provide a value to a message's argument
HTML: span wicket:id=x[sample text]/span Java: add(new Label(x, new ResourceModel(x))); Resource file: entry key=xHello ${label} !/entry In the above Java, I cannot find a way to provide a value to the argument of the string. I want the program to display Hello David! Hello Carmen! Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to provide a value to a message's argument
Igor, thanks for the info. It worked for me. Just a suggestion. Hope to see a convenience constructor such as: StringResourceModel(resourceKey, java.lang.Object[] parameters) In which, model is null. IMHO, Spring has many convenience methods. It would be good to see Wicket does the same (maybe already does it, but I dont know about). Regards. --- On Wed, 3/24/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: How to provide a value to a message's argument To: users@wicket.apache.org Date: Wednesday, March 24, 2010, 11:49 PM see StringResourceModel -igor On Wed, Mar 24, 2010 at 8:42 PM, David Chang david_q_zh...@yahoo.com wrote: HTML: span wicket:id=x[sample text]/span Java: add(new Label(x, new ResourceModel(x))); Resource file: entry key=xHello ${label} !/entry In the above Java, I cannot find a way to provide a value to the argument of the string. I want the program to display Hello David! Hello Carmen! Regards. - 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
Reload a page and component repaint
I am new in Wicket and so please bear with me if this question is obvious. Suppose I am viewing a Wicket page in FF. At the moment, the link is: http://localhost:8080/f/?wicket:interface=:12 If I click the Reload button of FF, isn't Wicket supposed to call EACH component to repaint itself based on its model value? If not, then what are the circumstances to prevent a component from repainting itself? How can I force a component get repainted. Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reload a page and component repaint
it does, but maybe the model value is unchanged If the model value is unchanged, the component will repaint itself or not? Best, David --- On Tue, 3/23/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Reload a page and component repaint To: users@wicket.apache.org Date: Tuesday, March 23, 2010, 10:24 PM On Tue, Mar 23, 2010 at 7:13 PM, David Chang david_q_zh...@yahoo.com wrote: I am new in Wicket and so please bear with me if this question is obvious. Suppose I am viewing a Wicket page in FF. At the moment, the link is: http://localhost:8080/f/?wicket:interface=:12 If I click the Reload button of FF, isn't Wicket supposed to call EACH component to repaint itself based on its model value? it does, but maybe the model value is unchanged -igor If not, then what are the circumstances to prevent a component from repainting itself? How can I force a component get repainted. Thanks! - 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 has too much control?
); } /** * @param id * @param choices */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, IModelList? extends T choices) { super(id, choices); } /** * @param id * @param model * @param choices * @param renderer */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, IModelT model, IModelList? extends T choices, IChoiceRendererT renderer) { super(id, model, choices, renderer); } /** * @param id * @param model * @param choices */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, IModelT model, IModelList? extends T choices) { super(id, model, choices); } /** * @param id * @param model * @param data * @param renderer */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, IModelT model, List? extends T data, IChoiceRendererT renderer) { super(id, model, data, renderer); } /** * @param id * @param model * @param choices */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, IModelT model, List? extends T choices) { super(id, model, choices); } /** * @param id * @param data * @param renderer */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, List? extends T data, IChoiceRendererT renderer) { super(id, data, renderer); } /** * @param id * @param choices */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id, List? extends T choices) { super(id, choices); } /** * @param id */ public AjaxFormSubmittingChangeListenerDropDownChoice(String id) { super(id); } } ** Martin 2010/3/21 Sven Meier s...@meiers.net: David, It seems that you do not understand the problem I have obviously not ;). A quickstart would help me to understand your problem better, but perhaps others have already a clue? Sven David Chang wrote: Sven, Thanks for your input. It seems that you do not understand the problem I have (Wicket problem??? or my page problem???). I know how Ajax works by adding components to Ajax request target. When it is non-Ajax, my page runs correctly with all three controls. When Country DDC Ajax-controls State DDC, the two DDC works correctly. The problem is that once this Ajax control is triggered by selecting a value in Country DDC, the State DDC list is NOT updated when the Locale DDC value is changed. I have a feel that Wicket has a problem here. I am using Wicket 1.4.7. Regards. -David --- On Sun, 3/21/10, Sven Meier s...@meiers.net wrote: From: Sven Meier s...@meiers.net Subject: Re: Ajax has too much control? To: users@wicket.apache.org Date: Sunday, March 21, 2010, 7:25 AM Hi David, DropDownChoice#wantOnSelectionChangedNotifications() will trigger rendering of the complete page. On Ajax request only those components are rendered you explicitely 'add' to the request, see AjaxRequestTarget#addComponent(). If you want to have the same for Ajax requests, you can just 'add' the complete page. This is not very efficient though. Sven David Chang wrote: Forgive me about this meaningless subject, but I cannot think of a better one. I have been learning Wicket through the WIA book. I just found out something interesting to me. Not sure it is a bug, design, or something I did wrong. I have a page with three Wicket elements: 1. Locale selector through a DropDownChoice list. WIA has complete code about how this works and I copied the solution into this page 2. Country DropDownChoice, whose values change between English and Chinese depending on Locale DDC. 3. State DropDownChoice, whose values change between English and Chinese depending on Locale DDC. The values in this DDC depends on the chosen value in Country DDC. Here are the experiments Experiment#1. Country DDC does not control values in State DDC via Ajax and it has protected boolean wantOnSelectionChangedNotifications() { return true; } Everything works like a charm, which means (1) when Country DDC value changes, State DDC changes accodingly. (2) when Locale changes, both Country DDC and State DDC lists change display values accordingly (which means both DDCs show a list of values in the same language). Experiment#2. Country DDC controls values in State DDC via Ajax. In this case, when page is first loaded, I do not touch the Country DDC or State DDC. I simply change locale value any number of times, both Country DDC and State DDC lists change correctly depending on the session locale. Here is the strange thing. Then I change Country DDC value, State DDC changes correctly. Since
Reasons against using Acegi with Wicket?
Hello, I am learning Wicekt via the book WIA and I understand that Wicket has its own way (interfaces, components, sub-projects) of handling web security. I am thinking about using Acegi with Wicket. The reason is that I am familiar with Acegi, but I hope I am not going to do the wrong thing within the Wicket context. I would like to know any big or obvious reasons against that. Thanks for your input! Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reasons against using Acegi with Wicket?
James, I did read some of your code for clues regarding how to program Wicket. Glad to know that it even has Acegi integration there!!! Best, David --- On Mon, 3/22/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: Reasons against using Acegi with Wicket? To: users@wicket.apache.org Date: Monday, March 22, 2010, 8:29 AM David, My example application I pointed out to you contains a Spring Security (formerly Acegi) configuration for Wicket (with a superclass for the application/session). That should help get you off the ground quickly if you want to go with Spring Security. James On Mon, Mar 22, 2010 at 8:15 AM, David Chang david_q_zh...@yahoo.com wrote: Hello, I am learning Wicekt via the book WIA and I understand that Wicket has its own way (interfaces, components, sub-projects) of handling web security. I am thinking about using Acegi with Wicket. The reason is that I am familiar with Acegi, but I hope I am not going to do the wrong thing within the Wicket context. I would like to know any big or obvious reasons against that. Thanks for your input! Regards. - 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 has too much control?
Martin, I tried your approach it will not be working for me. Because I am going to add other required fields before or after the two dropdown list. Using AjaxFormSubmitBehavior would likely cause validation errors all the time. Besides, AjaxFormComponentUpdatingBehavior should be what I need: redraw part of a web page via Ajax without submitting a form. Thank YOU for your help! All the best, David --- On Mon, 3/22/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Ajax has too much control? To: users@wicket.apache.org Date: Monday, March 22, 2010, 10:52 AM Hi! If you redraw something, you need to submit the form values, otherwise the redrawn state is different... if that's your case. ** Martin 2010/3/22 David Chang david_q_zh...@yahoo.com: Hello Martin, Thanks for your input and sharing your code! I will give it a try. Did you have the same problem I have now? Here is what I have for the Country DDC: countryDDC.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { if (target != null) { MyUser u = form.getModelObject(); u.setState(null); DropDownChoice stateDDC = (DropDownChoice) form.get(state); stateDDC.setChoices(objectService.findStatesForLocale(getSession().getLocale())); target.addComponent(countryDDC); target.addComponent(stateDDC); } } }); As you can see, I am using AjaxFormComponentUpdatingBehavior. Why do you use AjaxFormSubmitBehavior? In my case, I am not submitting a form. I am new in Wicket. Thanks for your help! Best. -David --- On Sun, 3/21/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Ajax has too much control? To: users@wicket.apache.org Date: Sunday, March 21, 2010, 11:38 AM Hi David! Maybe you need this (at least this is what worked for me): /** * @author Martin */ public abstract class AjaxFormSubmittingChangeListenerBehavior extends AjaxFormSubmitBehavior { private final static Method hiddenFieldGetter; static { try { hiddenFieldGetter = Form.class.getDeclaredMethod(getHiddenFieldId); hiddenFieldGetter.setAccessible(true); } catch (Exception e) { throw new RuntimeException(e); } } /** * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#onBind() */ @Override protected void onBind() { super.onBind(); if (!(getComponent() instanceof IOnChangeListener)) { throw new WicketRuntimeException(Behavior + getClass().getName() + can only be added to an instance of a IOnChangeListener); } } /** * @param event */ public AjaxFormSubmittingChangeListenerBehavior(String event) { super(event); } /** * @see org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onError(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onError(AjaxRequestTarget target) { onSubmit(target); } /** * @see org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onEvent(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onEvent(AjaxRequestTarget target) { HttpServletRequest httpServletRequest = ((WebRequest) getComponent() .getRequest()).getHttpServletRequest(); Map parameters; if (httpServletRequest instanceof MockHttpServletRequest) { parameters = ((MockHttpServletRequest) httpServletRequest).getParameterMap(); } else { parameters = ((org.mortbay.jetty.Request) httpServletRequest).getParameters(); } parameters.put(getHiddenFieldId(getForm()), getComponent().urlFor(IOnChangeListener.INTERFACE)); final FormComponent? formComponent = (FormComponent?) getComponent(); try { if (isUpdateModel()) { formComponent.inputChanged(); formComponent.validate(); if (!formComponent.hasErrorMessage()) { formComponent.valid(); formComponent.updateModel(); } } super.onEvent(target); } catch (RuntimeException e) { Utils.errorLog(AjaxFormSubmittingChangeListenerBehavior.class, e); onError(target); } } /** * @return boolean */ protected boolean isUpdateModel() { return true; } /** * @param form * @return String */ private String getHiddenFieldId(Form? form) { try { Form? root = form.getRootForm(); return (String) hiddenFieldGetter.invoke(root); } catch (Exception e) { throw new RuntimeException(e); } } } public abstract class
Re: Ajax has too much control?
Sven, Thanks for your input. It seems that you do not understand the problem I have (Wicket problem??? or my page problem???). I know how Ajax works by adding components to Ajax request target. When it is non-Ajax, my page runs correctly with all three controls. When Country DDC Ajax-controls State DDC, the two DDC works correctly. The problem is that once this Ajax control is triggered by selecting a value in Country DDC, the State DDC list is NOT updated when the Locale DDC value is changed. I have a feel that Wicket has a problem here. I am using Wicket 1.4.7. Regards. -David --- On Sun, 3/21/10, Sven Meier s...@meiers.net wrote: From: Sven Meier s...@meiers.net Subject: Re: Ajax has too much control? To: users@wicket.apache.org Date: Sunday, March 21, 2010, 7:25 AM Hi David, DropDownChoice#wantOnSelectionChangedNotifications() will trigger rendering of the complete page. On Ajax request only those components are rendered you explicitely 'add' to the request, see AjaxRequestTarget#addComponent(). If you want to have the same for Ajax requests, you can just 'add' the complete page. This is not very efficient though. Sven David Chang wrote: Forgive me about this meaningless subject, but I cannot think of a better one. I have been learning Wicket through the WIA book. I just found out something interesting to me. Not sure it is a bug, design, or something I did wrong. I have a page with three Wicket elements: 1. Locale selector through a DropDownChoice list. WIA has complete code about how this works and I copied the solution into this page 2. Country DropDownChoice, whose values change between English and Chinese depending on Locale DDC. 3. State DropDownChoice, whose values change between English and Chinese depending on Locale DDC. The values in this DDC depends on the chosen value in Country DDC. Here are the experiments Experiment#1. Country DDC does not control values in State DDC via Ajax and it has protected boolean wantOnSelectionChangedNotifications() { return true; } Everything works like a charm, which means (1) when Country DDC value changes, State DDC changes accodingly. (2) when Locale changes, both Country DDC and State DDC lists change display values accordingly (which means both DDCs show a list of values in the same language). Experiment#2. Country DDC controls values in State DDC via Ajax. In this case, when page is first loaded, I do not touch the Country DDC or State DDC. I simply change locale value any number of times, both Country DDC and State DDC lists change correctly depending on the session locale. Here is the strange thing. Then I change Country DDC value, State DDC changes correctly. Since then, HOWEVER, if I change locale values, ONLY Country DDC list changes correctly; State DDC list is not updated. It seems Wicket decides that State DDC is forever Aja-controlled by Country DDC only. Not qure sure if this a bug, design, or I did something wrong. Please let me if you have difficulty understanding the experiments. Thanks for any info or help. Cheers! - 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
two LDM DropDownChoice behave differently ?
Hello, I am playing Wicket now and came across this strange behavior. I have a page with two LDM-based DropDownChoice (Country and State). The Country DDC ajax-controls the State DDC. The Ajax works well. Here is something I dont understand. When the page is diplayed first time, both LDM#load get called. If dont play with the DDCs, and simply refresh the page, both LDM#load get called. If I just select values in the Contry DDC without touch the State DDC (I can see State DDC values changes when Country DDC value change) and I referesh the page, only the Country LDM#load gets called. What happened to State DDC? Shouldn't it's LDM#load gets called each time when page refereshes? It is really puzzle to me. Googled, but no clue. I am pulling my hairs now... Thanks for any help!!! If I refresh page, I notice that Country State - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajax has too much control?
Forgive me about this meaningless subject, but I cannot think of a better one. I have been learning Wicket through the WIA book. I just found out something interesting to me. Not sure it is a bug, design, or something I did wrong. I have a page with three Wicket elements: 1. Locale selector through a DropDownChoice list. WIA has complete code about how this works and I copied the solution into this page 2. Country DropDownChoice, whose values change between English and Chinese depending on Locale DDC. 3. State DropDownChoice, whose values change between English and Chinese depending on Locale DDC. The values in this DDC depends on the chosen value in Country DDC. Here are the experiments Experiment#1. Country DDC does not control values in State DDC via Ajax and it has protected boolean wantOnSelectionChangedNotifications() { return true; } Everything works like a charm, which means (1) when Country DDC value changes, State DDC changes accodingly. (2) when Locale changes, both Country DDC and State DDC lists change display values accordingly (which means both DDCs show a list of values in the same language). Experiment#2. Country DDC controls values in State DDC via Ajax. In this case, when page is first loaded, I do not touch the Country DDC or State DDC. I simply change locale value any number of times, both Country DDC and State DDC lists change correctly depending on the session locale. Here is the strange thing. Then I change Country DDC value, State DDC changes correctly. Since then, HOWEVER, if I change locale values, ONLY Country DDC list changes correctly; State DDC list is not updated. It seems Wicket decides that State DDC is forever Aja-controlled by Country DDC only. Not qure sure if this a bug, design, or I did something wrong. Please let me if you have difficulty understanding the experiments. Thanks for any info or help. Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic Image (aka Barcode) based on user input not refreshed via Ajax
Exactly. That is what eventually I found out after quite some time fruitless research and test in other areas. --- On Fri, 3/19/10, Igor Vaynberg igor.vaynb...@gmail.com wrote: From: Igor Vaynberg igor.vaynb...@gmail.com Subject: Re: Dynamic Image (aka Barcode) based on user input not refreshed via Ajax To: users@wicket.apache.org, Doug Leeper douglee...@yahoo.com Date: Friday, March 19, 2010, 12:56 PM use NonCachingImage -igor On Fri, Mar 19, 2010 at 9:47 AM, Doug Leeper douglee...@yahoo.com wrote: I am trying to create a barcode image from a user entered value. The image is to be updated while the user types. Hence I am using Ajax (onChange event) on the text field to regenerate the image. However, the image is not getting refreshed. It appears that the browser is not recognizing that the image has been updated. Is there a way to append a timestamp on the image url just for this image? or should I use a different type of resource? Note: the value entered has not be persisted so I don't believe I can a ResourceReference. Please correct me if I am wrong. Thanks - Doug BTW...Here is my code that I am using to generate the bar code: barCodeValueContainer = new WebMarkupContainer(barCodeValueContainer) { �...@override public void onBeforeRender() { if (coupon.getObject().getBarCodeType() == null) { codeContainer.replace(new WebMarkupContainer(barCode)); } else if (barCodeErrorMessage == null) { codeContainer.replace(new BarCodeFragment(barCode, this)); } else { codeContainer.replace(new ErrorFragment(barCode, this, barCodeErrorMessage)); } super.onBeforeRender(); } public boolean isVisible() { return coupon.getObject().getBarCodeType() != null; } }; private class BarCodeFragment extends Fragment { public BarCodeFragment(String id, MarkupContainer markupProvider) { super(id, barCodeFragment, markupProvider); setRenderBodyOnly(true); // Create the barcode bean String barCodeType = coupon.getObject().getBarCodeType(); String barCodeValue = coupon.getObject().getBarCodeValue(); AbstractBarcodeBean bean = null; if (barCodeType.equals(BarCodeType.CODE_39.id())) { bean = new Code39Bean(); // bar width exactly one pixel ((Code39Bean) bean).setWideFactor(3); } else if (barCodeType.equals(BarCodeType.CODE_128.id())) { bean = new Code128Bean(); } else if (barCodeType.equals(BarCodeType.UPC_A.id())) { bean = new UPCABean(); } if (bean == null || barCodeValue == null) { add(new ErrorFragment(barCode, CouponDetailEditPanel.this, Bar code value not set)); } else { final int dpi = 150; // Configure the barcode generator bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); // makes the // narrow bean.doQuietZone(false); // Open output file ByteArrayOutputStream out = new ByteArrayOutputStream(); try { // Set up the canvas provider for monochrome PNG output BitmapCanvasProvider canvas = new BitmapCanvasProvider(out, image/png, dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0); // Generate the barcode bean.generateBarcode(canvas, barCodeValue); System.out.println(VALUE: + barCodeValue); // Signal end of generation canvas.finish(); out.close(); final byte[] content = out.toByteArray(); Image img = new Image(barCode, new BarCodeImageResource( content)); add(img); } catch (Exception e) { add(new ErrorFragment(barCode, CouponDetailEditPanel.this, e.getMessage())); } } } } private class BarCodeImageResource extends DynamicImageResource { private byte[] content; public BarCodeImageResource(byte[] content) { super(image/png); this.content = content; this.setLastModifiedTime(Time.now()); } �...@override protected byte[] getImageData() { return content; } }
Re: JCaptcha sound with Wicket?
Anybody ever got this working? Thanks for any info or ponter. Regards. --- On Thu, 3/18/10, David Chang david_q_zh...@yahoo.com wrote: From: David Chang david_q_zh...@yahoo.com Subject: JCaptcha sound with Wicket? To: users@wicket.apache.org Date: Thursday, March 18, 2010, 11:31 PM Based on the WIA book, I am able to have a working example of JCaptcha image. I am hoping to get JCaptcha sound working too. I tried different ways, but unable to get it working. Did anyone get JCaptcha sound working with Wicket? Could you please share your config and code? Thanks for any input! Best. - 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
Select the Choose one of a required DropDownChoice
Hi, I am new in Wicket and am playing with different components. I have a two dropdown lists. One is a list of countries, required field, controlling another list of states/provinces via AjaxFormComponentUpdatingBehavior. The country list always has a blank (equivalent of Choose one) as the first option in the list. When I select different countries, the state/province list changes accordingly. However, when I change to the blank in the country list, the state list stops updating. I looked into it and found out that in this situation (required droopdown list) selecting blank makes Wicket issue a feedback message instead of calling AjaxFormComponentUpdatingBehavior#onUpdate, which is what I want. What can I do to make Wicket the way I want? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Make FeedbackPanel occupy zero space when having no messages?
Hello, I am playing with FeedbackPanel. I put it in a page like this: div wicket:id=feedbackHolder / I notice that when having no messages, it always take up some space. How can I make FeedbackPanel occupy zero space when having no messages? Wicket way? or CSS? Any help is really appreciated. Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Select the Choose one of a required DropDownChoice
Matt, I already did that. DropDownChoice.setNullValid() makes Choose one always stay there. I notice that DropDownChoice.setRequired() is the reason to generate the message and not get onUpdate called. Thanks. --- On Thu, 3/18/10, Matthias Keller matthias.kel...@ergon.ch wrote: From: Matthias Keller matthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:30 AM Hi Have a look at DropDownChoice.setNullValid() and .setRequired() Matt On 2010-03-18 14:26, David Chang wrote: Hi, I am new in Wicket and am playing with different components. I have a two dropdown lists. One is a list of countries, required field, controlling another list of states/provinces via AjaxFormComponentUpdatingBehavior. The country list always has a blank (equivalent of Choose one) as the first option in the list. When I select different countries, the state/province list changes accordingly. However, when I change to the blank in the country list, the state list stops updating. I looked into it and found out that in this situation (required droopdown list) selecting blank makes Wicket issue a feedback message instead of calling AjaxFormComponentUpdatingBehavior#onUpdate, which is what I want. What can I do to make Wicket the way I want? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Select the Choose one of a required DropDownChoice
In my case, the field is required. I make it required by setRequired(true), but I want the blank/choose one is still there. Doable? --- On Thu, 3/18/10, Matthias Keller matthias.kel...@ergon.ch wrote: From: Matthias Keller matthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:42 AM Hi Yes, exactly, but why do you have it set to required at all in first place if you want to allow the empty selection too? I dont think a DropDownChoice is required by default but if it is, try setRequired(false) ... Matt On 2010-03-18 14:36, David Chang wrote: Matt, I already did that. DropDownChoice.setNullValid() makes Choose one always stay there. I notice that DropDownChoice.setRequired() is the reason to generate the message and not get onUpdate called. Thanks. --- On Thu, 3/18/10, Matthias Kellermatthias.kel...@ergon.ch wrote: From: Matthias Kellermatthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:30 AM Hi Have a look at DropDownChoice.setNullValid() and .setRequired() Matt On 2010-03-18 14:26, David Chang wrote: Hi, I am new in Wicket and am playing with different components. I have a two dropdown lists. One is a list of countries, required field, controlling another list of states/provinces via AjaxFormComponentUpdatingBehavior. The country list always has a blank (equivalent of Choose one) as the first option in the list. When I select different countries, the state/province list changes accordingly. However, when I change to the blank in the country list, the state list stops updating. I looked into it and found out that in this situation (required droopdown list) selecting blank makes Wicket issue a feedback message instead of calling AjaxFormComponentUpdatingBehavior#onUpdate, which is what I want. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Select the Choose one of a required DropDownChoice
Martin, thanks for chimining in. I already did that. The problem is when I select null (choose one), AjaxFormComponentUpdatingBehavior#onUpdate is not called. Instead, Wicket generates a message and tries to seed it FeedbackPanel. I want to be able to handle that null and set another dropdown list blank. Regards. --- On Thu, 3/18/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 10:58 AM setNullValid 2010/3/18 David Chang david_q_zh...@yahoo.com: In my case, the field is required. I make it required by setRequired(true), but I want the blank/choose one is still there. Doable? --- On Thu, 3/18/10, Matthias Keller matthias.kel...@ergon.ch wrote: From: Matthias Keller matthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:42 AM Hi Yes, exactly, but why do you have it set to required at all in first place if you want to allow the empty selection too? I dont think a DropDownChoice is required by default but if it is, try setRequired(false) ... Matt On 2010-03-18 14:36, David Chang wrote: Matt, I already did that. DropDownChoice.setNullValid() makes Choose one always stay there. I notice that DropDownChoice.setRequired() is the reason to generate the message and not get onUpdate called. Thanks. --- On Thu, 3/18/10, Matthias Kellermatthias.kel...@ergon.ch wrote: From: Matthias Kellermatthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:30 AM Hi Have a look at DropDownChoice.setNullValid() and .setRequired() Matt On 2010-03-18 14:26, David Chang wrote: Hi, I am new in Wicket and am playing with different components. I have a two dropdown lists. One is a list of countries, required field, controlling another list of states/provinces via AjaxFormComponentUpdatingBehavior. The country list always has a blank (equivalent of Choose one) as the first option in the list. When I select different countries, the state/province list changes accordingly. However, when I change to the blank in the country list, the state list stops updating. I looked into it and found out that in this situation (required droopdown list) selecting blank makes Wicket issue a feedback message instead of calling AjaxFormComponentUpdatingBehavior#onUpdate, which is what I want. - 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: Select the Choose one of a required DropDownChoice
Martin, the following is the code for the country dropdown list, which can control the state dropdown list. The problem is that when the country list's value is switched to null from a selected country (say, USA), then the state dropdown list does not update. In addition, Wicket in the backend has the following message. Another puzzling thing to me is that my FeedbackPanel is there as defined below. --- message 18:38:20,890 WARN WebSession:193 - Component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page. Message: [FeedbackMessage message = Field 'Country' is required., reporter = country, level = ERROR] --- dropdown list code --- ListCountry countryList = objectService.findAllCountries(); DropDownChoice countryDDC = new DropDownChoice(country, countryList, new ChoiceRenderer(name, id) ); countryDDC.setRequired(true); countryDDC.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { if (target != null) { MyUser u = f.getModelObject(); u.setState(null); DropDownChoice stateDDC = (DropDownChoice) f.get(state); stateDDC.setChoices(objectService.findStatesByCountry(f.getModelObject().getCountry())); target.addComponent(stateDDC); } } }); f.add(new FormComponentFeedbackBorder(borderCountry).add(countryDDC)); -- FeedbackPanel code add(new FeedbackPanel(feedbackHolder) { @Override public boolean isVisible() { return true;//anyMessage(); } }.setOutputMarkupId(true)); --- On Thu, 3/18/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 11:50 AM Code? 2010/3/18 David Chang david_q_zh...@yahoo.com: Martin, thanks for chimining in. I already did that. The problem is when I select null (choose one), AjaxFormComponentUpdatingBehavior#onUpdate is not called. Instead, Wicket generates a message and tries to seed it FeedbackPanel. I want to be able to handle that null and set another dropdown list blank. Regards. --- On Thu, 3/18/10, Martin Makundi martin.maku...@koodaripalvelut.com wrote: From: Martin Makundi martin.maku...@koodaripalvelut.com Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 10:58 AM setNullValid 2010/3/18 David Chang david_q_zh...@yahoo.com: In my case, the field is required. I make it required by setRequired(true), but I want the blank/choose one is still there. Doable? --- On Thu, 3/18/10, Matthias Keller matthias.kel...@ergon.ch wrote: From: Matthias Keller matthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:42 AM Hi Yes, exactly, but why do you have it set to required at all in first place if you want to allow the empty selection too? I dont think a DropDownChoice is required by default but if it is, try setRequired(false) ... Matt On 2010-03-18 14:36, David Chang wrote: Matt, I already did that. DropDownChoice.setNullValid() makes Choose one always stay there. I notice that DropDownChoice.setRequired() is the reason to generate the message and not get onUpdate called. Thanks. --- On Thu, 3/18/10, Matthias Kellermatthias.kel...@ergon.ch wrote: From: Matthias Kellermatthias.kel...@ergon.ch Subject: Re: Select the Choose one of a required DropDownChoice To: users@wicket.apache.org Date: Thursday, March 18, 2010, 9:30 AM Hi Have a look at DropDownChoice.setNullValid() and .setRequired() Matt On 2010-03-18 14:26, David Chang wrote: Hi, I am new in Wicket and am playing with different components. I have a two dropdown lists. One is a list of countries, required field, controlling another list of states/provinces via AjaxFormComponentUpdatingBehavior. The country list always has a blank (equivalent of Choose one) as the first option in the list. When I select different countries, the state/province list changes accordingly. However, when I change to the blank in the country list, the state list stops updating. I looked into it and found out that in this situation (required droopdown list) selecting blank makes Wicket issue a feedback message instead of calling
JCaptcha sound with Wicket?
Based on the WIA book, I am able to have a working example of JCaptcha image. I am hoping to get JCaptcha sound working too. I tried different ways, but unable to get it working. Did anyone get JCaptcha sound working with Wicket? Could you please share your config and code? Thanks for any input! Best. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Replace Choose one from DropDownChoice?
Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements: 1. Replace Choose one with a blank line 2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not. 3. I am using ChoiceRenderer to convert between selection and objects. 4. This behavior is applicable to all DropDownChoice. How can meet these requirement? Thanks for your help! Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Replace Choose one from DropDownChoice?
Martin, Thanks so much for chiming in. I tried the null= approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not. Again, thanks for help! Best, David --- On Wed, 3/17/10, Martin Asenov mase...@velti.com wrote: From: Martin Asenov mase...@velti.com Subject: RE: Replace Choose one from DropDownChoice? To: users@wicket.apache.org users@wicket.apache.org Date: Wednesday, March 17, 2010, 9:08 AM Hi, David! Let's presume your webapplication class is called WebApp.java. In the same directory where it is present, create WebApp.properties with the following line: null= that way every single 'choose one' label will be replaced with . P.S. Don't forget to include the props files in the pom as a resource. Best, Martin -Original Message- From: David Chang [mailto:david_q_zh...@yahoo.com] Sent: Wednesday, March 17, 2010 3:03 PM To: users@wicket.apache.org Subject: Replace Choose one from DropDownChoice? Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements: 1. Replace Choose one with a blank line 2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not. 3. I am using ChoiceRenderer to convert between selection and objects. 4. This behavior is applicable to all DropDownChoice. How can meet these requirement? Thanks for your help! Regards. - 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: Replace Choose one from DropDownChoice?
Martin, According to what you said, do I need to add special processing in ChoiceRenderer if this blank line is the selected and I need to convert selected value to object? Thanks, David --- On Wed, 3/17/10, Martin Phee mp...@objectivearts.com wrote: From: Martin Phee mp...@objectivearts.com Subject: Re: Replace Choose one from DropDownChoice? To: users@wicket.apache.org Date: Wednesday, March 17, 2010, 10:05 AM You have to add a selection choice that is just a blank line option. This is a typical requirement for any dropdown if you wan the use to be able to clear their choice. On Mar 17, 2010, at 8:47 AM, David Chang wrote: Martin, Thanks so much for chiming in. I tried the null= approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not. Again, thanks for help! Best, David --- On Wed, 3/17/10, Martin Asenov mase...@velti.com wrote: - 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: SV: Replace Choose one from DropDownChoice?
I tried this one. It works. Summarized what I did based on input from folks here: 1. set null = in property file (remove properties file) 2. call setNullValid(true) on the DropDownChoice object. Thanks for help!!! Regards. --- On Wed, 3/17/10, Wilhelmsen Tor Iver toriv...@arrive.no wrote: From: Wilhelmsen Tor Iver toriv...@arrive.no Subject: SV: Replace Choose one from DropDownChoice? To: users@wicket.apache.org users@wicket.apache.org Date: Wednesday, March 17, 2010, 10:23 AM Also setNullValid(true) otherwise the blank option will disappear once you have made a choice or the model has a value. - Tor I. -Opprinnelig melding- Fra: Martin Asenov [mailto:mase...@velti.com] Sendt: 17. mars 2010 15:23 Til: users@wicket.apache.org Emne: RE: Replace Choose one from DropDownChoice? I don't understand , Chang... If you want non selection to be , then say null= (without the quotes) Otherwise if you don't want null selection, you say component.setNullValid(false); and you're fine Best, Martin -Original Message- From: David Chang [mailto:david_q_zh...@yahoo.com] Sent: Wednesday, March 17, 2010 3:48 PM To: users@wicket.apache.org Subject: RE: Replace Choose one from DropDownChoice? Martin, Thanks so much for chiming in. I tried the null= approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not. Again, thanks for help! Best, David --- On Wed, 3/17/10, Martin Asenov mase...@velti.com wrote: From: Martin Asenov mase...@velti.com Subject: RE: Replace Choose one from DropDownChoice? To: users@wicket.apache.org users@wicket.apache.org Date: Wednesday, March 17, 2010, 9:08 AM Hi, David! Let's presume your webapplication class is called WebApp.java. In the same directory where it is present, create WebApp.properties with the following line: null= that way every single 'choose one' label will be replaced with . P.S. Don't forget to include the props files in the pom as a resource. Best, Martin -Original Message- From: David Chang [mailto:david_q_zh...@yahoo.com] Sent: Wednesday, March 17, 2010 3:03 PM To: users@wicket.apache.org Subject: Replace Choose one from DropDownChoice? Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements: 1. Replace Choose one with a blank line 2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not. 3. I am using ChoiceRenderer to convert between selection and objects. 4. This behavior is applicable to all DropDownChoice. How can meet these requirement? Thanks for your help! Regards. - 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 - 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: Replace Choose one from DropDownChoice?
Martin, Very sorry for being confusing to you. Here is what I want: I want blank line is always there, no matter whether a value is selected or not, no matter whether the field is required or not. I am using ChoiceRenderer to convert a selected option to objects. Thanks, David --- On Wed, 3/17/10, Martin Asenov mase...@velti.com wrote: From: Martin Asenov mase...@velti.com Subject: RE: Replace Choose one from DropDownChoice? To: users@wicket.apache.org users@wicket.apache.org Date: Wednesday, March 17, 2010, 10:34 AM David, please describe the use case in more depths. 1) You want a dropdownchoice with null selection, which is ? 2) You don't want a null selection to be there at all, but show the first element. Best, Martin -Original Message- From: David Chang [mailto:david_q_zh...@yahoo.com] Sent: Wednesday, March 17, 2010 4:31 PM To: users@wicket.apache.org Subject: Re: Replace Choose one from DropDownChoice? Martin, According to what you said, do I need to add special processing in ChoiceRenderer if this blank line is the selected and I need to convert selected value to object? Thanks, David --- On Wed, 3/17/10, Martin Phee mp...@objectivearts.com wrote: From: Martin Phee mp...@objectivearts.com Subject: Re: Replace Choose one from DropDownChoice? To: users@wicket.apache.org Date: Wednesday, March 17, 2010, 10:05 AM You have to add a selection choice that is just a blank line option. This is a typical requirement for any dropdown if you wan the use to be able to clear their choice. On Mar 17, 2010, at 8:47 AM, David Chang wrote: Martin, Thanks so much for chiming in. I tried the null= approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not. Again, thanks for help! Best, David --- On Wed, 3/17/10, Martin Asenov mase...@velti.com wrote: - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Recommend two good complete clean Wicket+Spring+Hibernate apps?
James, thanks so much for the information. I cannot say enough thank-you for your help. All the best, David --- On Tue, 3/16/10, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: From: Cemal Bayramoglu jweekend_for...@cabouge.com Subject: Re: Recommend two good complete clean Wicket+Spring+Hibernate apps? To: users users@wicket.apache.org Date: Tuesday, March 16, 2010, 9:01 AM David, You may find LegUp [1] useful. Also see the wiki, [2], the Wicket in Action site [3] and book [4] for useful information, and the PhoneBook sample [5]. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://cwiki.apache.org/WICKET/spring.html [3] http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ [4] http://www.manning.com/dashorst/ [5] http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook On 16 March 2010 02:05, David Chang david_q_zh...@yahoo.com wrote: Can anybody recommend to me two good complete clean sample or open source Wicket + Spring + Hibernate applications? One of the effective ways I learn is by learning from good examples. I would be very much grateful for any info. Hopefully, the sample or open source applications are not too big, but still show many points. Thanks a lot! - 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: Recommend two good complete clean Wicket+Spring+Hibernate apps?
Cemal, Thanks so much for the information. I am really grateful, indeed. Putting Wicket aside, you guys are awesome. Best, David --- On Tue, 3/16/10, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: From: Cemal Bayramoglu jweekend_for...@cabouge.com Subject: Re: Recommend two good complete clean Wicket+Spring+Hibernate apps? To: users users@wicket.apache.org Date: Tuesday, March 16, 2010, 9:01 AM David, You may find LegUp [1] useful. Also see the wiki, [2], the Wicket in Action site [3] and book [4] for useful information, and the PhoneBook sample [5]. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://cwiki.apache.org/WICKET/spring.html [3] http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ [4] http://www.manning.com/dashorst/ [5] http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook On 16 March 2010 02:05, David Chang david_q_zh...@yahoo.com wrote: Can anybody recommend to me two good complete clean sample or open source Wicket + Spring + Hibernate applications? One of the effective ways I learn is by learning from good examples. I would be very much grateful for any info. Hopefully, the sample or open source applications are not too big, but still show many points. Thanks a lot! - 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
Recommend two good complete clean Wicket+Spring+Hibernate apps?
Can anybody recommend to me two good complete clean sample or open source Wicket + Spring + Hibernate applications? One of the effective ways I learn is by learning from good examples. I would be very much grateful for any info. Hopefully, the sample or open source applications are not too big, but still show many points. Thanks a lot! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Recommend two good complete clean Wicket+Spring+Hibernate apps?
Hello James, Thank you! Best, -David --- On Mon, 3/15/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: Recommend two good complete clean Wicket+Spring+Hibernate apps? To: users@wicket.apache.org Date: Monday, March 15, 2010, 10:09 PM You can try my demo application I used for my Advanced Wicket presentation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk On Mon, Mar 15, 2010 at 10:05 PM, David Chang david_q_zh...@yahoo.com wrote: Can anybody recommend to me two good complete clean sample or open source Wicket + Spring + Hibernate applications? One of the effective ways I learn is by learning from good examples. I would be very much grateful for any info. Hopefully, the sample or open source applications are not too big, but still show many points. Thanks a lot! - 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: Recommend two good complete clean Wicket+Spring+Hibernate apps?
James, I just downloaded your application. Do you have any documentation/presentation about this application? Do you happen to have knowledge of another good sample/demo app? Thanks, David --- On Mon, 3/15/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: Recommend two good complete clean Wicket+Spring+Hibernate apps? To: users@wicket.apache.org Date: Monday, March 15, 2010, 10:09 PM You can try my demo application I used for my Advanced Wicket presentation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk On Mon, Mar 15, 2010 at 10:05 PM, David Chang david_q_zh...@yahoo.com wrote: Can anybody recommend to me two good complete clean sample or open source Wicket + Spring + Hibernate applications? One of the effective ways I learn is by learning from good examples. I would be very much grateful for any info. Hopefully, the sample or open source applications are not too big, but still show many points. Thanks a lot! - 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: Recommend two good complete clean Wicket+Spring+Hibernate apps?
James, the info is fantastic! Many thanks!!! -David --- On Mon, 3/15/10, James Carman jcar...@carmanconsulting.com wrote: From: James Carman jcar...@carmanconsulting.com Subject: Re: Recommend two good complete clean Wicket+Spring+Hibernate apps? To: users@wicket.apache.org Date: Monday, March 15, 2010, 11:02 PM On Mon, Mar 15, 2010 at 10:57 PM, David Chang david_q_zh...@yahoo.com wrote: James, I just downloaded your application. Do you have any documentation/presentation about this application? I didn't really have a slide presentation for this talk. I basically just walked through code. I did it as a day in the life of a Wicket programmer where I implemented some user stories on-the-fly. Do you happen to have knowledge of another good sample/demo app? Wicket Iolite (http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite) is another good example, or the example that comes with Wicketopia (work in progress). - 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
How to dynamtically generate an image via an Ajax link?
Hello, I am playing with JCaptcha. My JCaptcha is working (thanks to WIA book). I also have an Ajax link for a visitor to change the displayed image if he wishes. I am new in Wicket and I am trying to follow the idea of defining a model for a Wicket image component. However, based on my undersstanding of WIA's implementation of JCaptcha, no model is explicitly set and the book code simply sets ImageResource. Does anyone out there know how to dynamically updage an image via Ajax link? Any pointer or info is really appreciated. Regards. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org