How to disable refresh for pagination in Yii2 used pjax - pagination

For pagination in Yii2 I use pjax, but for the application it is necessary to disable the page refresh. I tried to do this with the timeout parameter, but it still does an update, which affects the results of the application. How to disable refresh pjax at all or how to do ajax refresh in pagination without pjax

Related

ViewExpiredException: View could not be restored when user is logged in again

My web app is built on spring boot + spring security + JSF 2.2.12
I have read a lot of posts about the view expired exception, and try to solve it using this proposal.
To be shortly, I have added ?faces-redirect=true to my action methods, added NoCacheFilter to inform browser not cache the dynamic JSF pages. Also I have add expired.xhtml page. Also, I have added custom InvalidSessionStrategy implementation using this sample.
For the case, when I have two tabs in my browser, and perform log out in one tab, and in other I click <p:commandButton which trigger POST request for page navigation, everything works fine, browser redirect me to the login page.
But for case, when I have two tabs in my browser, and in one tab I perform log out and then log in, and in other I click again <p:commandButton, the ViewExpiredException is thrown.
Please, help me to solve this issue. Or tell me what I have missed?

Ajax actions get stuck after a few minutes of page inactivity

If I load a JSF page and do not click anywhere for a few minutes and then try to execute any Ajax action, the page stucks and the Ajax status indicator keep spinning forever.
If I reload the page and try to execute the very same action, everything works great.
I'm using JSF with Primefaces and this behaviour reproduces on all my webapp's pages.

Prevent direct access to some page in JSF

I want to restrict direct access to certain page in my application. Those pages can only be accessible if the user is redirected to those pages by the application.
All the redirections are done via ExternalContext#redirect(url) method.
User can use back and forward button, also can refresh the page by pressing F5 or via browser's refresh button. What I want is user cannot save, or bookmark URLs of some page, also cannot copy those redistricted URL and paste and go via address bar of the browser.
Followings are the cases:
Say, I have Page-A and Page-B.
Redirection is done to Page-B from Page-A.
User can go back to Page-A and can come again to Page-B by using browser's back and forward button.
User can refresh Page-B and he/she will stay in Page-B.
User CANNOT copy the URL of Page-B and access it later time (in new tab or by bookmarking).
Is it feasible? Any pointer would be very helpful to me.
I don't think you can do all that from JSF.
Your obvious alternative is to use Javascript.
I never herd a concept of disabling Bookmark option in Browser using Javascript. However you can always disable the address field if you open the page in new Window.
You can solve it with
JSF Navigation Handler - set a session attribute from some previous page and expire the value after some time with a timer. From the Handler impl check the value of the attribute and restrict access e.g. redirect to some other page in case the value is not present.
You can achieve similar behaviour with web frameworks. Enforcing controlled navigation is a basic feature in most WEB FXs e.g. JBoss Seam conversations or Spring Web Flow controlled navigation implementations.

Browser back button navigation

Whenever browser back is clicked, it must not navigate to the previous page but to some default page. how is it done using JSF ?
Clicking on browser back button requests the result page from the browser cache.
This is a client side activity. It doesn't send request to your server for fetching some default page(in your case).
Please refer this post for writing a filter indicating the browser not to cache dynamic JSF pages.
And also you can refer this one for more details.
You can try to detect if User has clicked on browser back button by writing client side code.
Refer this post for detecting back button click.
If you are trying to alter the behaviour of browser back button, it indicates some kind of flaw in your application.

PageLoad not called in Sharepoint web part

I have a number of pages with custom harepoint visual web parts. In the page load of these web parts, i am doing some logic which i need to trigger every time the page loads. the problem is that when i use the browser back button, or javascript, to redirect the user to the previous page, the pageload is not being invoked. it seems like the page is being retrieved from a cache. can this be disabled easily? is there any other workaround to ensure that the code fires every time the page is rendered?
Using the back button will load from cache, you are correct in that.
To disable cache, you need to set an "expires" = -1 meta tag in the head section of the page but this seems a bit drastic in order to fire logic for a page.
I'd suggest using the jQuery document ready approach rather than page load. This will fire regardless of where the page information is loaded from.
$(document).ready(function() {
// Insert code here
});

Resources