You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2012/07/08 12:23:34 UTC

[jira] [Commented] (WICKET-4643) AjaxFormChoiceComponentUpdatingBehavior not set model object

    [ https://issues.apache.org/jira/browse/WICKET-4643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408889#comment-13408889 ] 

Sven Meier commented on WICKET-4643:
------------------------------------

When wicket-ajax-jquery calls jQuery.ajax(), it passes the serialized field as the settings' data. But since the choice is not actually a form component, data is empty.

Since data is empty, jQuery doesn't set the default content-type (would be application/x-www-form-urlencoded):

	if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
		jqXHR.setRequestHeader( "Content-Type", s.contentType );
	}

settings.data *is* changed in beforeSend() via AjaxFormChoiceComponentUpdatingBehavior's attrs.dep (dynamic extra parameters), but this is too late for the content-type.

Without "application/x-www-form-urlencoded" contentType, Wicket doesn't get hold on the post parameters via request#getParameter().

I've fixed the problem by using a GET instead of a POST. I'm not sure whether it would be better to evaluate attrs.dep *before* invoking jQuery's ajax() though.
                
> AjaxFormChoiceComponentUpdatingBehavior not set model object
> ------------------------------------------------------------
>
>                 Key: WICKET-4643
>                 URL: https://issues.apache.org/jira/browse/WICKET-4643
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: dan simko
>         Attachments: quickstart1.zip
>
>
> AjaxFormChoiceComponentUpdatingBehavior cause ajax request but model object is not set. Quickstart is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira