예제 #1
0
    class Loading(Layout.Box):
        """
            Defines what is shown in place of the controller while its content is loaded from the server
        """
        indicator = Display.Image()
        indicator.setValue('images/loop-grey.gif')

        def __init__(self, id, name=None, parent=None, loadingText=None):
            Layout.Box.__init__(self, id, name=None, parent=None)
            self.addChildElement(self.indicator, ensureUnique=False)
            self.label = self.addChildElement(Display.Label())
            self.label.setText(parent.loadingText)
예제 #2
0
    def __init__(self, id, name=None, parent=None):
        Layout.Vertical.__init__(self, id, name, parent)
        self.addClass("WebElementAccordion")

        self.toggle = self.addChildElement(Layout.Horizontal())
        self.toggle.addClass('AccordionToggle')
        self.toggle.addJavascriptEvent('onclick', CallBack(self, 'jsToggle'))
        self.toggleImage = self.toggle.addChildElement(
            Display.Image(id + "Image"))
        self.toggleImage.addClass('AccordionImage')
        self.toggleLabel = self.toggle.addChildElement(Display.Label())
        self.toggleLabel.addClass('AccordionLabel')
        self.isOpen = self.toggle.addChildElement(
            HiddenInputs.HiddenBooleanValue(id + "Value"))
        self.contentElement = self.addChildElement(Layout.Box(id + "Content"))
        self.contentElement.addClass('AccordionContent')
        self.addChildElementsTo = self.contentElement

        self.isOpen.connect('valueChanged', True, self, 'open')
        self.isOpen.connect('valueChanged', False, self, 'close')
        self.close()

        self.addJSFunctions(Accordion)
예제 #3
0
    def __init__(self, id, name=None, parent=None):
        TextField.__init__(self, id, name, parent)
        self.userInput.style['width'] = '7.5em'
        self.dateFormat = "dd-mmm-yyyy"

        layout = self.addChildElement(Layout.Horizontal())
        layout.addClass("FieldDescription")
        self.calendarLink = layout.addChildElement(
            Display.Image(id + "CalendarLink"))
        self.calendarLink.addClass('Clickable')
        self.calendarLink.addClass('hidePrint')
        self.calendarLink.setValue('images/calendar_icon.gif')
        self.calendarLink.addJavascriptEvent('onclick',
                                             CallBack(self, "jsOpenCalendar"))

        self.calendarTypeLabel = layout.addChildElement(Display.Label())
        self.calendarTypeLabel.style['margin-left'] = "4px;"
        self.calendarTypeLabel.style['margin-right'] = "4px;"
        self.calendarTypeLabel.style['display'] = "block;"

        self.setIsZulu(False)
        self.formatDisplay = layout.addChildElement(Display.Label())

        self.connect('beforeToHtml', None, self, '__updateDisplay__')