[Wicket-user] update propertyModel value to null
Hello, textarea wicket:id=myString rows=10/textarea FormComponent myStringComp = new TextArea(myString, new PropertyModel(this, myString)); myStringComp.add(new AjaxFormComponentUpdatingBehavior(onchange){ protected void onUpdate(AjaxRequestTarget target) { myString // do stuff } }); Using ajax, almost everything seems to work. If I clear the textarea and tab out, the String myString does not change to null or an empty string, it retains the previous value. What am I missing? Thanks, Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
hmm can you try onblur instead of onchange, dont know if textarea supports that event -igor On 1/23/07, Shawn Tumey [EMAIL PROTECTED] wrote: Hello, textarea wicket:id=myString rows=10/textarea FormComponent myStringComp = new TextArea(myString, new PropertyModel(this, myString)); myStringComp.add (new AjaxFormComponentUpdatingBehavior(onchange){ protected void onUpdate(AjaxRequestTarget target) { myString // do stuff } }); Using ajax, almost everything seems to work. If I clear the textarea and tab out, the String myString does not change to null or an empty string, it retains the previous value. What am I missing? Thanks, Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
onblur has the same outcome as onchange. Updates to myString that grow it, or shrink it work fine as long as there is something in the textarea field. Clearing the field retains the previous value. BTW, this is using 1.2.4 any other ideas? On of my coworkers suggested overloading the setMyString method. To this end, I created: public void setMyString() { this.myString = null; } this had no affect. On 1/23/07, Igor Vaynberg [EMAIL PROTECTED] wrote: hmm can you try onblur instead of onchange, dont know if textarea supports that event -igor -- Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
Hi Shawn, Could you check that you have a single, properly nested form element in the html? I vaguely remember someone having problems with this. Erik. Shawn Tumey wrote: onblur has the same outcome as onchange. Updates to myString that grow it, or shrink it work fine as long as there is something in the textarea field. Clearing the field retains the previous value. BTW, this is using 1.2.4 any other ideas? On of my coworkers suggested overloading the setMyString method. To this end, I created: public void setMyString() { this.myString = null; } this had no affect. On 1/23/07, *Igor Vaynberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: hmm can you try onblur instead of onchange, dont know if textarea supports that event -igor -- Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com http://www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
Hello Erik, The form element is there. Hello Igor, I will have check with our software architect before I can upgrade to the 1.3x branch. I am moving on to other functionality for the time being. Thanks to both of you for your assistance. Any other suggestions? Regards, On 1/23/07, Erik van Oosten [EMAIL PROTECTED] wrote: Hi Shawn, Could you check that you have a single, properly nested form element in the html? I vaguely remember someone having problems with this. Erik. -- Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
use wicket's ajax debug console to see what the url request is then set a breakpoint in AjaxFormComponentUpdatingBehavior.onEvent and walk it, see why its not setting the value to null -igor On 1/23/07, Shawn Tumey [EMAIL PROTECTED] wrote: Hello Erik, The form element is there. Hello Igor, I will have check with our software architect before I can upgrade to the 1.3x branch. I am moving on to other functionality for the time being. Thanks to both of you for your assistance. Any other suggestions? Regards, On 1/23/07, Erik van Oosten [EMAIL PROTECTED] wrote: Hi Shawn, Could you check that you have a single, properly nested form element in the html? I vaguely remember someone having problems with this. Erik. -- Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] update propertyModel value to null
The input is returning to the server as an empty string . The field is required, so when the onEvent method checks protected final void onEvent(final AjaxRequestTarget target) { final FormComponent formComponent = getFormComponent(); boolean callOnUpdate = true; try { formComponent.inputChanged(); formComponent.validate(); if (formComponent.hasErrorMessage()) { formComponent.invalid(); } else { formComponent.valid(); formComponent.updateModel(); } } catch (RuntimeException e) { callOnUpdate = false; onError(target, e); } if (callOnUpdate) { onUpdate(target); } } the component is set as invalid and the model is not updated. I am not concerned if the component is valid at this stage of the game, I simply have other models I need to update based on what is (or is not) in this component. I understand what it is doing, but I believe it is a mistake to not update the model. Especially since onUdate is still being called with the old unupdated values. my $.02 Regards, On 1/23/07, Igor Vaynberg [EMAIL PROTECTED] wrote: use wicket's ajax debug console to see what the url request is then set a breakpoint in AjaxFormComponentUpdatingBehavior.onEvent and walk it, see why its not setting the value to null -igor -- Shawn Tumey Cofounder MT Web Productions LLC www.mtwebproduction.com - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user