fbpx
Welcome, Guest
Username: Password: Remember me
Please use this forum for suggestions to the XSharp Development Team
  • Page:
  • 1

TOPIC: Morph/Unmorph Events for Data Bound Controls

Morph/Unmorph Events for Data Bound Controls 10 Jan 2020 16:00 #12552

  • dCipher's Avatar

  • dCipher

  • Topic Author


  • Posts: 1
  • Hi

    I do not know if you already have this feature but in my framework I does not use VFP's built in data binding. Instead I created a GetData() and SetData() methods for all my data bound controls. The GetData() method read the bound field data from the table. As part of the process it passed the data to the Morph() method which allowed me to modify the data before it was sent to the control. This is a very powerful way to modify data that will be displayed in the control as well as executing other functions such a decrypting data, hiding controls based on the value found in the table etc. The Unmorph() is used to convert the control value back to what should be stored in the table. The code below gives the basic idea where "This" is the data bound control.
       This.Value = This.GetData(This.ControlSource)
       Procedure GetData(teVal)
           ....
          Return This.Morph(teVal)
       EndProc
       Procedure Morph(teVal)
          ...
          Return teVal)
       EndProc

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1