Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changeValue

Status
Not open for further replies.

sbell

Programmer
Apr 18, 2002
9
US
The changeValue value event is not triggered when a value is selected from a lookup table. How do I overcome this?
 
shell,

You need to override the dataLookup action in the action event(). Add code before the default behavior to replace the built-in looup code with your own and add code after the default behavior to trigger some behavior based on the lookup value selected by the user.

Hope this helps...

-- Lance
 
I don't know how to override the dataLookup action in the action event() or add code before the default behavior to replace the built-in lookup code with my own. Can you give me example code please? This problem has caused me grief for years.
 
Me too. Though only for the past 18 months.

Avidly looking forward to a solution.

Bystander
 
Sorry for the delay in replying. Things have been hectic on this end.

To have changeValue() called for a given field object after the user sucessfully uses table lookup to change a field's value, you need to add code to an appropriate action() event. The following example is taken from the action event() of a field object bound to a lookup table:

Code:
method action(var eventInfo ActionEvent)
var
   atOldValue Anytype
endVar

   if eventInfo.id() = dataLookup then
      atOldValue = self.Value
      doDefault
      if eventInfo.errorCode() = peOK then
         if atOldValue <> self.Value then
            self.Value = self.Value
         endIf
      endIf
   endIf

endMethod

When you move off the field, changeValue gets called.

Mind you, this achieves the effect, but may not be the most appropriate way to accomplish what you're after. Much depends on why you need changeValue called after a table lookup. There may be other, more appropriate ways to accomplish the same results.

Hope this helps...

-- Lance
 
Lance,

Many thanks. That seems to be just the ticket. I need to use it to populate a change log for audit purposes.

Regards

Bystander
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top