On Sat, Aug 18, 2012 at 7:00 PM, Art Heimsoth <artst...@artheimsoth.com> wrote: > This is probably very simple, but I have not been able to get > the solution. I would like to have a EDITTEXT input field where > I can preload the initial value, and then using the sample > NumberOnlyEditEX.cls > be able to only allow numerics, with/without decimal, with/without sign > and control the maximum length of the input field. > > I have not been able to get the fieldname~setText(value) to load an initial > value,
The most common cause of this is from what is termed 'auto-detection' in ooDialog. A feature that I very much dislike. Read about it in the Dialog Object chapter -> Data Attribute Methods -> Understanding Data Attributes. Basically what is probably happening is this: auto detection is on by default. After initDialog() finishes, automatic data detection sets the "value" of each control to its auto "detected" value. Since you probably don't know about auto detection, you probably haven't changed the value of the edit control's data attribute, and so it gets set to blank text, after you used setText() on it. I would advise every one to not use this feature, but once you understand it, it might have some value for some people. The easiest thing to do, is to turn auto detection off, in my opinion. You can do that one of 2 ways. 1.) Use the .application object to set the default to off, rather than on. Normally you would do this at the beginning of your program. Add this line as the first line in your program: .application~autoDetection(.false) The first argument actually is optional and defaults to .false, so this is the same thing: .application~autoDetection 2.) Over-ride the initAutoDetection method in your dialog class. Add this method anywhere in your dialog class ::method initAutoDetection self~noAutoDetection Of course, if this is not the cause of your problem I would need to see more code. But, it is most likely what is happening. > and see no way to control the maximum length of the input. You can control this through the Edit class. Use the setLimit() method of the edit control. The argument to the method sets the maximum number of characters that can be entered by the user in the edit control. Read about the setLimit() method in the reference at Edit Control -> setLimit You can read more about the .application object at Utility Classes and Objects -> .application object and also at Utility Classes and Objects -> ApplicationManager Class. The .application object is an instance of the ApplicationManager. And data attributes and things related to them are explained in The Dialog Object -> Data Attribute Methods chapter. -- Mark Miesfeld ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Oorexx-users mailing list Oorexx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-users