Page 1 of 1

Objects in Dialog

Posted: Sat May 17, 2008 2:14 am
by fraxzi
How to know if user changed any get object's value within the dialog?

Any working sample please....


Regards,

Re: Objects in Dialog

Posted: Sat May 17, 2008 2:30 am
by richard-service
fraxzi wrote:How to know if user changed any get object's value within the dialog?

Any working sample please....


Regards,
Hi

Try to use Valid command to control GET Object value.

Regards,

richard

Posted: Sat May 17, 2008 2:54 am
by fraxzi
Thanks for the reply :)

I resorted to old fashioned solution.... I put function after 'ON CHANGE' on every GET objects... and enable the save button if there are changes...


I was hoping that there is a function which has return (boolean) if any object's value was changed within the said dialog.


Thank you!

Posted: Sat May 17, 2008 3:13 am
by James Bott
>I resorted to old fashioned solution.... I put function after 'ON CHANGE' on every GET objects... and enable the save button if there are changes...

I think this is the only way to do it.

>I was hoping that there is a function which has return (boolean) if any object's value was changed within the said dialog.

Even if there was such a function, you would still have to call it from the ON CHANGE clause of each control.

Still this method is not foolproof as the user could change something, then change it back to the original data and the Save button would still be enabled. I know, you are thinking that they could just press the Cancel button, and that is true but there is a visual indication that something has changed, when it hasn't.

Regards,
James

Posted: Sat May 17, 2008 5:31 am
by fraxzi
You are absolutely right Mr. James! 8)

Posted: Sat May 17, 2008 8:02 am
by Antonio Linares
Frances,

You could try this:

if AScan( oDialog:aControls, { | o | Upper( o:ClassName() ) == "TGET" .and. o:oGet:changed .and. ( o:oGet:VarGet() != o:oGet:Original ) } ) != 0

MsgInfo( "Gets changed" )

endif

Posted: Sat May 17, 2008 8:50 am
by fraxzi
Thanks Mr. Antonio! :D

That's a brilliant approach 8)


Regards,