Ejemplo n.º 1
0
    def __init__(self, id, name=None, parent=None):
        Layout.Vertical.__init__(self, id, name, parent=parent)

        self.inputContainer = self.addChildElement(Layout.Horizontal())

        self.label = self.inputContainer.addChildElement(Display.Label())
        self.fieldActions = self.inputContainer.addChildElement(Layout.Box())
        self.addChildElementsTo = self.fieldActions
        self.userInput = self.inputContainer.addChildElement(Base.Invalid())

        errorContainer = self.addChildElement(Layout.Horizontal())
        self.formError = errorContainer.addChildElement(
            Display.FormError(id, parent=self))
Ejemplo n.º 2
0
    def __init__(self, id, name=None, parent=None):
        Layout.Box.__init__(self, id + "Field", name, parent)
        self.submitIfDisabled = False

        self.layout = self.addChildElement(Layout.Vertical(id + "Container"))
        self.inputContainer = self.layout.addChildElement(Layout.Horizontal())

        self.label = self.inputContainer.addChildElement(Display.Label())

        self.inputAndActions = self.inputContainer.addChildElement(
            Layout.Horizontal())
        self.userInput = self.inputAndActions.addChildElement(
            self.inputElement(id, name=name))
        self.fieldActions = self.inputAndActions.addChildElement(Layout.Box())
        self.addChildElementsTo = self.fieldActions

        errorContainer = self.layout.addChildElement(Layout.Horizontal())
        self.formError = errorContainer.addChildElement(
            Display.FormError(id, parent=self))
        self.layout.addChildElement(errorContainer)

        self.connect('beforeToHtml', None, self, '__checkIfNeedsValidation__')
        self.connect('beforeToHtml', None, self, '__updateReadOnly__')