Re: Oracle Power Objects - Help (MLMJ)

From: Rick Greenwald <greenie_at_interaccess.com>
Date: 1997/07/01
Message-ID: <33B910E6.2A87_at_interaccess.com>#1/1


Marcelo Lins wrote:
>
> Hello all
>
> I'm creating a form frmLogon with:
> --------------------------------------------------------
> | User........: ________ |
> | Password: ________ |
> | |
> | -------------- ------------------ |
> | | BtnOK | | BtnCalcel | |
> | -------------- ------------------ |
> --------------------------------------------------------
>
> a) The method frmLogon.Onload() has a code
> BtnOK.enabled = False
> b) Problem
> When i'm typing in the fields txtUser or txtPassword
> the property txtUser.Value or txtPassword.Value don't change
> until i type a TAB key or when i change the focus to another
> object.
> If i code in the txtUser.Onkey()
> 'If not IsNull(txtUser.Value) Then BtnOK.enable =true'
> and the default is null, the If is ever false when i type a string.
> Is it CORRECT or it's a BUG?
> If it's CORRECT How can i get the value of the field
> when i'm typing it (on the method OnKey), i.e. the real value of
> a textbox inside the Onkey method.
> I want to enable btnOK when both are not null, and
> disable when one of them change it's value to null again.
>
> Tks,
>
> []'s Marcelo Lins
> visual_at_centroin.com.br

Marcelo -

The problem is that the Value property for an object is not available until you leave the field. You will have to check to make sure the key code for the OnKey() method is a valid character and the Value property for the other field is not null.

This could still present problems, such as if a user enters text in one field, then the other field, and then deletes the value in one of the fields. The pushbutton would be enabled.

I know it looks better if the push button gets magically enabled when text is entered, but since the user can't use the pushbutton until they leave a data field, it might be easier to handle this in the Validate() method, which will allow you to access the newvalue property.

  • Rick Greenwald Author "Mastering Oracle Power Objects" on O'Reilly and Associates
Received on Tue Jul 01 1997 - 00:00:00 CEST

Original text of this message