<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Christoph Frick - ofnir.net - Open Source Consultant, Software Developer and System Administrator (Posts about Vaadin8)</title><link>https://ofnir.net/</link><description></description><atom:link href="https://ofnir.net/categories/vaadin8.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:cf@ofnir.net"&gt;Christoph Frick - ofnir.net&lt;/a&gt; </copyright><lastBuildDate>Tue, 21 Apr 2026 11:44:46 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Generic Vaadin8 field for converted values</title><link>https://ofnir.net/posts/generic-vaadin8-field-for-converted-values/</link><dc:creator>Christoph Frick - ofnir.net</dc:creator><description>&lt;p&gt;In Vaadin8 the conversion between the model data type and the field is done in the &lt;code class="docutils literal"&gt;Binder&lt;/code&gt;.  This prevents automatic mapping for the models as some manual step must be done beforehand.  But since writing custom fields now is way more reasonable, here is a first draft for a generic converter field. Just provide the backing &lt;code class="docutils literal"&gt;Field&lt;/code&gt; and an &lt;code class="docutils literal"&gt;Converter&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://gist.github.com/christoph-frick/947fec59cfd09f7140933b52102cc041"&gt;https://gist.github.com/christoph-frick/947fec59cfd09f7140933b52102cc041&lt;/a&gt;&lt;/p&gt;</description><category>Vaadin</category><category>Vaadin8</category><guid>https://ofnir.net/posts/generic-vaadin8-field-for-converted-values/</guid><pubDate>Mon, 24 Apr 2017 22:00:00 GMT</pubDate></item><item><title>Null representation needed when using converters in Vaadin 8 binder</title><link>https://ofnir.net/posts/null-representation-needed-when-using-converters-in-vaadin-8-binder/</link><dc:creator>Christoph Frick - ofnir.net</dc:creator><description>&lt;p&gt;&lt;code class="docutils literal"&gt;TextFields&lt;/code&gt; in Vaadin8 are no longer allowed to get a &lt;code class="docutils literal"&gt;null&lt;/code&gt; set as
value.  This usually is no problem unless we use a &lt;code class="docutils literal"&gt;Converter&lt;/code&gt; for the
field binding.  In that case a &lt;code class="docutils literal"&gt;null&lt;/code&gt; value about to be bound will
raise an assertion error.  It also won't help if that field is bound
with &lt;code class="docutils literal"&gt;asRequired&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The solution in this case is to use &lt;code class="docutils literal"&gt;withNullRepresentation&lt;/code&gt; before
adding the &lt;code class="docutils literal"&gt;Converter&lt;/code&gt; in the binding builder.  This adds another
converter at first, that turns &lt;code class="docutils literal"&gt;null&lt;/code&gt; values into "something" so the
real converter has to actually work.&lt;/p&gt;
&lt;p&gt;See&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/christoph-frick/try-vaadin8/commit/8eee2ce6880b7a3dd4ce1526cf533ef356d3ec50"&gt;https://github.com/christoph-frick/try-vaadin8/commit/8eee2ce6880b7a3dd4ce1526cf533ef356d3ec50&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/vaadin/framework/issues/8725"&gt;https://github.com/vaadin/framework/issues/8725&lt;/a&gt;&lt;/p&gt;</description><category>Vaadin</category><category>Vaadin8</category><guid>https://ofnir.net/posts/null-representation-needed-when-using-converters-in-vaadin-8-binder/</guid><pubDate>Thu, 02 Mar 2017 23:00:00 GMT</pubDate></item><item><title>Trying out Vaadin 8</title><link>https://ofnir.net/posts/trying-out-vaadin-8/</link><dc:creator>Christoph Frick - ofnir.net</dc:creator><description>&lt;p&gt;Started a repo to try out the new/changed stuff from Vaadin 8.  Lessons learned so far:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Immediate&lt;/em&gt; on fields is gone.  They are now immediate by default.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Converter&lt;/em&gt; on fields is gone.  You convert either in the &lt;code class="docutils literal"&gt;Binder&lt;/code&gt; or you have to write your own field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the &lt;code class="docutils literal"&gt;Binder&lt;/code&gt; builder as a builder (chain your calls) -- even if your e.g. Groovy gives you &lt;em&gt;builderish&lt;/em&gt; behaviour with &lt;code class="docutils literal"&gt;with&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code class="docutils literal"&gt;CallbackDataProvider&lt;/code&gt; is basically the same as the &lt;code class="docutils literal"&gt;LazyContainer&lt;/code&gt; from &lt;em&gt;Viritin&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating your own &lt;code class="docutils literal"&gt;CustomField&lt;/code&gt; becomes easier, since you get some proper guidance on what to implement.  Yet making that field properly propagate change events is still on you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For a composite field it's easiest to build it up using again a &lt;code class="docutils literal"&gt;Binder&lt;/code&gt; and delegate &lt;code class="docutils literal"&gt;addValueChangeListener&lt;/code&gt; down to it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The repository is here: &lt;a class="reference external" href="https://github.com/christoph-frick/try-vaadin8"&gt;https://github.com/christoph-frick/try-vaadin8&lt;/a&gt;&lt;/p&gt;</description><category>Vaadin</category><category>Vaadin8</category><guid>https://ofnir.net/posts/trying-out-vaadin-8/</guid><pubDate>Thu, 16 Feb 2017 23:00:00 GMT</pubDate></item></channel></rss>