Thread: [Essentialdata-discuss] RE: Essentialdata-discuss digest, Vol 1 #24 - 3 msgs
Brought to you by:
dankib01
From: Kibler, D. (HQP) <Dan...@rh...> - 2005-01-25 19:04:22
|
Alex With my proposed approach, you can't tab to another field in the same = row, but you can select another field in the same row with the mouse. = That part of the "it's not perfect." So you can edit the data in other = fields after failing the validation. Another, not so perfect part, is = that you can't delete a row until it validates. So if you insert a row = and then change your mind, you can't do anything else until you make it = valid. Adding some flexibility to your validation method could help a = bit there. From my testing, it appears that MROTable (MRO?) does use = POJOObjectAdapter. I haven't gotten any farther trying to figure out how = to use that knowledge, tho. The problem I'd like to solve is to get MROTable (or it's supporting = objects like Model) to listen to PropertyChangeEvents from the bean. = Right now calculated fields are not updated in the table until the row = is refreshed. It would also allow you to update the bean independent of = the View (table) and have the changes reflected in the table. Regards Dan --__--__-- Message: 3 Date: Mon, 24 Jan 2005 14:28:51 -0600 From: Alex Garrett <lj...@gm...> To: ess...@li... Subject: Re: [Essentialdata-discuss] Re: row-level validation Reply-To: ess...@li... Dan, I think that's generally a good idea, but the one sticking point I have is that an individual cell may be valid without the row being valid. For example, assume there are two cells bound to properties Foo and Bar. The row is valid iff Foo and Bar are blank or Foo and Bar are numbers whose difference is prime. When the table loads, the row will be valid because it's blank. However, if the user enters '8' in Foo, the row is invalid because Bar is 0. At this point, the user can't just tab over to Bar to enter in '3', like they had planned. Essentially, there's a "Control -> POJOFieldAdapter -> property" relationship that's indicated by the "boundTo" property in the Control. I'm wondering if there's a similar "Row Composite -> POJOObjectAdapter -> Bean" relationship that I could take advantage of. Thanks, Alex |
From: Alex G. <lj...@gm...> - 2005-01-25 19:28:22
|
Dan, Unfortunately, for us, the ability to tab even while an individual cell is invalid is a hard requirement. It's the reason we went to the MROTable instead of the JFace TableViewer w/CellEditors. As for your issue, MROTable will listen to PropertyChangeEvents from your objects, but it doesn't respond to the "addPropertyChangeListener(PropertyChangeListener _listener)" generic method. (BTW, I don't mean 'generic' in the java 1.5 sense). What you need to use is the "add<Foo>Listener(PropertyChangeListener _listener)" where "foo" is the name of your property. Essentially, you need to have the add and remove methods for every changable field you want to be listened to. This is the same style as the "get<Foo>Validator" methods used for validation. Cheers, Alex On Tue, 25 Jan 2005 11:04:15 -0800, Kibler, Daniel (HQP) <Dan...@rh...> wrote: > Alex > > With my proposed approach, you can't tab to another field in the same row, but you can select another field in the same row with the mouse. That part of the "it's not perfect." So you can edit the data in other fields after failing the validation. Another, not so perfect part, is that you can't delete a row until it validates. So if you insert a row and then change your mind, you can't do anything else until you make it valid. Adding some flexibility to your validation method could help a bit there. > > From my testing, it appears that MROTable (MRO?) does use POJOObjectAdapter. I haven't gotten any farther trying to figure out how to use that knowledge, tho. > > The problem I'd like to solve is to get MROTable (or it's supporting objects like Model) to listen to PropertyChangeEvents from the bean. Right now calculated fields are not updated in the table until the row is refreshed. It would also allow you to update the bean independent of the View (table) and have the changes reflected in the table. > > Regards > Dan > > --__--__-- > > Message: 3 > Date: Mon, 24 Jan 2005 14:28:51 -0600 > From: Alex Garrett <lj...@gm...> > To: ess...@li... > Subject: Re: [Essentialdata-discuss] Re: row-level validation > Reply-To: ess...@li... > > Dan, > > I think that's generally a good idea, but the one sticking point I > have is that an individual cell may be valid without the row being > valid. For example, assume there are two cells bound to properties Foo > and Bar. The row is valid iff Foo and Bar are blank or Foo and Bar are > numbers whose difference is prime. When the table loads, the row will > be valid because it's blank. However, if the user enters '8' in Foo, > the row is invalid because Bar is 0. At this point, the user can't > just tab over to Bar to enter in '3', like they had planned. > > Essentially, there's a "Control -> POJOFieldAdapter -> property" > relationship that's indicated by the "boundTo" property in the > Control. I'm wondering if there's a similar "Row Composite -> > POJOObjectAdapter -> Bean" relationship that I could take advantage > of. > > Thanks, > Alex > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Essentialdata-discuss mailing list > Ess...@li... > https://lists.sourceforge.net/lists/listinfo/essentialdata-discuss > |