def __init__(self, text=None, forid=None, wordWrap=True, **kwargs): if not kwargs.has_key('Element'): element = DOM.createLabel() if forid: element.setAttribute("for", forid) kwargs['Element'] = element Label.__init__(self, text, wordWrap, **kwargs)
def initElement(self, element, **ka): self.inputElem = element self.labelElem = DOM.createLabel() element = ka.pop('Element', None) or DOM.createSpan() ButtonBase.__init__(self, element, **ka) self.sinkEvents(Event.FOCUSEVENTS | Event.ONCLICK) DOM.appendChild(self.getElement(), self.inputElem) DOM.appendChild(self.getElement(), self.labelElem) uid = "check%d" % self.getUniqueID() DOM.setAttribute(self.inputElem, "id", uid) DOM.setAttribute(self.labelElem, "htmlFor", uid)
def initElement(self, element, **ka): self.inputElem = element self.labelElem = DOM.createLabel() element = ka.pop('Element', None) or DOM.createSpan() ButtonBase.__init__(self, element, **ka) self.sinkEvents(Event.FOCUSEVENTS | Event.ONCLICK) DOM.appendChild(self.getElement(), self.inputElem) DOM.appendChild(self.getElement(), self.labelElem) uid = "check%d" % self.getUniqueID() DOM.setAttribute(self.inputElem, "id", uid) DOM.setAttribute(self.labelElem, "htmlFor", uid)
def initElement(self, element, **kwargs): self.inputElem = element self.labelElem = DOM.createLabel() if kwargs.has_key('Element'): element = kwargs.pop('Element') else: element = DOM.createSpan() ButtonBase.__init__(self, element, **kwargs) self.unsinkEvents(Event.FOCUSEVENTS| Event.ONCLICK) DOM.sinkEvents(self.inputElem, Event.FOCUSEVENTS | Event.ONCLICK | DOM.getEventsSunk(self.inputElem)) DOM.appendChild(self.getElement(), self.inputElem) DOM.appendChild(self.getElement(), self.labelElem) uid = "check%d" % self.getUniqueID() DOM.setAttribute(self.inputElem, "id", uid) DOM.setAttribute(self.labelElem, "htmlFor", uid)
def initElement(self, element, **kwargs): self.inputElem = element self.labelElem = DOM.createLabel() if kwargs.has_key('Element'): element = kwargs.pop('Element') else: element = DOM.createSpan() ButtonBase.__init__(self, element, **kwargs) self.unsinkEvents(Event.FOCUSEVENTS | Event.ONCLICK) DOM.sinkEvents( self.inputElem, Event.FOCUSEVENTS | Event.ONCLICK | DOM.getEventsSunk(self.inputElem)) DOM.appendChild(self.getElement(), self.inputElem) DOM.appendChild(self.getElement(), self.labelElem) uid = "check%d" % self.getUniqueID() DOM.setAttribute(self.inputElem, "id", uid) DOM.setAttribute(self.labelElem, "htmlFor", uid)