Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

changevalue not triggering with table lookup

 
   Database Help (Home) -> Paradox RSS
Next:  Help regarding migration from Oracle 9i client li..  
Author Message
Ryan Lindsey

External


Since: Aug 22, 2008
Posts: 2



(Msg. 1) Posted: Fri Aug 22, 2008 11:29 am
Post subject: changevalue not triggering with table lookup
Archived from groups: comp>databases>paradox (more info?)

I am currently using Paradox 8.

I have a status field. Users can change this status via a table lookup
(ctrl+space).

My problem is that I want to add a log each time it's changed. My choice was
to put the code into the changeValue event but it seems the event does not
even get triggered when changing the value via ctrl+space. It will get
triggered if I actually type in the new status as long as I type something
that's in the lookup.

Am I just completely missing something? changevalue code is below but it is
never executed upon changing the field via the lookup.

method changeValue(var eventInfo ValueEvent)
var
strOldValue,
strNewValue String
endVar

strOldValue = self
doDefault
strNewValue = self

AddLog("Status changed from " + strOldValue + " to " + strNewValue)

endMethod

 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Jim Giner

External


Since: Mar 14, 2008
Posts: 25



(Msg. 2) Posted: Fri Aug 22, 2008 2:45 pm
Post subject: Re: changevalue not triggering with table lookup [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You're not missing anything. It has to do with the table lookup I believe -
changevalue doesn't work the same way. What you have to do is trap in the
unlockrecord action and compare the 'new' value to the old value. basically,
read the underlying table before posting the new data.

Here's what I tried out - just a routine that demonstrates how you can see
the "prev." value before the update occurs at the record level, since you
can't capture it at the field level.


At the form level do this:
method action(var eventInfo ActionEvent)
var
oldname string
endvar
if eventInfo.isPreFilter() then
;// This code executes for each object on the form:

else
;// This code executes only for the form:
if eventinfo.id() = dataunlockrecord then
oldname = blank() ; init this fld
if tc.locate(1,name) then ; record key is called 'name'
view(tc.attributes,"Old") ; attributes is the fld I'm tracking
changes on - this displays the old value
oldname = name ; save the record key if we found a 'previous'
version
endif
dodefault ; this will do the posting
if oldname <> blank() then ; make sure I had a prev. record - if
blank then I didn't
if tc.locate(1,name) then ; re-locate the old record
view(tc.attributes,"new") ; display the newly posted value
endif
endif
endif
endif
endmethod

*****
Of course, there's probably some clever-er way of doing this, but I've not
found it.

 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Jim Hargan

External


Since: Jun 07, 2008
Posts: 15



(Msg. 3) Posted: Fri Aug 22, 2008 3:43 pm
Post subject: Re: changevalue not triggering with table lookup [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Another way to approach this is to call a dialog form you design yourself,
rather than use the built-in lookup. You've already discovered one reason
to do this. Here's another, even better, reason: the path to the lookup
table is hard-coded in the table structure. If you ever change a directory
or drive, your table won't open. In Version 8, I've had this cause table
corruption and had to restore from a backup. (In later versions, moving
everything to the old locations worked, but not V8.)

--
Jim Hargan

-
On Fri, 22 Aug 2008 11:29:17 -0500, Ryan Lindsey wrote:

> I am currently using Paradox 8.
>
> I have a status field. Users can change this status via a table lookup
> (ctrl+space).
>
> My problem is that I want to add a log each time it's changed. My choice was
> to put the code into the changeValue event but it seems the event does not
> even get triggered when changing the value via ctrl+space. It will get
> triggered if I actually type in the new status as long as I type something
> that's in the lookup.
>
> Am I just completely missing something? changevalue code is below but it is
> never executed upon changing the field via the lookup.
>
> method changeValue(var eventInfo ValueEvent)
> var
> strOldValue,
> strNewValue String
> endVar
>
> strOldValue = self
> doDefault
> strNewValue = self
>
> AddLog("Status changed from " + strOldValue + " to " + strNewValue)
>
> endMethod
 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Jim Giner

External


Since: Mar 14, 2008
Posts: 25



(Msg. 4) Posted: Fri Aug 22, 2008 4:04 pm
Post subject: Re: changevalue not triggering with table lookup [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes - what Jim says is very true - one of the most amazingly 'wrong' things
that pdox developers did a long, long time ago was to void the alias concept
when it came to table lookups. So off-target in their grand scheme of
things.

"Jim Hargan" wrote in message

> Another way to approach this is to call a dialog form you design yourself,
> rather than use the built-in lookup. You've already discovered one reason
> to do this. Here's another, even better, reason: the path to the lookup
> table is hard-coded in the table structure. If you ever change a directory
> or drive, your table won't open. In Version 8, I've had this cause table
> corruption and had to restore from a backup. (In later versions, moving
> everything to the old locations worked, but not V8.)
>
> --
> Jim Hargan
>
> -
> On Fri, 22 Aug 2008 11:29:17 -0500, Ryan Lindsey wrote:
>
>> I am currently using Paradox 8.
>>
>> I have a status field. Users can change this status via a table lookup
>> (ctrl+space).
>>
>> My problem is that I want to add a log each time it's changed. My choice
>> was
>> to put the code into the changeValue event but it seems the event does
>> not
>> even get triggered when changing the value via ctrl+space. It will get
>> triggered if I actually type in the new status as long as I type
>> something
>> that's in the lookup.
>>
>> Am I just completely missing something? changevalue code is below but it
>> is
>> never executed upon changing the field via the lookup.
>>
>> method changeValue(var eventInfo ValueEvent)
>> var
>> strOldValue,
>> strNewValue String
>> endVar
>>
>> strOldValue = self
>> doDefault
>> strNewValue = self
>>
>> AddLog("Status changed from " + strOldValue + " to " + strNewValue)
>>
>> endMethod
 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Jim Moseley

External


Since: Jan 10, 2008
Posts: 16



(Msg. 5) Posted: Sun Aug 24, 2008 5:28 pm
Post subject: Re: changevalue not triggering with table lookup [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ryan,

You can get the changeValue triggered with this code in the object's Action
method:

if eventInfo.id() = DataLookup then
self.action(EditCommitField)
endif

HTH,
Jim Moseley
 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Ryan Lindsey

External


Since: Aug 22, 2008
Posts: 2



(Msg. 6) Posted: Mon Aug 25, 2008 11:24 am
Post subject: Re: changevalue not triggering with table lookup [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you all for the info. I thought I was just spinning my wheels.

Ryan

"Jim Moseley" wrote in message

>
> Ryan,
>
> You can get the changeValue triggered with this code in the object's
> Action
> method:
>
> if eventInfo.id() = DataLookup then
> self.action(EditCommitField)
> endif
>
> HTH,
> Jim Moseley
 >> Stay informed about: changevalue not triggering with table lookup 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
changevalue and newvalue - Newvalue is triggered when a new value is entered into a field but is also called on opening. I have a rather large database which has similar fields (we will call them ASA1 and ASA2) in separate, but linked tables. The fields are not identical for..

canot bind ns-table to another table - Hello, I have the following problem: Trying to bind a look-up-table to a related table I get the following error: Keine Übereinstimmung zwischen Fremd- und Primärschlüssel possible translation: Primary Index and foreign?? strange??-index do not match...

cannot bind look-up-table to another table - Hello, I have the following problem: Trying to bind a look-up-table to a related table I get the following error: Keine Übereinstimmung zwischen Fremd- und Primärschlüssel possible translation: Primary Index and foreign?? strange??-index do not match...

Problem exporting table - Howdy all. On my XP box I'm having problems exporting a private tbl (STMT01TblStruct). Err displayed in status bar: String list: The specified file cannot be found. Pdox vers used on this box is: 10.0.0.719 But the export capability works on my NT4..

Help with Paradox 9 table schema - I'm a total newbie to Paradox and I need some help creating my database tables. I work with Paradox 9 through Borland C++ Builder 2006. I want to have two database tables, one called Transactions and another called TransactionDetails. Transactions has..
   Database Help (Home) -> Paradox All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]