File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Refresh and put the view at the top of page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Refresh and put the view at the top of page" Watch "Refresh and put the view at the top of page" New topic
Author

Refresh and put the view at the top of page

Mario Gimenez
Ranch Hand

Joined: Mar 23, 2010
Posts: 38
Hi, I have a problem whit my page in jsf.
I have this situation.
For example:

I have radiobuttons on my jsf page



The problem is, when I clic in some radiobutton, the page "refresh" with the new value of my radiobutton. but the problem is, the page not maintain the same position, only reload and put the page at the top

PD: sorry for my english.
It's possible to maintain the position of my page and refresh??

thanks!

Bajrang Asthana
Ranch Hand

Joined: May 24, 2011
Posts: 32
You can do it either using Ajax call or set focus of page using javascript like below-



Personally I recommend to you, use Ajax call and render the part of page which is needed.

-Bajrang
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16160
    
  21

Bajrang Asthana wrote:
Personally I recommend to you, use Ajax call and render the part of page which is needed.

-Bajrang


The technical term for this is "partial page update".

Normally when you submit a form, a request is made to the server, the server processes the request and a new page is returned to be displayed. And, as you have noted, the page display changes in potentially annoying ways.

If you use AJAX, you can make a partial page update. What actually happens is that an internal submit request/response cycle is made, but instead of displaying the returned response as a new page in the client, the response data comes back to the AJAX processing code, which then uses it to adjust the current page display (DOM). You will often refine this with a partial form submit, since the entire request will be rejected (and the page won't update) if any control on the submitted form has an invalid value in it.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Refresh and put the view at the top of page