[Zope-Moz] PropertyView - The story so far

Shalabh Chaturvedi shalabh@pspl.co.in
Thu, 17 Feb 2000 21:25:39 +0530


My mistake - responding to Waterson's message and not copying to this list -
- now corrected.

----- Original Message -----
From: Shalabh Chaturvedi
To: Chris Waterson ; mozilla-xpfe at mozilla.org
Subject: Re: Apps that dance with RDF and XUL
> Chris Waterson wrote:
> > ...but I think you should be able to do what you want with a single
> > "flat" template that uses the (undocumented?) "parent" attribute. See,
> > for example,
> > http://lxr.mozilla.org/mozilla/source/xpfe/browser/resources/content/
> > navigator.xul#272.
> > The value of "parent" is matched against the enclosing content tag.
>
> (Aha!)
> Thanks...this (and a helpful dialogue with Martijn Pieters) led to what
> seems to be The Correct Solution to the problem.
>
> However there are some things not very clear to me about the way it
> works.
>
> Consider the following template (from navigator.xul):
>
> 238         <template>
> 239           <!-- Recursive rules for nested folders -->
> 240           <rule iscontainer="true">
> 241             <menupopup>
> 242               <menu class="standard" uri="rdf:*"
> 243                 value="rdf:http://home.netscape.com/NC-rdf#Name" >
> 244                 <menupopup class="standard"/>
> 245               </menu>
> 246             </menupopup>
> 247           </rule>
> ...
> 253           <rule>
> 254             <menupopup>
> 255               <menuitem class="standard" uri="rdf:*"
> 256                 value="rdf:http://home.netscape.com/NC-rdf#Name"
> 257                 oncommand="OpenBookmarkURL(event.target,
>                     document.getElementById('PersonalMenu').database)"/>
> 258             </menupopup>
> 259           </rule>
> 260         </template>
>
>
> There is an empty menupopup on line 244. Is it correct that the menupopup on
> line 254 'overlaps' with the empty one when the last rule is applied; and as
> a
> result there is no empty menupopup once the content generation is complete?
>
> Is it necessary to keep an element empty if such an 'overlap' is desired? In
> the above example what will happen if there were two <menupopup>s in the
> first rule? Which one would be overlapped?
>
> Also I'd like to know :
>
> 1. Is it possible to match the class or other attribute of a parent tag in a
>     rule?
>     Something like:
>
>     <rule parent="box.selectionPropertyBox"> which matches a box only if
>     the class of the box is 'selectionPropertyBox'.
>
> 2. If the content generation mechanism for a template is identical for all
>     elements (be it a box, treeitem or menuitem). That is, is the template
>     applied recursively and in an identical fashion irrespective of the
>     kind (box, treeitem,menuitem) of child-resource-element ?
>
>     If it is so then I should be able to generate _nested_ boxes using one
>     template like so:
>
>    <template>
>       <box uri="...">
>           (my tags)
>       </box>
>    </template>
>
>     Why I'm asking is because it didn't seem to work when I tried it.
> Although the same RDF did generate a multi-level tree using a tree in the
> template.
>
>
> > Why? I think that the folks working on the browser's charset menu are
> > facing a similar problem. Can't you just do something like:
> >
> >   <template>
> >     <html:option selected="urn:whatever:am-i-selected" />
> >   </template>
> >
> > And have the "urn:whatever:am-i-selected" property's value be the
> > literal "true" or "false"?
>
> You mean that I use two rules for the two cases - since the presence
> and not the value of the 'selected' attribute implies if it is selected.
> The problem I have is really what I have discussed above already - that
> this select is itself inside a template - and it looks almost solved.
>
> > chris
>
> Thanks a lot,
> Shalabh
> ____________________
> "If you can't zen it, grok it"