Component class diagram - a good version is in cheat-sheet; also it's good idea to browse online sampler application
- Component : base of all
- attach() : called when is attached;
- detach()
- caption, or setCaption() :
- text caption, no HTML,
- can be another component - such as Label, Panel
- contained in component (button) or
- managed by layout
- vertical layout : caption above
- form layout : caption left, aligned
- see CSS rules for caption
- icon
- description & tool tips : HTML
- enabled : when disabled, usually applied recursively if the component is a container
- locale : though not the recommended place to implement local, see an example in 5.3.5 for recommended way
- read-only : usually applied not recursively
- visible
- setWidth() setHeight() : number + Sizeable.UNIT_PERCENTAGE / UNIT_PIXELS; or string "100%", "400px"; setSizeFull() set both to 100%;
- tab index: order of focus with tab
- Component <- AbstractComponent :
- AbstractComponent <- AbstractComponentContainer :
- AbstraceComponentContainer <- Panel :
- Panel <- Window :
- AbstractComponentContainer <- AbstractLayout :
- CustomLayout <- AbstractLayout : write XHTML segment to layout components
- AbstractLayout <- AbstractOrderedLayout:
- Component <- Field :
- Field <- AbstractField (implements Property....):
- set/getValue()
- required
- valueChange() : do not implement / override; use another object and register as listener
- setBuffered(true/false) : value not set to data source until commit() is called, which first validates the data
- commit() / discard() : commit validate and (if success) commit data to data source; discard drop current value and read from data source
- addValidator() :
- error shown; {0} replaced with invalid value
- setValidationVisiable() : enable / disable shown of validation error
- BeanValidator : see 9/4/6 Bean Validation
- CompositeValidator : combines multiple validators with OR and AND
- .... others, see more in 5.4.5
- self-implemented validation : implements Validator interface, throws InvalidValueException / EmptyValueException
- automatic validation : normally after field lose focus
- explicit validation : upon validate() or commit()
- AbstractField <- AbstractSelect :
- ComponentContainer interface (Layout, AbstractComponentContainer) : contain and manage component
- getParent() - not usable in constructor
- addComponent()
- Extensions : see 16.7
- Label : can set content mode
- Link : not like button, does not cause server event, can set target (new window)
- TextField
- can bind to more than String, with automatic converter
- in table edit mode, DefaultFieldFactory create text field for all properties; usually needs to make custom factory
- text change events - send event before lose focus (for input assistance), see doc
- Text area
- PasswordField
- RichTextArea : result HTML
- DateField
- date = new DateField(); date.setValue(new Date()); - set to present
- setResolution() with DateField.Resolution.DAY / MIN
- PopupDateField - use smaller area and popup input
- setDateFormat() with a string, such as "yyyy-MM-dd"
- InlineDateField
- Button - handled with Button.ClickListener in its buttonClick() method
- CheckBox
- get/setValue()
- ValueChangeEvent / ValueChangeListener
- AbstractSelect
- Select / ComboBox / ListSelect / NativeSelect / OptionGroup / TwinColSelect / Tree / Table
- bind to Container contained Item
- Container.addItem() / BeanItemContainer.addBean()
- select.setItemCaption(itemId, "Caption")
- select.setItemCaptionMode()
- select.setItemIcon()
- obtain selection - getValue() / Property.ValueChangeListen / PropertyValueChangeEvent
- filtering : select.setFilteringMode(AbstractSelect.Filtering.XXX)
- OptionGroup.setItemEnabled()
- select.setNewItemsAllowed()
- select.setMultiSelect()
- more detailed discussion see doc
- Table - see sub page
- Tree
- MenuBar
- Embedded Resources
- Image
- Flash
- Embedded
- BrowserFrame - HTML <iframe>
- Upload
- ProgressBar
- Slider
- Calendar - show calendar and events, very feature rich
- Calendar.addEvent()
- use Container as data source
- use event provider - CalendarEventProvider
- Drag n drop
- Context menu
- .... many other features
- CustomComponent - component composition
- CustomField - custom validation, value, etc.