Picture Validation, Unbound field 
Author Message
 Picture Validation, Unbound field
What is the best way to prevent movement during data entry on an unbound
field, if the picture validation is false?

Also, same as above for a drop down list.

Any help will be appreciated.
Thanks
Fredrick Bartlett



Wed, 22 Jul 1998 03:00:00 GMT
 Picture Validation, Unbound field

: What is the best way to prevent movement during data entry on an unbound
: field, if the picture validation is false?

: Also, same as above for a drop down list.

: Any help will be appreciated.
: Thanks
: Fredrick Bartlett

One simple way is to not make it an unbound field; create another
table which will hold the value entered, and put a picture in the
field.

If you don't want to do that, I usually put the code in the
changeValue() method.  Cary Jensen's book on OPAL programming
has some good tips on this;  I don't have everything in front of
me at the moment, but I know that one thing you will want to make
sure you do is use eventInfo.newValue rather than self.value to
make sure you are getting the value just entered; then if you want
to prohibit movement, use setErrorCode(CanNotDepart) -- or, really,
just set the error code to any non-zero value.

I haven't used drop down lists, so I'm not sure if this works for
them; I know that radio buttons never call the changeValue() method.e

=================================================================

=================================================================



Wed, 22 Jul 1998 03:00:00 GMT
 Picture Validation, Unbound field

Quote:

>What is the best way to prevent movement during data entry on an unbound
>field, if the picture validation is false?
>Also, same as above for a drop down list.
>Any help will be appreciated.
>Thanks
>Fredrick Bartlett

I would use the field's changevalue() method to trap for invalid entries.
Something like the following would work:

method changevalue (var eventInfo ValueEvent )
var
s string
endvar
s=eventinfo.newvalue()
if s<> "valid entry" then
        msgStop(You've entered an invalid entry.","DON'T DO THAT!") ;<g>
        disabledefault
endif

You can use Match() or advMatch() to enter the patterns your string is
supposed to follow, or if your field is a numeric or date type, you can use
arithmetic operators (make s the appropriate data type) to provide validity
checks.



Thu, 23 Jul 1998 03:00:00 GMT
 Picture Validation, Unbound field

Quote:
>    Doesn't the default behavior do it?  I assume that you
>    set the picture property for the unbound field in the
>    open() method for the field, as in
>    unbound::open()
>      dodefault
>      self.picture = "{Mon,T{ue,hu},Wed,Fri,S{at,un}}"
>    endmethod

>    This is burried somewhere in the documentation, but not
>    very well known.  BTW, on bound fields, the table picture
>    (if any) overrides any form-level assignment.

Hmmm - my documentation says this is a read-only property (pdoxwin 4.5) but
I took you at your word an created a new unbound field object and tried to
use the form's open method to set its picture property as you describe - no
go, got an error message saying that I tried to alter a read-only property.
Has this changed in pdoxwin 5.0?


Mon, 27 Jul 1998 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. How to you do Data Validation on Unbound Field Paradox 7

2. picture for unbound field on the fly

3. Database Fields validation (masks & pictures)

4. Pdox4.5 - SHOWDIALOG picture validation

5. Array row field by field validation problem

6. Field Validation/Required Field Woes

7. Does Set Field override field validation?

8. using a dbedit field to load a picture in an image field

9. Sorting unbound calculated fields

10. Unbound Currency Field causing problems

11. P7&9 - Date Problems, Unbound Field

12. Unbound fields in Runtime


 
Powered by phpBB® Forum Software