atom feed3 messages in net.java.dev.genesis.usersRe: [genesis-users] Swing "as you typ...
FromSent OnAttachments
Oliver WeiseNov 27, 2007 7:15 am 
Michael NascimentoNov 30, 2007 11:06 am.java
Oliver WeiseDec 5, 2007 12:37 am 
Subject:Re: [genesis-users] Swing "as you type" Binding: Populating form with model data "backfires" to the model
From:Oliver Weise (ow@innovationgate.com)
Date:Dec 5, 2007 12:37:11 am
List:net.java.dev.genesis.users

Hi Michael,

I actually stepped down from using the "as you type" binding for my problem. It really seems to be a bad idea in most situations. It turned out that I need text fields on my GUI where the submittance of partial inputs would not pass validation anyway. Since I only wanted to enable a save button on user input I now just register a Action/ChangeListener on each control that is bound by Genesis and enable the button in it (I subclassed the swing binder to do this automatically for each bound control). The real data transfer from field to model now happens somewhat later, in the moment where the focus goes from the input field to the save button, but that is early enough.

However, I tested your AsynchroniusJTextComponentBinder with my old strategy and it seems to work like expected. I no longer get model updates with empty strings. The model setters are not at all called on the initial binding. I was not able to detect any side effects, altho I haven't tested it that much until now. But things look good.

Mit freundlichen Grüßen / Kind regards,