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

Ate Douma commented on WICKET-649:
----------------------------------

Fixing wicket-ajax.js Wicket.Ajax.Request.get(path) calls which have query 
parameters appended to the path:

In a lot of places (both in Java like in AjaxEditableLabel.onComponentTag(tag) 
and in javascript/ajax libraries like wicket-autocomplete.js 
Wicket.AutoComplete.updateChoices()),
direct manipulation/appending of the callback url is done before it is invoked 
through Wicket.Ajax.Request.get().  

But, the only way to send extra parameters to Wicket from the client 
(javascript, Ajax) from within a portlet context is using a POST using a 
pre-generated portlet url (the callback url) as action url.

To solve this most transparently (for now), I will extend 
Wicket.Ajax.Request.get() as follows:
If the provided url contains a query String, I'll strip it from the url and 
then delegate it through Wicket.Ajax.Request.post(queryString).

This way, no other changes are needed and it works transparently both in a 
servlet and a portlet context.
This might not be the best solution and it does mean a technical change for a 
pure servlet environment, but the behavior and end result stays the same.

Maybe a "cleaner" solution would be to be able to recognize/know within the 
client Ajax libraries if it is running in a portlet context and only then do 
the above.
But  that would require more changes and I don't think it is necessary nor 
worth the trouble (yet).
Before merging the portlet-support into Wicket trunk, this solution needs to be 
reviewed and discussed if its fine as is, or possible needs further refinement.




> New Wicket Portlet support: fix appending query parameters
> ----------------------------------------------------------
>
>                 Key: WICKET-649
>                 URL: https://issues.apache.org/jira/browse/WICKET-649
>             Project: Wicket
>          Issue Type: Sub-task
>          Components: wicket-portlet
>    Affects Versions: 1.3.0-beta2, 1.3.0-beta3
>            Reporter: Ate Douma
>            Assignee: Ate Douma
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to