[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-ui
Subject:    Re: how to get access over template generated textbox
From:       Neil <neil () parkwaycc ! co ! uk>
Date:       2004-08-23 16:19:32
Message-ID: cgd5ek$js33 () ripley ! netscape ! com
[Download RAW message or body]

Markus Siebeneicher wrote:

> my template with rdf-datasource as background produce a lot of textbox 
> elements. there is also a save button to get the new values of the 
> textboxes, a js funtion should save the data as facts to my 
> rdf-datasource. fine, but how to get the values of the textbox 
> elements? i tried to define id's for any elements, but in templates 
> they dont work, they just refer to the xul-elements not, not the 
> produced content by the template...

As you noticed, ids are ignored by templates. However, one of your 
elements should have uri="rdf:*", then the generated elements will get 
given an id that is the same as the RDF resource that matched the rule.
Example:
<menu datasources="rdf:null">
    <template>
       <menupopup>
          <menuitem uri="rdf:*"/>
       </menupopup>
    </template>
</menu>
Each matching RDF resource from the data source will generate a menuitem 
which will be given the id that is the value of the RDF resource.
If you were using cascading menus then you would still be able to get at 
any of the submenus this way, but the popups would be harder to address; 
you would have to use .firstChild or .parentNode after having obtained a 
suitable nearby element.

-- 
Warning: May contain traces of nuts.
_______________________________________________
Mozilla-ui mailing list
Mozilla-ui@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-ui
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic