Exemple #1
0
    def __init__(self):
        super(DateResolutionExample, self).__init__()

        self.setSpacing(True)

        self._datetime = InlineDateField('Please select the starting time:')

        # Set the value of the PopupDateField to current date
        self._datetime.setValue(datetime.today())

        # Set the correct resolution
        self._datetime.setResolution(InlineDateField.RESOLUTION_DAY)
        self._datetime.setImmediate(True)

        # Create selection
        self._localeSelection = ComboBox('Select resolution:')
        self._localeSelection.setNullSelectionAllowed(False)
        self._localeSelection.addListener(self, IValueChangeListener)
        self._localeSelection.setImmediate(True)

        # Fill the selection with choices, set captions correctly
        self._localeSelection.setContainerDataSource(
            self.getResolutionContainer())
        self._localeSelection.setItemCaptionPropertyId(
            self.resolution_PROPERTY_NAME)
        self._localeSelection.setItemCaptionMode(
            ComboBox.ITEM_CAPTION_MODE_PROPERTY)

        self.addComponent(self._datetime)
        self.addComponent(self._localeSelection)
Exemple #2
0
    def __init__(self):
        super(DateLocaleExample, self).__init__()

        self.setSpacing(True)

        self._datetime = InlineDateField('Please select the starting time:')

        # Set the value of the PopupDateField to current date
        self._datetime.setValue(datetime.today())

        # Set the correct resolution
        self._datetime.setResolution(InlineDateField.RESOLUTION_MIN)
        self._datetime.setImmediate(True)
        self._datetime.setShowISOWeekNumbers(True)

        # Create selection and fill it with locales
        self._localeSelection = ComboBox('Select date format:')
        self._localeSelection.addListener(self, IValueChangeListener)
        self._localeSelection.setImmediate(True)
        self._localeSelection.setContainerDataSource(
            ExampleUtil.getLocaleContainer())
        self._localeSelection.setNullSelectionAllowed(False)

        self.addComponent(self._datetime)
        self.addComponent(self._localeSelection)
Exemple #3
0
    def __init__(self):
        super(DateInlineExample, self).__init__()

        self.setSpacing(True)

        self._datetime = InlineDateField('Please select the starting time:')

        # Set the value of the PopupDateField to current date
        self._datetime.setValue(datetime.today())

        # Set the correct resolution
        self._datetime.setResolution(InlineDateField.RESOLUTION_DAY)

        # Add valuechangelistener
        self._datetime.addListener(self, IValueChangeListener)
        self._datetime.setImmediate(True)

        self.addComponent(self._datetime)