Hi Martin,
this is true for my DropDownChoice2.
But DropDownChoice1 does not get validated.
So, this could be the reason why it is not cleared.
Now... I'm getting more and more confused... *lol*
Page
Form A
DropDownChoice1 displaying selected 'Car 1'
Form B
DropDownChoice2 displaying selected 'Car 1'
Patrick
Am 20.11.2015 um 15:32 schrieb Martin Grigorov:
Hi,
On Fri, Nov 20, 2015 at 3:22 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:
Hi Sven,
using clearInput() works.
I call it in onConfigure() of my DropDownChoice.
Ok, so far... but I'm still confused about the raw-input-handling.
Ususally, (and thats what I have in mind): components reflect the current
model objects state.
Whats the reason saving the raw-input and determining the selected value
by raw-input and not by the model-objects value?
Wicket clears the rawInput
at org.apache.wicket.markup.html.form.FormComponent#valid().
FormComponent#valid() is called if the validation and conversion pass
successfully.
You can put a breakpoint and see what happens.
kind regards
Patrick
Am 19.11.2015 um 16:43 schrieb Sven Meier:
Hi Patrick,
so you have two components using the same model? Interesting.
Easiest solution would be to clear the rawInput on DropDownChoice1:
choice1.clearInput();
If you don't have access to the dropDown from your submitting code, you
might use component events to signal the car selection:
(Wicket events infrastructure)
https://ci.apache.org/projects/wicket/guide/6.x/guide/advanced.html#advanced_2
Have fun
Sven
On 19.11.2015 13:40, Patrick Davids wrote:
Hi Wicket Pros,
I have a quite special case here and a question concerning nested form
submits and FormComponent/Raw-Input Handling.
This is my component tree:
Page
Form A
DropDownChoice1 displaying selected 'Car 1'
Form B
DropDownChoice2 displaying selected 'Car 1'
The model-binding of both DropDownChoices pointing to the same member of
the model-object of the page.
This is my case and code flow:
- Someone uses DropDownChoice2 of Form B and changes the value to 'Car 2'
- Form B does a form submit
- Method onFormSubmitted(IFormSubmitter submitter) of Form A is also
called
- which calls inputChanged() of the DropDownChoice1 (by visiting /
iteration)
- so DropDownChoice1.inputChanged() reads and sets its rawInput to the
current displayed value 'Car 1'
- after form submit is done, an ajax refresh updates Form A
- DropDownChoice1 re-renders an runs through its appendOptionHtml()
- this reads getValue(), returning 'Car 1' from its previously saved
rawInput
- after the ajax refresh is finished, Form A shows the old selected 'Car
1' instead of 'Car 2'
Model-Object updates are working fine... but DropDownChoice1 does not
reflect it correct, due to the raw-input-handling.
Can someone help here, please?
Thanx a lot
kind regards
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org