You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Simon Botting (JIRA)" <ji...@apache.org> on 2012/11/08 12:05:11 UTC
[jira] [Created] (WICKET-4860) links do not resolve properly in
custom ajax update
Simon Botting created WICKET-4860:
-------------------------------------
Summary: links do not resolve properly in custom ajax update
Key: WICKET-4860
URL: https://issues.apache.org/jira/browse/WICKET-4860
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.5.9, 1.5.8, 1.5.7, 1.5.6, 1.5.5
Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
Reporter: Simon Botting
Priority: Minor
Attachments: wicket-issue-1.tar.gz
I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
When the page initially renders the widget and the default results show.
When the filter is changed and an "apply filter" button is clicked, the results update.
The results are displayed through a ListView, one of the components added to each ListItem is a link.
This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
I've attached a quickstart that shows this:
To replicate the error:
Click the link "List Gromets" above.
You will see a page with a list of ten items, the url of the page is something like
http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
Mouseover one of the links in the list and the url will be something like:
http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
the actual url in the link is:
../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
Click the link and it will resolve properly and display a Gromet display page
Go back to the "List Gromets" page
Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
The results will update.
Mouseover one of the links in the list and the url will be something like:
http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
the actual url in the link is:
./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
Click the link and it will not resolve properly and produce a page not found.
The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
As an aside I've added a standard ajax link updating the results and that works fine
Let me know if you need any more information.
Cheers
Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (WICKET-4860) links do not resolve
properly in custom ajax update
Posted by "Simon Botting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494109#comment-13494109 ]
Simon Botting edited comment on WICKET-4860 at 11/9/12 4:51 PM:
----------------------------------------------------------------
Hi Sven, thanks for your suggestions I had a look at them and tried a few variations and came up with the following (attached as GrometFilterResultsBehavior4.java GrometFilterResultsBehavior4Init.js)
Then in my client page I added the following code:
Label filterButton4 = new Label("ajaxBehaviorFilterButton4", "Do Custom AbstractStandardAjaxBehavior with wicketAjaxGet Filter");
filterButton4.setOutputMarkupId(true);
filterButton4.add(new GrometFilterResultsBehavior4() {
@Override
protected void respond(AjaxRequestTarget _target) {
log.debug("responding extended AbstractEventBehavior");
_target.add(getResultsComponent());
}
});
This seemed to work fine.
My one question is whether the file
GrometFilterResultsBehavior4Init.js
Which calls wicketAjaxGet is the best way to do the calling of the server, in the app code I'd add the filter criteria by
doing
var myFilterCriteria = callToComplicatedJqueryWidget();
wicketAjaxGet("${callbackUrl}&" + myFilterCriteria,
function() {}.bind(theTarget),
function() {}.bind(theTarget),
null);
Is this the best way to do it, in your suggestion code in the AjaxJQueryEventBehavior you write the client call through the renderHead method as follows:
String javascript = String.format("$('%s').bind('%s', function(_event) { %s });",selector, event, getCallbackScript());
response.renderOnDomReadyJavaScript(javascript);
but this prevents me from adding any "GET" data which has the filter criteria, thats the reason I use the TextTemplate and my own init javascript file.
Any suggestions?
Cheers
Simon
was (Author: sbotting):
Hi Sven, thanks for your suggestions I had a look at them and tried a few variations and came up with the following (attached as GrometFilterResultsBehavior4.java GrometFilterResultsBehavior4Init.js)
Then in my client page I added the following code:
Label filterButton4 = new Label("ajaxBehaviorFilterButton4", "Do Custom AbstractStandardAjaxBehavior with wicketAjaxGet Filter");
filterButton4.setOutputMarkupId(true);
filterButton4.add(new GrometFilterResultsBehavior4() {
@Override
protected void respond(AjaxRequestTarget _target) {
log.debug("responding extended AbstractEventBehavior");
_target.add(getResultsComponent());
}
});
This seemed to work fine.
My one question is whether the file
GrometFilterResultsBehavior4Init.js
Which calls wicketAjaxGet is the best way to do the calling of the server, in the app code I'd add the filter criteria by
doing
var myFilterCriteria = callToComplicatedJqueryWidget();
wicketAjaxGet("${callbackUrl}&" + myFilterCriteria,
function() {}.bind(theTarget),
function() {}.bind(theTarget),
null);
Is this the best way to do it, in your suggestion code you simply add getCallbackJavascript() but this prevents me from adding any "GET" data which has the filter criteria.
Cheers
Simon
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, GrometFilterResultsBehavior4.java, GrometFilterResultsBehaviorInit4.js, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Simon Botting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493491#comment-13493491 ]
Simon Botting commented on WICKET-4860:
---------------------------------------
Hi Sven,
Thank you for taking the time to look at this.
I'm relatively new to Wicket so I'm not sure what the standard way of calling and handling an ajax response from a custom jQuery widget is.
Regards the page Id incrementing, and then the subsequent AjaxRequestTarget being stored in the session these are both side affects that I was unaware of.
If there is an standard way to scheduling an AjaxRequestTarget from my own serverside javascript and then handling the response please tell me what it is or point me to
a resource where I can learn about it.
I'm doing it in this (complicated) way as I'm using my own client side javascript which interacts with a jquery filter widget.
in the javascript of the example the ajax call is:
$("#${filterButtonId}").bind("click", function(_event) {
$.ajax({
url:"${callbackUrl}",
cache:false,
async:false,
dataType:'xml',
error:function (_jqXhr, _textStatus, _errorThrown) {
alert("error: " + _textStatus + " / " + _errorThrown);
},
success:function (_data, _textStatus, _jqXhr) {
var wicketAjaxCall = new Wicket.Ajax.Call();
wicketAjaxCall.loadedCallback(_data);
}
});
});
However in my actual app code I add: the
data : _filterData,
to the .ajax call and the _filterData variable contains information that comes from a non trivial filter widget, the old version of the widget is here:
http://www.enbuenosaires.com/properties-for-sale.html
I haven't included the jquery filter widget as its not relevant to the issue with the urls that I was having.
Hope this helps understand the context,
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494169#comment-13494169 ]
Sven Meier commented on WICKET-4860:
------------------------------------
Sure, if you're in need of more javascript it makes sense to put it into its own file. You have to take care of the extra parameters you need.
Be prepared that this stuffs changes slightly in Wicket 6:
http://wicketinaction.com/2012/07/wicket-6-javascript-improvements/
Please ask further questions on the user list.
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, GrometFilterResultsBehavior4.java, GrometFilterResultsBehaviorInit4.js, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493265#comment-13493265 ]
Sven Meier commented on WICKET-4860:
------------------------------------
Since you custom ajax request is missing the Wicket-Ajax header, part of Wicket thinks it has to handle a non-ajax request, thus incrementing the page id (which is not done for an ajax request). But later on your behavior schedules an ART, leading to the new page version not being stored in the session.
Is there a particular reason, why you're doing it so complicated? From your example it looks like you just want to handle error cases on the client side?
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sven Meier closed WICKET-4860.
------------------------------
Resolution: Not A Problem
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, GrometFilterResultsBehavior4.java, GrometFilterResultsBehaviorInit4.js, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Simon Botting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simon Botting updated WICKET-4860:
----------------------------------
Attachment: GrometFilterResultsBehaviorInit4.js
GrometFilterResultsBehavior4.java
Hi Sven, thanks for your suggestions I had a look at them and tried a few variations and came up with the following (attached as GrometFilterResultsBehavior4.java GrometFilterResultsBehavior4Init.js)
Then in my client page I added the following code:
Label filterButton4 = new Label("ajaxBehaviorFilterButton4", "Do Custom AbstractStandardAjaxBehavior with wicketAjaxGet Filter");
filterButton4.setOutputMarkupId(true);
filterButton4.add(new GrometFilterResultsBehavior4() {
@Override
protected void respond(AjaxRequestTarget _target) {
log.debug("responding extended AbstractEventBehavior");
_target.add(getResultsComponent());
}
});
This seemed to work fine.
My one question is whether the file
GrometFilterResultsBehavior4Init.js
Which calls wicketAjaxGet is the best way to do the calling of the server, in the app code I'd add the filter criteria by
doing
var myFilterCriteria = callToComplicatedJqueryWidget();
wicketAjaxGet("${callbackUrl}&" + myFilterCriteria,
function() {}.bind(theTarget),
function() {}.bind(theTarget),
null);
Is this the best way to do it, in your suggestion code you simply add getCallbackJavascript() but this prevents me from adding any "GET" data which has the filter criteria.
Cheers
Simon
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, GrometFilterResultsBehavior4.java, GrometFilterResultsBehaviorInit4.js, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Simon Botting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simon Botting updated WICKET-4860:
----------------------------------
Attachment: wicket-issue-1.tar.gz
please look at the home page for instructions on how to replicate the bug // issue
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sven Meier updated WICKET-4860:
-------------------------------
Attachment: AjaxJQueryEventBehavior.java
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Simon Botting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494245#comment-13494245 ]
Simon Botting commented on WICKET-4860:
---------------------------------------
Great,
Thanks for your time and help and also for the advice about when I move over to version 6.
Cheers
Simon
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, GrometFilterResultsBehavior4.java, GrometFilterResultsBehaviorInit4.js, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-4860) links do not resolve properly in
custom ajax update
Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493912#comment-13493912 ]
Sven Meier commented on WICKET-4860:
------------------------------------
I've attached a possible solution, see AjaxJQueryEventBehavior.java. It attaches an event handler to a jquery widget.
Usage:
<span style="cursor:pointer;color:blue;text-decoration: underline;" id="jqueryFilter">
Click Here To Do Custom Ajax Behavior Filter
</span>
<span wicket:id="jqueryFilterDelegate"></span>
WebMarkupContainer filterDelegate = new WebMarkupContainer("jqueryFilterDelegate");
filterDelegate.add(new AjaxJQueryEventBehavior("#jqueryFilter", "click") {
@Override
protected void onEvent(AjaxRequestTarget _target) {
_target.add(getResultsComponent());
}
});
add(filterDelegate);
Beware, it's just an idea to get you started.
> links do not resolve properly in custom ajax update
> ----------------------------------------------------
>
> Key: WICKET-4860
> URL: https://issues.apache.org/jira/browse/WICKET-4860
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9
> Environment: windows 7, intellij 11.1.4, jdk 1.6.0_30, jetty
> Reporter: Simon Botting
> Priority: Minor
> Attachments: AjaxJQueryEventBehavior.java, wicket-issue-1.tar.gz
>
>
> I've got a page that has a filter widget in it and a summary list of results that correspond to the filter criteria.
> When the page initially renders the widget and the default results show.
> When the filter is changed and an "apply filter" button is clicked, the results update.
> The results are displayed through a ListView, one of the components added to each ListItem is a link.
> This link resolves fine for the default results but when the filter widget is changed and the results updated, the link does not resolve.
> I've attached a quickstart that shows this:
> To replicate the error:
> Click the link "List Gromets" above.
> You will see a page with a list of ten items, the url of the page is something like
> http://localhost:8080/wicket/bookmarkable/wicketissue1.pages.ListGrometsPage?5
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ../page?5-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will resolve properly and display a Gromet display page
> Go back to the "List Gromets" page
> Click the "pseudo" ajax link "Click Here To Do Custom Ajax Behavior Filter"
> The results will update.
> Mouseover one of the links in the list and the url will be something like:
> http://localhost:8080/wicket/bookmarkable/page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> the actual url in the link is:
> ./page?53-1.ILinkListener-results-gromets-0-displayGrometLink
> Click the link and it will not resolve properly and produce a page not found.
> The issue is that when the results are updated through ajax using an AbstractAjaxBehavior "GrometFilterResultsBehavior" the links don't resolve properly.
> In the first case the urls are written out with "../" and in the second just "./" I assume this is something to do with the context of the ajax call to the server.
> I've looked at the Link getUrl() and Link.urlFor() which in turn calls up Component and RequestCycle.
> I don't know whether this is an issue with ajax or simply something that I'm doing wrong or not understanding properly about the way wicket works.
> As an aside I've added a standard ajax link updating the results and that works fine
> Let me know if you need any more information.
> Cheers
> Simon
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira