Re: Page Expired to home or login instead of default?
Just tried it... seems to work as it should. thanks for your help. - Brill On 5-Jul-08, at 12:33 AM, David Leangen wrote: I can't seem to find anywhere, how I get wicket to automatically go to the home page instead of the Page Expired page when the session is invalidated (expires, or the user logs out). Never actually tried this, but I don't see why it wouldn't work... Application.get().getApplicationSettings().setPageExpiredErrorPage( HomePage.class ); Let me know if this works for you. -dml- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ajax behavior sample with radiogroup / radio
Hi - I am trying to integrate ajax behavior with a radio button such that whenever a radio button in a radio group is selected - an appropriate handler is invoked. Java: RadioGroup sex = new RadioGroup(sex); sex.add(new Radio(M, new Model(AgeValidator.SexEnum.MALE))); sex.add(new Radio(F, new Model(AgeValidator.SexEnum.FEMALE))); sex.add( new OnChangeAjaxBehavior( protected void onUpdate(AjaxRequestTarget target) { //code to execute when a radio button is selected. //appropriate component added to target. } ) ); html: === wicket:container wicket:id=sex tdinput wicket:id=M type=radio /Male input wicket:id=F type=radio /Female/td /wicket:container This does not seem to invoke the ajax code handler that I was expecting when I select an age in the front - end. Any idea what I am missing here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No effect of code until restarting netbeans.
which version of netbeans are you using. I use NB6.1 and with a standard netbeans web project all you have to do is recompile your web project and right-click on project and then Run. It will deploy your changes alright. Only that after a while, tomcat will give you perm-gen error which will force you to terminate the tomcat instance using Task Manager manually before netbeans can continue managing tomcat On Tue, Jul 1, 2008 at 5:42 PM, Jeremy Levy [EMAIL PROTECTED] wrote: Use Undeploy and Deploy on your EAR or WAR... On Tue, Jul 1, 2008 at 3:58 AM, Sushant [EMAIL PROTECTED] wrote: I am a newuser using wicket. I have been facing this problem since a week. I'm in serious trouble. Whenever i make any changes in my code in netbeans the changes i have made doesn't works until i restart netbeans. After restarting my netbeans the changes that i have made in my code works. For e.g. If i have set as setResponsePage(Home.class) and later i change it to setResponsePage(Index.class) and save it. Now if i run my project than it still shows Home page until i restart netbeans. After i restart netbeans the problem is solved. I'm using netbeans 6.1 Please help me with this problem. -- View this message in context: http://www.nabble.com/No-effect-of-code-until-restarting-netbeans.-tp18211238p18211238.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax behavior sample with radiogroup / radio
On Sat, 05 Jul 2008, Rakesh Sinha wrote: This does not seem to invoke the ajax code handler that I was expecting when I select an age in the front - end. Any idea what I am missing here. Check out which JavaScript event gets triggered on checking the radio button. It might be onclick instead of onchange, in which case new AjaxFormComponentUpdatingBehavior(onclick) in place of OnChangeAjaxBehavior should work. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generics
On Fri, 04 Jul 2008, Matthijs Wensveen wrote: How do you cope with deeply nested model properties? For example: public class PersonViewer extends ComponentPerson { .. } some other component does: person.getOrders().get(0).setAmount(0); // first order for free (as in beer) I have no idea of Johan's project, but normally you just edit an object in one place at a time, and PersonViewer would be a read-only component with a model that always pulls the freshest version of the person it is displaying from the database. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generics
On Thu, 03 Jul 2008, Matej Knopp wrote: I'm gonna be -1 on removing model utility methods and default model slot from component until you suggest a clean and transparent way to support - compound (inherited) models - component assigned models - automatic detachment Fair enough, let's see what we can come up with :) I was thinking that most of that stuff could be achieved by moving more logic to the model classes. Some things such as the add(new Label(name)); for CompoundPropertyModel-component children could be tricky to get working though. Anyway, I agree that now our focus must be on getting 1.4 out of the door -- the reason this came up was just that I was thinking out loud whether the plans for 1.5 have implications on what to add in 1.4. Automatic detachment for all IModel fields of a component would be great (and the easiest to do of those I suppose). From component where? ComponentUtil? Component has a very strong and complicated contract. There are lot of methods in component, but there are reasons for it. There are parts like rendering though that might need to be cleaned up. Definitely not to a utility class with static methods :) Maybe some of the responsibilities can be moved to different other classes, such as ComponentTag and MarkupStream. But let's see that when working on 1.5. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validators for lists
Can someone please suggest a way to use/extend the current validators to validate list of objects. The problem is i have to write code in the following manner and don't know if it is a good approach. EmailAddressValidator validator = EmailAddressValidator.getInstance(); for (final Iterator it = invitationForm.getEmailList().iterator(); it.hasNext();) { validator.validate(new IValidatable() { public void error(IValidationError error) { form.error(One or More of email ids are not in valid format); } public Object getValue() { return (String)it.next(); } public boolean isValid() { return form.hasError(); } }); if (form.hasError()) { break; } }
PropertyModel implementing IComponentInheritedModel
Hi, if I haven't overlooked something, there's no variant of PropertyModel implementing IComponentInheritedModel. IComponentInheritedModel demands only one method, wrapOnInheritance. Looking at the implementation of CompoundPropertyModel, wrapOnInheritance does nothing but return an AttachedCompoundPropertyModel, which in turn seems not specific to CompoundPropertyModel. Shouldn't the same approach work in PropertyModel? Is there a downside to making a model an IComponentInheritedModel? Cheers, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax behavior sample with radiogroup / radio
I changed the code to be AjaxFormComponentUpdatingBehavior (onclick) - but it still does not seem to work ( though , onclick *is* the right method to invoke from javascript ). The generated HTML does not seem to contain the javascript invocation for the particular event. I am suspecting something wrong with my html code. html: wicket:container wicket:id=sex tdinput wicket:id=M type=radio /Male input wicket:id=F type=radio /Female/td /wicket:container Would this be correct ? On 7/5/08, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Sat, 05 Jul 2008, Rakesh Sinha wrote: This does not seem to invoke the ajax code handler that I was expecting when I select an age in the front - end. Any idea what I am missing here. Check out which JavaScript event gets triggered on checking the radio button. It might be onclick instead of onchange, in which case new AjaxFormComponentUpdatingBehavior(onclick) in place of OnChangeAjaxBehavior should work. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax behavior sample with radiogroup / radio
Ok - my new code looks as follows: - RadioGroup sex = new RadioGroup(sex); Radio male = new Radio(M, new Model(SexEnum.MALE)); Radio female = new Radio(F, new Model(SexEnum.FEMALE)); sex.add(male.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { // add your favorite component. } }); sex.add(female.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { // add your favorite component. } }); This seems to associate the right event with the radio buttons. Having said that - I was curious - how would I distinguish between the different radio buttons in a given radio group (between M and F , in the above example ) to see which value has been chosen. Is there a method in RadioGroup , that will given something like a current selected radio model or something similar to that ? On 7/5/08, Rakesh Sinha [EMAIL PROTECTED] wrote: I changed the code to be AjaxFormComponentUpdatingBehavior (onclick) - but it still does not seem to work ( though , onclick *is* the right method to invoke from javascript ). The generated HTML does not seem to contain the javascript invocation for the particular event. I am suspecting something wrong with my html code. html: wicket:container wicket:id=sex tdinput wicket:id=M type=radio /Male input wicket:id=F type=radio /Female/td /wicket:container Would this be correct ? On 7/5/08, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Sat, 05 Jul 2008, Rakesh Sinha wrote: This does not seem to invoke the ajax code handler that I was expecting when I select an age in the front - end. Any idea what I am missing here. Check out which JavaScript event gets triggered on checking the radio button. It might be onclick instead of onchange, in which case new AjaxFormComponentUpdatingBehavior(onclick) in place of OnChangeAjaxBehavior should work. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax behavior sample with radiogroup / radio
RadioGroup sex; //define as a member variable .. sex = new RadioGroup(sex, new Model(SexEnum.MALE) ) ; //important: the model of the radio group has to be the same as // the model for the individual radio members as well. Radio male = new Radio(M, new Model(SexEnum.MALE)); Radio female = new Radio(F, new Model(SexEnum.FEMALE)); sex.add(male.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { // add your favorite component. } }); sex.add(female.add(new AjaxFormSubmitBehavior(onclick) { @Override protected void onSubmit(AjaxRequestTarget target) { //sex.getModelObject() // will have the selected model object. //SexEnum.Male / SexEnum.Female in this case. } @Override protected void onError(AjaxRequestTarget target) { // TODO Auto-generated method stub } }); This seems to work. On 7/5/08, Rakesh Sinha [EMAIL PROTECTED] wrote: Ok - my new code looks as follows: - RadioGroup sex = new RadioGroup(sex); Radio male = new Radio(M, new Model(SexEnum.MALE)); Radio female = new Radio(F, new Model(SexEnum.FEMALE)); sex.add(male.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { // add your favorite component. } }); sex.add(female.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { // add your favorite component. } }); This seems to associate the right event with the radio buttons. Having said that - I was curious - how would I distinguish between the different radio buttons in a given radio group (between M and F , in the above example ) to see which value has been chosen. Is there a method in RadioGroup , that will given something like a current selected radio model or something similar to that ? On 7/5/08, Rakesh Sinha [EMAIL PROTECTED] wrote: I changed the code to be AjaxFormComponentUpdatingBehavior (onclick) - but it still does not seem to work ( though , onclick *is* the right method to invoke from javascript ). The generated HTML does not seem to contain the javascript invocation for the particular event. I am suspecting something wrong with my html code. html: wicket:container wicket:id=sex tdinput wicket:id=M type=radio /Male input wicket:id=F type=radio /Female/td /wicket:container Would this be correct ? On 7/5/08, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Sat, 05 Jul 2008, Rakesh Sinha wrote: This does not seem to invoke the ajax code handler that I was expecting when I select an age in the front - end. Any idea what I am missing here. Check out which JavaScript event gets triggered on checking the radio button. It might be onclick instead of onchange, in which case new AjaxFormComponentUpdatingBehavior(onclick) in place of OnChangeAjaxBehavior should work. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
calendar control for wicket ??
Hi - Just curious if there is a Calendar control / class associated with Wicket. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calendar control for wicket ??
are you talking about a DatePicker? On Sun, Jul 6, 2008 at 4:11 AM, Rakesh Sinha [EMAIL PROTECTED] wrote: Hi - Just curious if there is a Calendar control / class associated with Wicket. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calendar control for wicket ??
Thanks Ayodeji. import org.apache.wicket.extensions.yui.calendar.DateField; This does the trick. But a clarification though - I am using the default version as specified in the javadoc. java: dateField = new DateField(birthday); html: div wicket:id=birthday/div I need a couple of modifications to the same. Just curious how I get about doing the same. 1) The textfield (DateTextField) seems to parse the dates in mm/dd/yy format . I need to change the same to dd/mm/yy as the audience for which the application is targeted is going to be using that particular format. 2) When I enter the date as 14/14/1980, say (incorrect date to begin with) - for some reason it gets rounded, and appears as 2/14/81 (a very similar behavior is exhibited by the Calendar class in java.util too). Instead I would like to reminded that the input is actually an error and it is incorrect altogether. This might be more involved I believe. On 7/5/08, Ayodeji Aladejebi [EMAIL PROTECTED] wrote: are you talking about a DatePicker? On Sun, Jul 6, 2008 at 4:11 AM, Rakesh Sinha [EMAIL PROTECTED] wrote: Hi - Just curious if there is a Calendar control / class associated with Wicket. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validators for lists
On Sun, 06 Jul 2008, atul singh wrote: Can someone please suggest a way to use/extend the current validators to validate list of objects. The problem is i have to write code in the following manner and don't know if it is a good approach. Your approach seems fine, though you could collect the non-valid email addresses and display them in the error message. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PropertyModel implementing IComponentInheritedModel
Why should the propertymodel be an inherited? Propertymodel is assignable model. Compound is inherited. Property model isnt meant to be shared over multiple components thats why we have compound On 7/5/08, Thomas Kappler [EMAIL PROTECTED] wrote: Hi, if I haven't overlooked something, there's no variant of PropertyModel implementing IComponentInheritedModel. IComponentInheritedModel demands only one method, wrapOnInheritance. Looking at the implementation of CompoundPropertyModel, wrapOnInheritance does nothing but return an AttachedCompoundPropertyModel, which in turn seems not specific to CompoundPropertyModel. Shouldn't the same approach work in PropertyModel? Is there a downside to making a model an IComponentInheritedModel? Cheers, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validators for lists
So the list of objects is in this case multiple input fields? Why do that in a list, just give every email field that validator and let wicket be the one that iterates of the list. Then you also have much better feedback to the end user On 7/5/08, atul singh [EMAIL PROTECTED] wrote: Can someone please suggest a way to use/extend the current validators to validate list of objects. The problem is i have to write code in the following manner and don't know if it is a good approach. EmailAddressValidator validator = EmailAddressValidator.getInstance(); for (final Iterator it = invitationForm.getEmailList().iterator(); it.hasNext();) { validator.validate(new IValidatable() { public void error(IValidationError error) { form.error(One or More of email ids are not in valid format); } public Object getValue() { return (String)it.next(); } public boolean isValid() { return form.hasError(); } }); if (form.hasError()) { break; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]