[Zope] Tree Tag Options

Mitch Chapman mchapman@OEE.com
Tue, 02 Feb 1999 16:51:46 -0500


Amos Latteier wrote:
> 
>     def tpId(self):
>         """Return a value to be used as an id in tree state."""

I've had some problems relating to the tpId() method.  Can somebody
help sort this out?

After staring at the HTML source for a DTML tree, I eventually
realized that tpId()'s return value is used as an HTML "internal"
anchor (waddayacallit, it's referenced by 
<A HREF="doc#anchor">...</A>).  So it needs to return a string which
makes a valid HTML anchor.

The HTML generated for a tree node looks something like this:

<TR>
<TD WIDTH="16" VALIGN="TOP"><A NAME="someTpIdValue"><A HREF="index_html?tree-e=eJyLVvfMKy5JzMlJLMnMz1MISi3ILyopVtdRUPd3VPArzU1KLVIwUNBwTy3KTcxTcEnMy0zNKdZUjwUAJQAStg#someTpIdValue"><IMG SRC="/cgi-bin/myapp/p_/pl" BORDER=0></A></TD>
<TD VALIGN="TOP" ALLIGN="LEFT">    some text
    </TD>
</TR>

Problems:
	There's no close tag for the anchor (or for the
	hyperlink, depending on your point of view).

	'ALLIGN' should be 'ALIGN'.

The second problem is no big deal, but the first one has bad
consequences: If I use a valid anchor name, then when I click on a
tree node (using Netscape Navigator 4.x), nothing happens.  But if I
change tpId() to return an invalid anchor name (e.g. something
containing blanks or parentheses), then when I click on a tree node it
expands and contracts as expected.

What am I doing wrong?  (Lemme know if you need to see
code.)  Thanks for any help.

-- 
Mitch Chapman			  |	4105 Executive Drive
Ohio Electronic Engravers, Inc.	  |	Beavercreek, OH  45430
mchapman@oee.com		  |	import StandardDisclaimer