You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by SeldonCrisis <nm...@gmail.com> on 2017/11/02 20:12:05 UTC

AjaxRequestTarget not updating after validation

Hello everyone,

I am experiencing some strange behavior in Wicket when attempting to submit
a Form through ajax...

I have a custom panel (*FileUploadPanel* which extends *Panel*) that I
created. It is used to upload files, but it is more robust than a
FileUploadField. 

I have also added a *ComponentFeedbackPanel* to the *WebMarkupContainer*
containing FileUploadPanel:


Whenever my form is submitted, I have logic that checks to see whether any
files have been uploaded to my custom panel. If not, I invoke this code:


and add the WebMarkupContainer that holds this custom panel to the
AjaxRequestTarget:



All of this SHOULD mean that when I submit the form, I see the error message
"This Document is Required" right where I placed my ComponentFeedbackPanel
in the markup. 

BUT it seems that this is not the case, and when I look at the HTML in my
chrome developer console, I see that the Ajax response is missing the span
tag containing my ComponentFeedbackPanel.

If I press any other button on my page that invokes a refresh through
AjaxRequestTarget (For example, the save button which has
defaultFormProcessing set to False), the span tag is included in the HTML
through the ajax response. 

So why is the Ajax response failing to include my
fileUploadPanel.error("This document is required"); message on the form
submit? It is only picked up if I refresh a second time. 

Thanks in advance for your help! 


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: AjaxRequestTarget not updating after validation

Posted by Sven Meier <sv...@meiers.net>.
Hi,

your code didn't make it into the mailing list, but I've checked it on 
Nabble:

I don't see anything wrong and your example should work as you expect it.

Check your markup for misplaced open/close tags, maybe something is 
misinterpreted by Chrome when you update part of the page.
Or create a quickstart showing the problem.

Have fun
Sven


Am 02.11.2017 um 21:12 schrieb SeldonCrisis:
> Hello everyone,
>
> I am experiencing some strange behavior in Wicket when attempting to submit
> a Form through ajax...
>
> I have a custom panel (*FileUploadPanel* which extends *Panel*) that I
> created. It is used to upload files, but it is more robust than a
> FileUploadField.
>
> I have also added a *ComponentFeedbackPanel* to the *WebMarkupContainer*
> containing FileUploadPanel:
>
>
> Whenever my form is submitted, I have logic that checks to see whether any
> files have been uploaded to my custom panel. If not, I invoke this code:
>
>
> and add the WebMarkupContainer that holds this custom panel to the
> AjaxRequestTarget:
>
>
>
> All of this SHOULD mean that when I submit the form, I see the error message
> "This Document is Required" right where I placed my ComponentFeedbackPanel
> in the markup.
>
> BUT it seems that this is not the case, and when I look at the HTML in my
> chrome developer console, I see that the Ajax response is missing the span
> tag containing my ComponentFeedbackPanel.
>
> If I press any other button on my page that invokes a refresh through
> AjaxRequestTarget (For example, the save button which has
> defaultFormProcessing set to False), the span tag is included in the HTML
> through the ajax response.
>
> So why is the Ajax response failing to include my
> fileUploadPanel.error("This document is required"); message on the form
> submit? It is only picked up if I refresh a second time.
>
> Thanks in advance for your help!
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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