[Essentialdata-discuss] Re: row-level validation
Brought to you by:
dankib01
|
From: Kibler, D. (HQP) <Dan...@rh...> - 2005-01-24 19:57:19
|
Alex
My non-expert recommendation - assumes you are binding your table to the =
properties of a POJO (bean) ala the tutorial expamle.
In your POJO, add a custom validator to each of the properties that =
participate in the validation. Each custom validator validateComplete() =
method should call a common method that returns the current validation =
status of the overall row. If validateComplete() returns false, the =
associated field will automatically be colored yellow and the user will =
be unable to leave the row until the data is correct.=20
I don't know if any of the behavior is configurable. It's not perfect =
but workiable.
Here some snips from a validator that ensures bankBalance >=3D 1000 * =
age
public IValidator getBankBalanceValidator() {
return new IValidator() {
...
public boolean validateComplete(String value) {
try {
double doubleValue =3D Double.parseDouble(value);
return isAgeBalanceValid(getAge(),doubleValue);
...
public boolean isAgeBalanceValid(int age, double bb) {
return bb >=3D (age * 1000.0);
}
Livestrong
Dan
Message: 4
Date: Thu, 20 Jan 2005 15:36:01 -0600
From: Alex Garrett <lj...@gm...>
To: ess...@li...
Subject: Re: [Essentialdata-discuss] row-level validation
Reply-To: ess...@li...
Unfortunately, I was a little simplistic in my description and my
problem was incorrectly stated. Let me try again with more detail. I
have a reasonably complicated validation model. There are eight
columns. The status of the first column determines whether the other
seven count at all. If they do, the next four need to be numbers in
monotonically non-decreasing order. The last three columns have a
mathematical relationship between themselves and one or more of the
prior four.
A use case is that a user may start by selecting a value from the
first column through a combo box and then enter values 10, 20, 30, 40
(e.g.) in the next four fields. They'll want to use the tab key for
ease of entry, but after entering 10 in the first field, the row will
no longer be valid and they'll have to use the mouse to move to the
next three fields. At this point, the row still may not be valid
because the values don't satisfy the constraints for the last three
fields.
This is why I wanted to be able to have some kind of process that
would allow them to enter in whatever data they want (subject to
syntactic constraints like ensuring the values were numbers) and
indicate whether the data were valid or not.
One alternative that I considered was to have a column "Valid" that
would have an indicator, but the feedback I'm getting is that row
coloring is preferred. If there were a column indicator, it would have
to be an image, and I'm not sure how to pull that off, either. AFAIK,
the controls require String inputs. Any ideas?
Thanks,
Alex
On Thu, 20 Jan 2005 15:18:26 -0600, Dave Orme
<dj...@co...> wrote:
> Alex Garrett wrote:
> > I have some relational data in a row that I need to validate and I'm
> > having some trouble determining essentially how to do it. For =
example,
> > consider an MROTable that has columns for Name, Score and Max Score
> > and you want to validate that Score <=3D Max Score. What I want to =
be
> > able to do is color the row red if this criterion isn't met and =
color
> > it green if it is.
>=20
> Here's how:
>=20
> Put an IValidator on the Score property that range-checks that Score <
> Max Score.
>=20
> ED will let the user move around within the row (using the mouse), but
> will color the Score field yellow if it fails this validation test. =
And
> it won't allow the user to move off the row entirely until all fields
> within the row (including the Score field) pass all validity tests.
>=20
> Regards,
>=20
> Dave Orme
>=20
> --
> Got Java? Use db4objects! <http://www.db4o.com>
>=20
> PGP Public Key (for confidential communications):
> http://www.coconut-palm-software.com/~djo/public_key.txt
>=20
> -------------------------------------------------------
> 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
>
--__--__--
Message: 5
Date: Thu, 20 Jan 2005 16:49:33 -0600
From: Dave Orme <dj...@co...>
To: ess...@li...
Subject: Re: [Essentialdata-discuss] My status
Reply-To: ess...@li...
Dave Orme wrote:
> All,
>=20
> Although I promised that I would support it [Essential Data]
> personally when I left my old company, my old company (ASC) has sent =
my=20
> new company (db4objects) a letter indicating that if I work on =
Essential=20
> Data, they will sue db4objects.
I didn't spell this out in my earlier email, so I'd better. This means=20
I can't work on Essential Data beginning immediately.
To be on the safe side, I won't answer questions any more on the mailing =
list until this is resolved (even though this would be providing a free=20
service for ASC). I ask the community to please pitch in as best as you =
can and help each other out during this time of difficulty.
The grounds for sueing would be my non-competition agreement I signed in =
order to be an employee. ASC apparently thinks they can just take=20
Essential Data closed-source commercial and stop it dead in its tracks=20
because I won't be able to work on it any more due to the non-compete=20
clause in my employee contract.
Yes, they know that Essential Data is mostly GPL (parts are CPL) and on=20
SourceForge and that they can't stop the rest of the community from=20
developing or using it. I personally think they underestimated the=20
power of the open-source development community...
**But please nobody contact ASC. Trust me, it'll just complicate our=20
negotiations.**
Hopefully, it won't come to that and db4objects will be able to=20
negotiate something good for everybody.
If not, then we'll have to talk about what's best for everyone in the=20
community...
With warmest regards,
Dave Orme
--=20
Got Java? Use db4objects! <http://www.db4o.com>
PGP Public Key (for confidential communications):
http://www.coconut-palm-software.com/~djo/public_key.txt
--__--__--
Message: 6
Date: Thu, 20 Jan 2005 20:08:01 -0600
From: Dave Orme <dj...@co...>
To: ess...@li...
Subject: Re: [Essentialdata-discuss] db4o is a Great Database
Reply-To: ess...@li...
James Leotta wrote:
> Hello Dave,
>=20
> Always thought db4o was a perfect fit. Good luck.
>=20
> Jim Leotta
Thanks Jim!
Regards,
Dave Orme
--=20
Got Java? Use db4objects! <http://www.db4o.com>
PGP Public Key (for confidential communications):
http://www.coconut-palm-software.com/~djo/public_key.txt
--__--__--
_______________________________________________
Essentialdata-discuss mailing list
Ess...@li...
https://lists.sourceforge.net/lists/listinfo/essentialdata-discuss
End of Essentialdata-discuss Digest
|