문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top