I will look at this, as it might have some ideas or direction to go.  To 
further explain, it is more than just parameters, and parts of the url change 
for SEO.  For example...  https://xxx.xxx.xxx/parts/atv-parts would have 
changed to https://xxx.xxx.xxx/parts/street-parts based on a combobox drop 
down.  They stay on the page, but the content is changed and the history is 
left as is.  When the first AJAX event comes through causing the url to change, 
and components on the page are refreshed through the AjaxRequestTarget.  When 
the next combobox AJAX event happens, the request has the original URL in the 
httpRequest because the components on the page, even though they were 
refreshed, they still have the wrong action url.  They need to be able to be 
refreshed with the new url.  

-----Original Message-----
From: Bergmann Manfred <m...@software-by-mabe.com> 
Sent: Saturday, May 15, 2021 2:10 AM
To: users@wicket.apache.org
Subject: [EXTERNAL] Re: URL changes from AJAX request

WARNING: This email originated from outside the organization. Do not click 
links, open attachments, or enter user credentials, unless you recognize the 
sender and know the content is safe.


Hi.

We have been using wicketstuff urlfragment for something similar.
https://github.com/wicketstuff/core/tree/master/urlfragment-parent
I can’t remember exactly how this urlfragment worked, I believe it’s also doing 
some JavaScript magic. But I think it’s not using history API.


Manfred


> Am 14.05.2021 um 23:00 schrieb Michael Pritt 
> <michael.pr...@westringtechnologies.com>:
>
> I've been searching for help with this issue on the web concerning URL 
> modifications that we need to do from doing an AJAX request (for example 
> adding a sort parameter when a sort option is selected but stay on the page). 
>  We don't want to do a redirect and have the redirect added to the history 
> (i.e. back button), and we are refreshing only the necessary components on 
> the page (see related link:  
> https://stackoverflow.com/questions/6576354/changing-url-via-ajax-using-wicket).
>
> However a couple of the components need to be refreshed with the slightly 
> updated url.  For example the Form component on the page, the action URL 
> needs to be updated so when requests come from combo boxes during the 
> onChange() event will have the right request URL.
>
> What is the best way to make this work.   Here is what we are doing now and 
> what is happening:
>
>
>  1.  Combo Box drop down causes an AJAX event (i.e. sort selection), during 
> the event javascript is generated to update the browser URL using the 
> AjaxRequestTarget. appendJavaScript().  (The javascript updates the url using 
> the history API).  Other components are refreshed on page as needed.
>  2.  Another combo box on the page then is then selected causing another AJAX 
> event, and in this case the wrong request URL is given (it is the old 
> original one).  Looking at the page source the action url for the form has 
> the old url.
>
> Thoughts on how to make this work?  Can we do a complete page 
> refresh/redirect to not affect history or somehow let Wicket know during the 
> AJAX event that the URL will be changed and this is the one to use to refresh 
> the components with (especially the form action url)?
>
> Thanks in advance,
>
> Mike


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


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

Reply via email to