[Seaside] problems with nil hrefs

Tim Rowledge seaside@lists.squeakfoundation.org
Tue, 23 Jul 2002 10:54:54 -0700


Avi Bryant <avi@beta4.com> is claimed by the authorities to have written:

> On Tue, 23 Jul 2002, Ragnar Hojland Espinosa wrote:
> 
> > I have a little problem with links.  Imagine a component that shows a line
> > like "company-name contact-name" and you can click on either field to show
> > its details.  Now, if a company does not have a contact assigned to it, the
> > contact is going to appear as nil, so I end up with: <a href="badbadbad">nil</a>
> >
> > How to I fix this?  Or rather, whats the right way so you dont have to fix
> > it?
> 
> How about something like this:
> 
> <if sea:id="personName.notNil">
>    <a sea:id="viewPerson:">[personName]</a>
> </if>
I've used this construct in a variety of places and it works very
nicely. Another possibility though is to have your contact page able to
explain that there is no contact on record and how to add one if such is
available. Sort of making a virtue out of a neccessity. Which is better
depends very much on your application and users - and probably on the
mood of your user at the time!

tim
-- 
Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Exclusive: We're the only ones who have the documentation.