wicket icon indicating copy to clipboard operation
wicket copied to clipboard

Improvement/ernestosemedt/wicket 7059

Open reiern70 opened this issue 2 years ago • 4 comments

reiern70 avatar Jun 05 '23 08:06 reiern70

In my project, we usually do this when we don't want a page to be serialized after an ajax request:

private void untouchPage(Page page) {
  if (Session.exists()) {
     // Do not re-serialize page
     Session.get().getPageManager().untouchPage(page);
  }
}

Did you consider this approach as well?

theigl avatar Jun 05 '23 09:06 theigl

In my project, we usually do this when we don't want a page to be serialized after an ajax request:

private void untouchPage(Page page) {
  if (Session.exists()) {
     // Do not re-serialize page
     Session.get().getPageManager().untouchPage(page);
  }
}

Did you consider this approach as well?

No. You do this after each AJAX request?

I just want to be able to mark some requests as "do not generate" a page serialization.

reiern70 avatar Jun 05 '23 11:06 reiern70

No. You do this after each AJAX request?

I just want to be able to mark some requests as "do not generate" a page serialization.

Yes, after each ajax request that does not change the stage of the page.

theigl avatar Jun 05 '23 11:06 theigl

I agree with @theigl that you should be able to do this without adding the new API method. For example you could use a IRequestCycleListener that uses Session.get().getPageManager().untouchPage(page); whenever some condition is met, e.g. when a specific RequestCycle metadata is set (in the Ajax callback method).

martin-g avatar Jun 05 '23 12:06 martin-g