Question

I'm evaluating tools or JavaFX programming and have found FXForms2.

I'm not too much interested in automatic form generation, but just in automatic bean (pojo, no Property classes) binding to fx forms, conversion and validation.

Can I use FXForms2 right this way, omitting form generation?

Thank you.

Was it helpful?

Solution

Sure, you can use the NodeSkin or the FXMLSkin in this case. The FXMLSkin is just a subclass of NodeSkin where the Node is automatically loaded from an FXML file.

FXForm form = new FXForm();
form.setSkin(new NodeSkin(form, new Callable<Node>() {public Node call() {return myNode;}}))
form.setSource(myBean);

In both cases the mapping between the view and the model is based on node ids and on properties name, see here for conventions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top