• 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: Anchors and WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anchors and WO


  • Subject: Re: Anchors and WO
  • From: Art Isbell <email@hidden>
  • Date: Mon, 23 Feb 2004 21:25:08 -1000

On Feb 23, 2004, at 8:39 PM, Brendon Allen wrote:

Or I guess I am asking how do I append a #<anchor> to end of URL from the Java code.

On Jan 5, 2004, at 11:40 AM, Kaj Hejer wrote:

We have the following code in the class we use as superclass for all our components:

   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;
} else {
super.appendToResponse(response, context);
}
} // appendToResponse



public String getAnchor() { return anchor; }

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


In the component where we want to use an anchor we just put in

<a name="myanchor"></a>

and something like the following in the code where we want to jump to this anchor:

  protected WOComponent doSometingAndJumpToAnchor() {
      // do something :)
      setAnchor("myanchor");
      return null;
  }

Aloha, Art _______________________________________________ webobjects-dev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev Do not post admin requests to the list. They will be ignored.

References: 
 >Anchors and WO (From: Brendon Allen <email@hidden>)

  • Prev by Date: Anchors and WO
  • Next by Date: RE: EOF and Tomcat Issue.
  • Previous by thread: Anchors and WO
  • Next by thread: Re: Subcomponent Refresh
  • Index(es):
    • Date
    • Thread