سؤال

So I've got kind of an interesting problem. I have a wicket page that contains a datatable and a fusionchart (flash chart) that uses a webresource to retrieve it's xml data file. The problem I've got is that when you use the page number or sorting links in the datatable, it reloads the page and changes the URL such that the chart can't get its data anymore.

e.g. Before using the sorting links (this data url works for the chart) vreports/wicket:interface/:5:tabs:panel:prodGraph::IResourceListener:: (this is the url for the base page: /vreports.5)

After using the sorting links (this data url doesn't work) vreports/wicket:interface/:5:tabs:panel:prodGraph:1:IResourceListener:: (base page url: /verports.5.1)

My question is how can I isolate the webresource URLs that the chart uses from the datatable links? I see that the problem is the .1 that gets added, if you click it multiple times it increments by one and the change in the web resource URL matches. What's especially odd is if I refresh the page after using the sort functions, the sort remains in effect, but the chart (and the correct URL) come back. I'm new to wicket and I can't really find much information on how it's URL structure works regarding this.... any thoughts?

Thanks in advance!

Sam

هل كانت مفيدة؟

المحلول 2

I ended up converting my datatable to an AjaxDefaultFallbackDataTable and I have all the pagination and sorting done in Ajax so the URLs don't change because the page isn't refreshed. The AjaxDefaultFallbackDataTable uses the same DataProvider as the the DataTable, it just handles everything in AJAX, so it might be an easy/preferable alternative to anyone with the same issue. Literally all I had to change was everywhere I had DataTable, I switched it to an AjaxDefaultFallbackDataTable and it works great!

Thanks to everyone for looking! Sam

نصائح أخرى

I think you are using OrederBYBorder for sorting.

Try this one

this.add(new AjaxFallbackOrderByBorder(id,fieldName, issueSortable) {

                private static final long serialVersionUID = 1L;
                @Override
                protected void onSortChanged() {
                    dataView.setCurrentPage(0);
                }
                protected void onAjaxClick(AjaxRequestTarget target) {
                    target.addComponent(componentName);
                }
   }); 

Also use BookmarkablePageLink to come on this page or StatelessLink means using those link to come on fusionchart page.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top