data validation and data format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

data validation and data format

pablo digonzelli
From: "pablo digonzelli" <[hidden email]>
Subject: data validation and data format
Date: Tuesday, March 20, 2001 4:21 PM

Hi, I am working on an Bussines application where i need to validate input
data and format.
I have a lot of questions for everyone who was deploying this or similar
kinds of app.
For example :
    1) I have a numeric data , how can I validate that the user input have a
certain format : (by example ->>>,>>9.99).
    2) In a String data how can i define a mask : 'XXX-XXXXX-XXX' .Or if I
have a mask : 'AAAAA-AAAAAA' how can i validate that the
        input characters are all alfabetic ones?.
    3) If I have a Object by example a Item for Sell and this item have a
Supplier. I need to define in the Item an attribute idSupplier the same as
in Relational DataBase applications or , like I prefer , can I define
supplier as an attribute and have the supplier (the object) referenced in
item ? . In that case, how can i do
the data input for this attribute ( supplier )? I need to define a combo or
a list with all the suppliers ? . If the item exists , how can I show the
supplier for the item?
i think a Combo where the selection is open over the correct supplier is the
solution.
Sorry for my english and
TIA


Reply | Threaded
Open this post in threaded view
|

Re: data validation and data format

Ian Bartholomew
Pablo,

>     1) I have a numeric data , how can I validate that the user input have
a
> certain format : (by example ->>>,>>9.99).
>     2) In a String data how can i define a mask : 'XXX-XXXXX-XXX' .Or if I
> have a mask : 'AAAAA-AAAAAA' how can i validate that the
>         input characters are all alfabetic ones?.

I can't really help much but a few pointers.

Have a look on the WIKI for "DolphinGoodiesValidation" from Kai Bollert and
Juergen Albertson. It's a bit old now but it might help.

To receive a notification from a text entry field set the #updatePerChar
aspect to true and check the field after every keypress. You'll have to do
your own pattern matching though.

For numeric fields you can set the #isNumeric aspect to true to only allow
digits.

For Dialogs overriding #ok and not allowing the Dialog to close (just return
rather than doing "super ok") is probably the easiest way to validate whole
dialogs.


>     3) If I have a Object by example a Item for Sell and this item have a
> Supplier. I need to define in the Item an attribute idSupplier the same as
> in Relational DataBase applications or , like I prefer , can I define
> supplier as an attribute and have the supplier (the object) referenced in
> item ? . In that case, how can i do
> the data input for this attribute ( supplier )? I need to define a combo
or
> a list with all the suppliers ? . If the item exists , how can I show the
> supplier for the item?
> i think a Combo where the selection is open over the correct supplier is
the
> solution.

It's very difficult to say much without knowing the what you are trying to
do and how the rest of the application works. It does sound like you should
investigate ChoicePresenters though which enable you to display and choose
from a list.

Ian