<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hi Rafael,<div>please ping me on Monday if the example do not help. Than we can have a look :)<br><br><div id="AppleMailSignature">Von meinem iPhone gesendet</div><div><br>Am 17.11.2017 um 14:40 schrieb Guillaume Smet &lt;<a href="mailto:guillaume.smet@gmail.com">guillaume.smet@gmail.com</a>&gt;:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi Rafael,<div><br></div><div>Hendrik contributed a few JavaFX examples here:&nbsp;<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>--&nbsp;</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)">&nbsp; &nbsp; @NotNull(message = "Name can't be null)&nbsp;</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)">&nbsp; &nbsp; @Size(max = 255, min=3, message = "Size name must be between 255 and 3")</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)">&nbsp; &nbsp; 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)">&nbsp; &nbsp; //... 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)">&nbsp; &nbsp; @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)">&nbsp; &nbsp; private TextField textFiledCategoryName;&nbsp;&nbsp;</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)">&nbsp; &nbsp; 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)">&nbsp; &nbsp; @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)">&nbsp; &nbsp; public&nbsp; &nbsp;void initialize() {&nbsp; &nbsp;&nbsp;</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)">&nbsp; &nbsp;&nbsp; &nbsp; 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)">&nbsp; &nbsp;&nbsp; &nbsp; textFiledCategoryName.<wbr>textProperty().<wbr>bindBidirectional(category.<wbr>nameProperty());&nbsp; &nbsp;&nbsp; &nbsp;</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)">&nbsp; &nbsp; }</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&nbsp;</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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>beanvalidation-dev mailing list</span><br><span><a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a></span></div></blockquote></div></body></html>