Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-15 Thread Sven Meier
Hi Patrick, sorry for the confusion. >Does this objection have any consequences for my implementation? Wicket validates all values *before* they are written into the models. So validators always validate the converted input only. You have the following options: - IValidator, validates the

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-15 Thread Patrick Davids
Hi Sven, > Yes, the converted values haven't been written yet. Does this objection have any consequences for my implementation? For me, it semms it is working now... so I think, there is no need to me to additionally override > @Override > public void validate() { >//

Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Patrick Davids
Hi all, I would like to implement some kind of modular form components. So, a developer is able stick together a form to save e.g. person data and adress data with different panels containing the particular needed input fields (textfield, selectboxes etc). Form f = new Form(...); f.add(new

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Sven Meier
Hi, > Is it a good idea to implement such a case extending FormComponentPanel, or is FormComponentPanel for other purposes? usuallly a FormComponentPanel is used when you want to combine the input of several formComponents into a single model object, e.g. MultiFileUploadField and

SOLVED / Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Patrick Davids
Hi Sven, thanx for your code-snippet. Sometimes it is so easy... Works perfect! kind regards Patrick Am 12.02.2016 um 12:08 schrieb Sven Meier: Hi, > Is it a good idea to implement such a case extending FormComponentPanel, or is FormComponentPanel for other purposes? usuallly a

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Martin Grigorov
Hi Sven, On Fri, Feb 12, 2016 at 12:08 PM, Sven Meier wrote: > Hi, > > > Is it a good idea to implement such a case extending FormComponentPanel, > or is FormComponentPanel for other purposes? > > usuallly a FormComponentPanel is used when you want to combine the input > of

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Sven Meier
Hi again, now I see what you meant: Yes, the converted values haven't been written yet. I was writing my example off the top of my head :). Validators won't help here, you'll have to do validation by hand instead: PersonPanel extends FormComponentPanel { @Override protected void

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Sven Meier
Hi Martin, >The modelObject should be the one before the form submit, it should be the same one which all nested formComponents are changing. I can't think of a case where this shouldn't hold. >Because Form#updateModels() is called after the conversion and validations. >By calling the line

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Martin Grigorov
Hi, I don't remember the last time I needed to write custom FCP so I don't really understand how/why these code snippets would work the way you explain. I'll fire the debugger to see why they behave differently than the other form components in the form submit processing. Thanks! On Feb 13, 2016

Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates

2016-02-12 Thread Joachim Schrod
FWIW, for FormComponentPanels I often have an empty implementation of updateModel() and either have a wrapper method to add validators for those (abstract) sub-component, or redefine convertInput() to construct a proper object from nestedFormComponent.getConvertedInput() to make validators work on