at martijn's encouraging, i realize that i need to pass on more information about form models. the form input example now shows how forms were generally intended to be used.
basically, the form should have its own model that each of the form components attach to. remember, a Form is a Component, and so it has a model you can get/set too!
it's true that you can do much more complicated things with models, which unfortunately, is what most people are doing... but the simple and straightforward thing to do is going to be to create forms that edit a single model.
so the model is set in the Form constructor in FormInput like this:
public InputForm(String name, IValidationFeedback validationFeedback)
{
super(name, new FormInputModel(), validationFeedback);
although you might pass in the model if the form was designed to edit an existing model...
and then components edit the forms model like this:
add(new RequiredTextField("stringInput", getModel(), "stringProperty"));
i am actually thinking of simplifying even this by supporting a shorthand for this:
add(new RequiredTextField("property", getModel(), "property"));which assumes you are using the Form's model (and not some external model). the shorthand would require that the field have the same name as the property and would just be:
add(new RequiredTextField("property"));and this would apply to all components that work with property models... so in the end, it should be super easy to hook up form components on a form with a first class model.
jon
------------------------------------------------------- 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
