Re: AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-28 Thread Sven Meier

Hi,

I don't see anything wrong with your code.

Please create a quickstart so we can debug the problem.

Regards
Sven


On 27.07.2015 23:27, MissOvenMitts wrote:

Thanks for reading!

You're right, I forgot to leave that part in.

At the top, you see that I declare the variable :

Then one of the first lines of code on the panel calls a method that
generates a fake bean of data and sets it on that variable, like so:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669p4671672.html
Sent from the Users forum mailing list archive at Nabble.com.

-
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



Re: AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-28 Thread MissOvenMitts
I was going about figuring out how to set up the Quickstart when I figured
out (sort of) what's wrong. 

The fields aren't always going back to null - they're actually going back to
what's applied to the bean in the backing property model (so, if MyBean is
new, then the fields go back to null, but if I had something originally in
MyBean, the field goes back to that original value).

It's not the code in the panel that is causing the problem, it seems to be a
'MyErrorDecorator' that I add into the init() of the whole application which
turns fields red if they have a form validation error, like so:



If I comment out the addition of the MyErrorDecorator, the fields no longer
null out. However, they also obviously don't turn red anymore when the user
tries to submit the form improperly either, unfortunately.

This is MyErrorDecorator. I'm not doing .clear on the components in here, so
I don't think it should ruin what the user has entered. What am I doing
wrong here? I think the problem might be that we are calling .isValid() in
the isInvalidFormComponent(Component component) method on all of the
components to know if they are red or not -- and that calls validation which
might force the field back to null.. or something. Does that sound
plausible?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669p4671681.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-28 Thread MissOvenMitts
Alright, I think I've got it figured out. Partially. I'll keep working on it.
Thanks guys.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669p4671684.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-27 Thread MissOvenMitts
I must be using the AjaxFormComponentUpdatingBehavior and
AjaxFormChoiceComponentUpdatingBehavior wrong, but I'm not sure why/how. 

The general gist is that if I add this behavior to a component, when the
user activates the change behavior on that component the rest of the form
fields are nulled out.

So, here's a very watered down version of part of my panel. When the user
changes the q5 dropdown choice (with the AjaxFormComponentUpdatingBehavior)
or the q4 RadioChoice (with the AjaxFormChoiceComponentUpdatingBehavior),
all of the other q-fields go blank. 

(Note: The ajax behavior does properly trigger, though, in that it does do
what I said to do in the update behavior)

*** example html *

*** example code *


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-27 Thread Sven Meier

Hi,


private MyBean myBean;


where are you creating that bean? I don't see it in your code.

Sven



On 27.07.2015 19:21, MissOvenMitts wrote:

I must be using the AjaxFormComponentUpdatingBehavior and
AjaxFormChoiceComponentUpdatingBehavior wrong, but I'm not sure why/how.

The general gist is that if I add this behavior to a component, when the
user activates the change behavior on that component the rest of the form
fields are nulled out.

So, here's a very watered down version of part of my panel. When the user
changes the q5 dropdown choice (with the AjaxFormComponentUpdatingBehavior)
or the q4 RadioChoice (with the AjaxFormChoiceComponentUpdatingBehavior),
all of the other q-fields go blank.

(Note: The ajax behavior does properly trigger, though, in that it does do
what I said to do in the update behavior)

*** example html *

*** example code *


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669.html
Sent from the Users forum mailing list archive at Nabble.com.

-
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



Re: AjaxFormComponentUpdatingBehavior and AjaxFormChoiceComponentUpdatingBehavior Erases All Other Fields

2015-07-27 Thread MissOvenMitts
Thanks for reading!

You're right, I forgot to leave that part in.

At the top, you see that I declare the variable :  

Then one of the first lines of code on the panel calls a method that
generates a fake bean of data and sets it on that variable, like so:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-and-AjaxFormChoiceComponentUpdatingBehavior-Erases-All-Other-Fields-tp4671669p4671672.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org