Visit Mozilla.org

Talk:XUL:overlay

From MDC

Didn't include inherited attributes, properties, and methods here because the XULPlanet page didn't include them. If they should be included, please add them. Thanks.



What I could use is a way to prefix all the IDs in an included overlay so you could use two or more instances on the same page. I've got a situation where I have a complex of 6 text entry boxes that have to appear in four places in the program, and two are wizard pages in the same wizard so the IDs conflict.

As it is, elements in the overlay retain their exact IDs, so if you include an overlay twice in the same page, you have a conflict for every element with an ID in that overlay. Including the root element.

overlay file:

(overlay blah blah)
  (hbox id="compound-box")
    (label id="label" value="number:")
    (textbox id="entry" value="")
  (/hbox)
(/overlay)

use file:

(hbox id="phone-compound-box" id_prefix="phone-")
(hbox id="fax-compound-box" id_prefix="fax-")

this way for instance the two resulting labels would have ids "phone-label" and "fax-label".

An alternative would be to allow string arguments passed in to overlays, like subroutine arguments. The ID would be one of many places you could concatenate or interpolate these variables in.


--Allanbonadio 11:33, 12 April 2007 (PDT)