[Wicket-user] Info-Message for DropDownChoice
Title: Info-Message for DropDownChoice Hello, I'm using a DropDownChoice and I have one entry which shouldn't be selected. I implemented a validator which captures this feature. The validator does the right thing but only when the page is submitted. The problem is that I need an info message before submitting the form! Here some code: The DropDownChoice initialized in the Page-Constructor: XXXDropDownChoice dropDownChoice = new XXXDropDownChoice( xxx, listModel, new ChoiceRenderer(name, id), false); dropDownChoice.add(new XXXChoiceValidator()); form.add(dropDownChoice); if (!dropDownChoice.isChoiceAvailable()){ getFeedbackMessages().info(dropDownChoice ,An info text!); } The method isChoiceAvailable() in my XXXDropDownChoice is implemented using the model and the choices: public boolean isChoiceAvailable(){ List baseChoicesList = super.getChoices(); Object choiceObject = getModelObject(); return baseChoicesList.contains(choiceObject); } Thanks for Help, Daniel - 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] Info-Message for DropDownChoice
one way or another you need to submit the form - thats just how http works.what i would do is override wantOnSelectionChangedNotifications() of the dropdown - that way the form is submitted every time you change the selection. then also override onSelectionChanged and call validate() to run the validators.-IgorOn 9/25/06, MailingWicketUser [EMAIL PROTECTED] wrote: Hello, I'm using a DropDownChoice and I have one entry which shouldn't be selected. I implemented a validator which captures this feature. The validator does the right thing but only when the page is submitted. The problem is that I need an info message before submitting the form! Here some code: The DropDownChoice initialized in the Page-Constructor: XXXDropDownChoice dropDownChoice = new XXXDropDownChoice( xxx, listModel, new ChoiceRenderer(name, id), false); dropDownChoice.add(new XXXChoiceValidator()); form.add(dropDownChoice); if (!dropDownChoice.isChoiceAvailable()){ getFeedbackMessages().info(dropDownChoice ,An info text!); } The method isChoiceAvailable() in my XXXDropDownChoice is implemented using the model and the choices: public boolean isChoiceAvailable(){ List baseChoicesList = super.getChoices(); Object choiceObject = getModelObject(); return baseChoicesList.contains(choiceObject); } Thanks for Help, Daniel -Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___Wicket-user mailing listWicket-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
[Wicket-user] Info-Message for DropDownChoice
Title: Info-Message for DropDownChoice An additional problem is that the entry can be the default selection! So the user makes no changes in the dropdownchoice! Overriding the methods wantOnSelectionChangedNotifications() and onSelectionChanged() is not the right way! I just want to add an info-message! Today I debugged my code and the result is that the method getModelObject() in the method isChoiceAvailable() provides null! In the page I use a CompoundPropertyModel and the id xxx is a property of the page-model-object! Daniel - 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] Info-Message for DropDownChoice
whats with all the exclamation marks? :)as i said - you need to submit the value - it is just how http works. if it is selected by default then it will be validated on submit and form processing will be halted - but your validator should call error() not info() in order to halt the form processing. if you want something instanteneous that doesnt submit the value then use _javascript_.-IgorOn 9/25/06, MailingWicketUser [EMAIL PROTECTED] wrote: An additional problem is that the entry can be the default selection! So the user makes no changes in the dropdownchoice! Overriding the methods wantOnSelectionChangedNotifications() and onSelectionChanged() is not the right way! I just want to add an info-message! Today I debugged my code and the result is that the method getModelObject() in the method isChoiceAvailable() provides null! In the page I use a CompoundPropertyModel and the id xxx is a property of the page-model-object! Daniel -Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___Wicket-user mailing listWicket-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] Info-Message for DropDownChoice
Title: Re: [Wicket-user] Info-Message for DropDownChoice Hello, I don't want to submit the page! When I display the page the first time, an entry in the dropdownchoice is selected (due to the property). The only thing is that I need an info-Message, so that the user can change the selection. When I submit the page my Validator adds an error-Message, so that the form-processing is halted. But this error-message is too late! I just want to add an info-message when displaying the page initial! Daniel - 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] Info-Message for DropDownChoice
Does xxx have getters and setters? What do you get when you do getModel()? Eelco On 9/26/06, MailingWicketUser [EMAIL PROTECTED] wrote: Hello, the main problem is not the info-message. When I call info(bla) in thze constructor, then the message is displayed. I think the main problem is that the method getModelObject() (see method isChoiceAvailable())provides null, but it should not be null! Here again my code: The DropDownChoice initialized in the Page-Constructor: XXXDropDownChoice dropDownChoice = new XXXDropDownChoice( xxx, listModel, new ChoiceRenderer(name, id), false); dropDownChoice.add(new XXXChoiceValidator()); form.add(dropDownChoice); if (!dropDownChoice.isChoiceAvailable()){ getFeedbackMessages().info(dropDownChoice ,An info text!); } The method isChoiceAvailable() in my XXXDropDownChoice is implemented using the model and the choices: public boolean isChoiceAvailable(){ List baseChoicesList = super.getChoices(); Object choiceObject = getModelObject(); return baseChoicesList.contains(choiceObject); } Daniel - 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] Info-Message for DropDownChoice
Title: Re: [Wicket-user] Info-Message for DropDownChoice Hello, the main problem is not the info-message. When I call info(bla) in thze constructor, then the message is displayed. I think the main problem is that the method getModelObject() (see method isChoiceAvailable())provides null, but it should not be null! Here again my code: The DropDownChoice initialized in the Page-Constructor: XXXDropDownChoice dropDownChoice = new XXXDropDownChoice( xxx, listModel, new ChoiceRenderer(name, id), false); dropDownChoice.add(new XXXChoiceValidator()); form.add(dropDownChoice); if (!dropDownChoice.isChoiceAvailable()){ getFeedbackMessages().info(dropDownChoice ,An info text!); } The method isChoiceAvailable() in my XXXDropDownChoice is implemented using the model and the choices: public boolean isChoiceAvailable(){ List baseChoicesList = super.getChoices(); Object choiceObject = getModelObject(); return baseChoicesList.contains(choiceObject); } Daniel - 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] Info-Message for DropDownChoice
Title: Re: [Wicket-user] Info-Message for DropDownChoice Hello, my Model-Object has Gettes and Setters, but the method getModel() in the method isChoiceAvailable() returns null! Daniel - 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