SnTT: DominoField class
Bookmark :
I know it's been awhile since I've written, but today I've been working on an extender class for a Notes Field. Now, I'm still relatively new to creating classes and all this might not really be all that good, not sure really. But this class is called the DominoField class and adds some properties which I think would be useful. If you can think of anything that I'm missing, got obviously wrong or you think would be cool, let me know and I'll add it.
Now looking at this I don't think I'm actually extending the Notes field class. I think this is just a way to capture more information about a field. I couldn't find any documentation on extending a base Lotus Notes class but I am still looking. I tried inheiriting from the Field class but it never would compile and would actually crash my client, so you may not be able to inherit from an included base class. Then again, it could be that I just didn't know what I was doing
But some of the properties we've got here are:
- fieldLabel - This allows you to define a label for the field for friendly validation, or whenever you need to present a field name to the end user
- fieldModifier - This will store who the last person to modify the document was. If the value of the field has changed it will display the current user, else it'll show the last entry in the NotesDocument.Authors property
- fieldName - This will return the name of the field
- fieldValue - This will return the current value of the field
- oldValue - This will return the value of the field when the DominoField class was initialized











Comments
You won't be able to extend the built-in classes -- you can only "wrap" them.
Posted by Andre Guirard At 08:27:44 AM On 05/03/2008 | - Website - |
Posted by Keith Strickland At 08:43:08 AM On 05/03/2008 | - Website - |
look no further. You cannot extend product classes like NotesDocument from within LotusScript. There should be a way using the LSX Toolkit...
Where do you use this class (in the field's events, certainly, but what's the use-case this class helps to solve?)
Thomas
Posted by Thomas Bahn At 05:47:39 PM On 05/05/2008 | - Website - |
I've never used the LSX toolkit but I'll check that out also.
Keith
Posted by Keith Strickland At 06:46:09 PM On 05/05/2008 | - Website - |
It would make a lot more sense to me, if you would add some subclasses like NumberField and DateField, which automatically restrict/validate the input. For these classes you could add something like lower/higher limit, for the Number class the maximal count of digits and so on.
Then you could add a NotesNameField, an EmailField etc.
Finally more abstract subclasses like TemplateValidationField...
I SUMMON THE UNLIMITED POWERS OF OOP!!!
Seriously, IMHO the DominoField class alone is not quite useful enough, but with some subclasses you would be able to save the programmer some dumb work.
(Forgive me my rough tone, but it's about 1:30 am and I should have gone to bed for some time...
Posted by Thomas Bahn At 07:32:33 PM On 05/05/2008 | - Website - |
This class started as a way to put labels with a field for a validation routine. Then I thought it might be handy to have the value of the field when the document was being opened to compare to the value the field currently holds.
I have been thinking of ways to extend the class to make validation routines a little easier/faster. Honestly, I figured I would investigate the "A kinder, gentler validation" post over on Andre's blog { Link } to use with this. I would like to extend it to make it more useful. However I'm just now delving into writing my own classes, so it may take a while
Thanks for the ideas though and making some sub classes would be a good learning experience for me
Posted by Keith Strickland At 09:09:57 AM On 05/06/2008 | - Website - |