On Sat, Jun 30, 2012 at 2:43 PM, Daniel Gonzalez <gonva...@gmail.com> wrote:
>
> For reference: I have solved my problem with:
>
> self.getContainerElement().setAttribute('class', 'dialog-div')

this works because you are essentially abusing the fact that the pyjs
API *happens* (by design) to match the DOM spec/api, and thus your
compiled code is properly calling the `setAttribute` method inherent
to all standard DOM objects ...

... this however, should not be relied on.  for example, on some
platforms, it's actually `setProperty` that does the dirty work.

instead, pass all DOM operations thru the DOM.py module -- so
per-platform fixes/alterations take effect -- adhering to this pattern
[mostly] ensures compatibility across all supported platforms.

`self.getContainerElement()` returns a raw DOM object, and for nearly
all intents-and-purposes, should be treated as a method-less,
property-less, knowledge-less BLACK-BOX, of which you do and can know
nothing.  for you, the astute developer, there exists only one module
with the proper know-how for operating on one of these elusive
creatures -- DOM.py.

tl;dr, try [untested]:

DOM.setAttribute(self.getContainerElement(), 'class', 'dialog-div')

-- 

C Anthony

Reply via email to