• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scrolling Back to Top of page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling Back to Top of page


  • Subject: Re: Scrolling Back to Top of page
  • From: Kaj Hejer <email@hidden>
  • Date: Fri, 29 Oct 2004 23:11:52 +0200


On 22. okt 2004, at 21.38, Calven Eggert wrote:

When a WebObjects page is submitted by a popup, a couple of pages down from the top of a page, the darn page always takes the user to the top of the page when it’s refreshed.  Is there a way to keep the page at the current location without forcing the user to scroll back down?  HOW?



Hi!

We do this with something like:


private String anchor;

public void appendToResponse(WOResponse response, WOContext context) {
if (anchor != null) {
response.setHeader(context.componentActionURL() +
"#" + anchor, "location");
response.setHeader("text/html", "content-type");
response.setHeader("0", "content-length");
response.setStatus(302);
anchor = null;
return;
}
super.appendToResponse(response, context);
}



public String getAnchor() { return anchor; }

    public void setAnchor(String s) {
        anchor = s;
    }


and in the actionmethod where we want to jump to this anchor we use

   MyPage nextPage = (MyPage) pageWithName("MyPage");
   nextPage.setAnchor("myAnchor");
   return nextPage;

and myAnchor is a <a name="myAnchor"></a> in the MyPage component.



-Kaj :)

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Scrolling Back to Top of page (From: Calven Eggert <email@hidden>)

  • Prev by Date: Re: Scrolling Back to Top of page
  • Next by Date: wocode TextDisplayFormatter and WOString's incorrect displays
  • Previous by thread: Re: Scrolling Back to Top of page
  • Next by thread: Hashtable to WOString?
  • Index(es):
    • Date
    • Thread