[Seaside] How to append an anchor name to a Seaside url?

Julian Fitzell julian at beta4.com
Wed Mar 3 18:12:14 CET 2004


There currently isn't a particularly easy way.  I noticed Avi had 
written some code to do this automatically in a development branch but 
I'm not sure if we've released it... suspect not.

First off, I'll express my bias that you're much better off using 
smaller pages so the user doesn't have to scroll (whenever you can 
manage it).  Because seaside makes stringing components together so 
easy, there's no longer the drawback to this approach that you would 
have in something like PHP or ASP where you'd end up with a million 
pages passing variables around.  The main reason is that even if you use 
anchors, the page will not reload in exactly the same spot.  Every page 
load, they need to figure out again where the buttons have moved to 
under their mouse, etc.  Using anchors in the URL is better than 
nothing, but we've taken the approach of, for example, splitting large 
forms up into wizards that take them through entering the data in 
several steps.  This has made it a very rare case that you need to 
scroll the page.

That said, if there are cases where you need to put anchors in the URL, 
have a look at #anchorWithAction:do: and #openAnchorWithAction: on 
WAHtmlRenderer.  You'd probably want to add something like 
#anchorWithAction:anchor:do: that does basically what 
#openAnchorWithAction: does, but also appends the anchor to the URL.

Julian

Felix Franz wrote:

> Hi all,
> 
> is it possible to append a anchor name to a seaside url?
> 
> Sometimes it would be nice if clicking a link or submitting a form would 
> allow to append an anchor to the url. For example: try the 
> "multi"-Example in a small browser window. Scroll down to the last 
> counter and click "--". The page reloads and the user has to scroll down
> to see the result.
> 
> I need a url like this one:
> 
> http://localhost:6669/seaside/multi/@LXZjtjNiDersktLi/EqVflZXR#anchor
> 
> where the page contains a <a name="anchor"> in the right place. The 
> a-tag is easy, but how do I append the #anchor to the url?
> 
> Thanks in advance,
> 
> felix
> 
> 
> 
> PS: I am working on my first deployed seaside application and so far it 
> works very well.
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside

-- 
julian at beta4.com
Beta4 Productions (http://www.beta4.com)



More information about the Seaside mailing list