Re: Wicket 6.15 - Component not getting refreshed

2016-05-05 Thread Martin Grigorov
Hi,

On Wed, May 4, 2016 at 11:37 PM, sameerkhanna 
wrote:

> Hi,
>
> We recently upgraded from wicket 1.3 to wicket 6.15. However, it was a step
> by step upgrade for each major version.
>
> On one of the pages in the application we have a set of radio buttons. We
> have AJAX behavior on those radio buttons. On click of the "Yes" options,
> some follow up questions get shown which are text fields. On click of the
> "No" options the follow up question fields get hidden. Both of these AJAX
> calls work fine in the normal scenario. However, when there are any error
> messages in the feedback panel (e.g. when some required field validation
> failed) the components are not getting refreshed (i.e. the follow up
> questions are not getting hidden on click of the "No" options). I have kept
> exactly the same code in both the onSubmit(AjaxRequestTarget target) and
> onError(final AjaxRequestTarget target) methods. The onError method does
> get
> called in the scenario where I am having issues but the component is
> somehow
> not refreshed.
>
> Following is what I have written -
>
> radiochoice.add(new AjaxFormSubmitBehavior(form, "onClick")
> {
> protected void
> onSubmit(AjaxRequestTarget target)
>  {
> final Component
> questionComp =
> radiochoice.findParent(QuestionGroupPanel.class);
>
>  target.add(questionComp);
>
>
>  }
>
>
> @Override
> protected void onError(final
> AjaxRequestTarget target){
>
> super.onError(target);
> final Component
> questionComp =
> radiochoice.findParent(QuestionGroupPanel.class);
>
>  target.add(questionComp);
>
> }
>
> In Wicket 1.3 the code was working fine even without the onError method.
> Kinda clueless as to what might be happening. Any help would be much
> appreciated. Thanks!
>

Check the logic that decides what to show and what to hide.
Most probably due to the invalid data that has been submitted some models
are not updated and thus the logic says that the components should not be
hidden.

Please also update to 6.22.0.



>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-15-Component-not-getting-refreshed-tp4674552.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
>
>


Wicket 6.15 - Component not getting refreshed

2016-05-04 Thread sameerkhanna
Hi,

We recently upgraded from wicket 1.3 to wicket 6.15. However, it was a step
by step upgrade for each major version. 

On one of the pages in the application we have a set of radio buttons. We
have AJAX behavior on those radio buttons. On click of the "Yes" options,
some follow up questions get shown which are text fields. On click of the
"No" options the follow up question fields get hidden. Both of these AJAX
calls work fine in the normal scenario. However, when there are any error
messages in the feedback panel (e.g. when some required field validation
failed) the components are not getting refreshed (i.e. the follow up
questions are not getting hidden on click of the "No" options). I have kept
exactly the same code in both the onSubmit(AjaxRequestTarget target) and
onError(final AjaxRequestTarget target) methods. The onError method does get
called in the scenario where I am having issues but the component is somehow
not refreshed. 

Following is what I have written - 

radiochoice.add(new AjaxFormSubmitBehavior(form, "onClick")
{
protected void 
onSubmit(AjaxRequestTarget target)
 {
final Component questionComp =
radiochoice.findParent(QuestionGroupPanel.class);
 
 target.add(questionComp);
 
 
 }


@Override
protected void onError(final 
AjaxRequestTarget target){

super.onError(target);
final Component questionComp =
radiochoice.findParent(QuestionGroupPanel.class);
 
 target.add(questionComp);
 
}

In Wicket 1.3 the code was working fine even without the onError method.
Kinda clueless as to what might be happening. Any help would be much
appreciated. Thanks! 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-6-15-Component-not-getting-refreshed-tp4674552.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