Re: Anchors and WO
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.