From: Ronald H. <ro...@co...> - 2004-06-06 11:46:48
|
Keith, for this fix to work, the DefaultBeanBinder should be fixed as well, as stated in my first email about this subject. Otherwise the formatter will not put the values in the textfield (if I understand it correctly). Ronald Keith Donald wrote: >Ronald, > >Good catch. I incorporated the fix and will be going back to add in test >cases for the bean binder stuff ASAP. > >Keith > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...] On Behalf Of >Ronald Haring >Sent: Friday, June 04, 2004 8:34 AM >To: spr...@li... >Subject: Re: [Springframework-rcp-dev] Binder bug when no reporter is used. > >Small correction on everything works as intended... >I had changed the >org.springframework.rcp.validation.FormattedTextFieldBinder.PropertyChange >to check if reporter was null, so > > public void propertyChange(PropertyChangeEvent e) { > if (e.getPropertyName().equals("value")) { > if (e.getOldValue() == null) { > // before typing, skip > //@TODO this might not work in all cases > return; > } > SetProperty setter = new SetProperty(bean); > setter.run(propertyName, e.getNewValue()); > > // roha: its possible to have a formattedTextField without a >reporter, so add null check > // if (constraint != null) { > if (constraint != null && reporter != null) { > PropertyResults results = collector > .collectPropertyResults(constraint); > if (results != null) { > reporter.invalid(constraint, results); > } > else { > reporter.valid(constraint); > } > } > } > } > > > > >>Hi Keith, >> >>I am working from your sample application, and I created a small change >>in the sample, by changing the OwnerGeneralPanel to the following: >>// JTextField lastNameField = binder().bind("lastName", reporter()); >>JTextField lastNameField = binder().bind("lastName"); >> >>When I debug the newOwner in NewOwnerWizard, the lastname isnt filled >>anymore. It seems like the propertyChangeEvent doesnt get fired anymore >>if you dont use a binder. I dont think that this is intended. >> >>When debugging org.springframework.rcp.validation.DefaultBeanBinder, and >>changed the following lines, it works as intended (or as I think it >>should be intended :) >> >>// if (reporter != null && rules != null) { >> DefaultFormatter formatter = (DefaultFormatter)field >> .getFormatter(); >> formatter.setCommitsOnValidEdit(true); >>// } >> >>Again, I am no expert on swing, but turning of this if-condition, doesnt >>seem to effect the program. >> >>Also when adding another new owner, the finish button is already >>enabled. Maybe the state should be changed back after a successfull >>onFinish or onCancel? >> >>Cheers >>Ronald >> >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by the new InstallShield X. >>>From Windows to Linux, servers to mobile, InstallShield X is the one >>installation-authoring solution that does it all. Learn more and >>evaluate today! http://www.installshield.com/Dev2Dev/0504 >>_______________________________________________ >>Springframework-rcp-dev mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev >> >> > > > > > >------------------------------------------------------- >This SF.Net email is sponsored by the new InstallShield X. >>From Windows to Linux, servers to mobile, InstallShield X is the one >installation-authoring solution that does it all. Learn more and >evaluate today! http://www.installshield.com/Dev2Dev/0504 >_______________________________________________ >Springframework-rcp-dev mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev > > > > >------------------------------------------------------- >This SF.Net email is sponsored by the new InstallShield X. >>From Windows to Linux, servers to mobile, InstallShield X is the one >installation-authoring solution that does it all. Learn more and >evaluate today! http://www.installshield.com/Dev2Dev/0504 >_______________________________________________ >Springframework-rcp-dev mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev > > |