User-defined components in JavaFX.
Due to pure object-oriented JavaFX nature create custom component is pretty simple:
/* define the new component that contains input text field and label for it: */ public class Input extends PanelGroup { public attribute value public attribute label:String override var children = [ OutputLabel { value: bind label id:"{id}:label" for:"{id}:input" }, InputText { label:"Input" value: bind input id:"{id}:input" valueChanged: Ajax {} }
That class may be used anywhere as any other component:
......... Input { id: "baz" styleClass:"defaultInput" value: bind foo.bar label: "Input:" } ........
Leave a Reply