yeah, i'm thinking this is really important to fix. i just wanted to throw it out there first in case i missed something... this is pretty complex stuff...
btw, the changes i made today to enable first class form models to be super groovy have shrunk the FormInputExample down so there's practically nothing redundant... check it out...
private static class InputForm extends Form
{
public InputForm(String name, IValidationFeedback validationFeedback)
{
super(name, new FormInputModel(), validationFeedback);
add(new RequiredTextField("stringProperty"));
add(new RequiredTextField("integerProperty", Integer.class));
add(new RequiredTextField("doubleProperty", Double.class));
add(new RequiredTextField("dateProperty", Date.class));
add(new RequiredTextField("integerInRangeProperty", Integer.class)
.add(IntegerValidator.range(0, 100)));
add(new ImageButton("saveButton")); add(new OnClickLink("resetButtonLink")
{
public void onClick()
{
InputForm.this.setModelObject(new FormInputModel());
}
}.add(new Image("resetButtonImage")));
}public void onSubmit()
{
// Form validation successful. Display message showing edited model.
info("Saved model " + getModelObject());
}
}
Martijn Dashorst wrote:
Jonathan Locke wrote:
it would no longer be possible for people to make this fatal mistake.
Yeah! Unable to make mistakes (especially fatal ones) is A Good Thing.
instead, users would be forced to do the correct thing and change their model's /value/ rather than the model itself by calling setModelObject().
I sure hope you didn't find this in my code ;-)
I like the idea because it is self documenting, so I'm +1.
Martijn
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
