<div dir="ltr">Hi Rafael,<div><br></div><div>Hendrik contributed a few JavaFX examples here: <a href="https://github.com/hibernate/hibernate-demos/tree/master/hibernate-validator/javafx-validation-example">https://github.com/hibernate/hibernate-demos/tree/master/hibernate-validator/javafx-validation-example</a> .</div><div><br></div><div>I think they will probably help you getting it working.</div><div><br></div><div>-- </div><div>Guillaume</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 17, 2017 at 2:05 PM, Rafael A P Nascimento <span dir="ltr">&lt;<a href="mailto:rfx.go.on@gmail.com" target="_blank">rfx.go.on@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)">Hi all!</span></font></div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)">How do I integrate Bean Validation with JavaFX?</span></font></div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)"><br></span></font></div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)">I would like to make a <b>bidirectional bind</b> between the entity field and the javaFx controllers. In this scenario how could I validate fields using Bean Validation?</span></font></div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)"><br></span></font></div><div><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span style="background-color:rgb(243,243,243)">Ex:</span></font></div></div><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">public class Category{</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    @NotNull(message = &quot;Name can&#39;t be null) </span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    @Size(max = 255, min=3, message = &quot;Size name must be between 255 and 3&quot;)</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    private StringProperty name = new SimpleStringProperty();</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    //... getters &amp; setters</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">}</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">//some fx Controller...</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">public class CategoryController{</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    @FXML</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    private TextField textFiledCategoryName;  </span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    private Category category;</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    @FXML</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    public   void initialize() {    </span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">       category = new Category();</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">       textFiledCategoryName.<wbr>textProperty().<wbr>bindBidirectional(category.<wbr>nameProperty());      </span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">    }</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">//other code...</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace"><span style="color:rgb(0,102,0);font-family:Monaco,&quot;Courier New&quot;,monospace;background-color:rgb(250,250,250)">}</span><br clear="all"><div><br></div><div>thanks!</div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_8947897219311683114gmail-m_7696402582463435148gmail_signature"><div dir="ltr"><b><i>Rafael A P Nascimento </i></b><div><b><i><a href="http://finalexception.blogspot.com.br" target="_blank">finalexception.blogspot.com</a><br></i></b><div><br></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br></blockquote></div><br></div>