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

pagination on main.xhtml #6

Closed
MohitSaluja opened this issue Jul 13, 2013 · 6 comments
Closed

pagination on main.xhtml #6

MohitSaluja opened this issue Jul 13, 2013 · 6 comments

Comments

@MohitSaluja
Copy link

value of current page is stored in Session in Main.java
So when your are page>1 and you click on home button than URL will change but list of post will be same as currentPage variable is saved in Session.
I am using standard JSF2 scopes and i have changed scope from 'SessionScope' to 'ViewScope' to resolve this issue.

@nickrussler
Copy link
Owner

So you had the issue that the page did not change upon page change because the value of the current page was stored inside a session bean, could you resolve the problem yourself or is it still present?

@MohitSaluja
Copy link
Author

I have resolved the issue, as i am using standard JSF2 scopes, i have used @javax.faces.bean.ViewScoped instead of SessionScope. But you are using javax.enterprise.context.SessionScoped, So you can not switch to ViewScope.

In your case you can reset currentpage value to 1 when home button is clicked.

@nickrussler
Copy link
Owner

Do you refer to the extended demo source? This is deprecated.

@MohitSaluja
Copy link
Author

you have used SessionScope(javax.enterprise.context.SessionScoped?) in Main.java
if you were using standard JSF scopes(javax.faces.*), you could replace that with ViewScope

@MohitSaluja
Copy link
Author

Ok, So is there any new one???

@nickrussler
Copy link
Owner

Yes, the Demo (https://github.com/nickrussler/commentbox/tree/master/demo-source), i believe the extended demo is way too bloated and the the Demo explains how commentBox works.

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

No branches or pull requests

2 participants