Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement/ernestosemedt/wicket 7059 #592

Open
wants to merge 1 commit into
base: wicket-9.x
Choose a base branch
from

Conversation

reiern70
Copy link
Contributor

@reiern70 reiern70 commented Jun 5, 2023

No description provided.

@reiern70 reiern70 changed the base branch from master to wicket-9.x June 5, 2023 08:16
@theigl
Copy link
Contributor

theigl commented Jun 5, 2023

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?

@reiern70
Copy link
Contributor Author

reiern70 commented Jun 5, 2023

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 reiern70 force-pushed the improvement/ernestosemedt/WICKET-7059 branch from 22bc9fb to 1ab5a9d Compare June 5, 2023 11:06
@theigl
Copy link
Contributor

theigl commented Jun 5, 2023

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.

@martin-g
Copy link
Member

martin-g commented Jun 5, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants