简体   繁体   English

通过GWT场所API,如何在不重新加载页面的情况下更改URL / PLACE / Place-Token?

[英]VIA the GWT places API how do you change the URL/PLACE/Place-Token without reloading the page?

We have a giant table of orders in a GWT page. GWT页面中有一个庞大的订单表。 As users click on an order the bottom half of the page loads the details for that order. 当用户单击订单时,页面的下半部分将加载该订单的详细信息。

When OnSelect of an entry in the table I could fire a place change event and change the place token from #OrdersPlace: to #OrdersPlace:123 where 123 is the order number. 当对表中的条目进行OnSelect时,我可以触发地点更改事件,并将地点令牌从#OrdersPlace:更改为#OrdersPlace:123,其中123是订单号。 The problem is that would require the entire table to reload as well. 问题在于,还需要重新加载整个表。

Is there a way to just change the URL from #OrdersPlace: to #OrdersPlace:123 so on a browser refresh I can get back to where I was by reading the Place Token without starting from scratch by reloading the entire activity? 有没有一种方法可以将URL从#OrdersPlace:更改为#OrdersPlace:123,这样在浏览器刷新时,我可以通过读取Place Token返回到原来的位置,而无需从头开始重新加载整个活动?

If you are using Gin you can make the view a singleton and just have it hold onto the existing data. 如果您使用的是Gin,则可以使视图成为单例,并将其保留在现有数据上。 Think of it similar to removing the table from the DOM and then just re-adding it. 认为它类似于从DOM中删除表,然后重新添加它。

There are equivalent ways of doing the same thing without using Gin too. 有同样的方法可以在不使用Gin的情况下完成相同的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM