The treeselect, treefold, and treeellipsis attributes respectively select, open/close, or expand the ellipsis of an <al-tree> node via a LazyTreeIterator (5.3.10.8) or EllipsisTreeIterator (5.3.10.9) iterator.
These attributes are ignored if any of the following attributes are present; prevpage, or nextpage (5.2.2.9).
An attribute value must be supplied that specifies the name of the LazyTreeIterator iterator.
The name (5.2.2.5) attribute is generated as follows:
>>> import albatross
>>> ctx = albatross.SimpleContext('.')
>>> class Node:
... def __init__(self, ino):
... self.ino = ino
... def albatross_alias(self):
... return 'ino%d' % self.ino
...
>>> ctx.locals.tree = Node(81489)
>>> albatross.Template(ctx, '<magic>', '''
... <al-tree expr="tree" iter="n">
... <al-input type="image" treeselect="n" srcicons/face.gif" border="0" whitespace>
... </al-tree>
... ''').to_html(ctx)
>>> ctx.flush_content()
<input type="image" srcicons/face.gif" border="0" name="treeselect,n,ino81489">
When merging the browser request the NamespaceMixin.set_value() (7.6) method looks for field names that contain commas. These names are split into operation, iterator, and optional value then the set_backdoor() method of the identified iterator is invoked.
During request merging the above example will execute code equivalent to the following.
ctx.locals.n.set_backdoor('treeselect', 'ino81489', 'treeselect,n,ino81489')
The ``ino81489'' string is generated by calling the albatross_alias() method for the tree node.
If the node(5.2.2.7) attribute is not specified, the node referenced by the current value of the iterator will be used to determine the alias.