Web Connection
UnbindFormVars bug ?
Gravatar is a globally recognized avatar based on your email address. UnbindFormVars bug ?
  Marcel DESMET
  All
  Aug 6, 2019 @ 05:37am

Hello

   IF lcType # "L" AND !THIS.IsFormVar(lcFormVar)
      LOOP
   ENDIF   
   lcValue = THIS.Form(lcFormVar)
   
   --> 
   
     
   CASE lcType = "L"
         IF INLIST(UPPER(lcValue),"T","ON","Y",".T.","1")
            loObject.&lcField = .T.
         ELSE
            loObject.&lcField = .F.
         ENDIF

This code means that every logical field in the odata object are set to false when not in the form ( lcValue is empty when not in the form .. ) ?

Thanks, Marcel

Gravatar is a globally recognized avatar based on your email address. re: UnbindFormVars bug ?
  Mike McDonald
  Marcel DESMET
  Aug 6, 2019 @ 07:35am

Marcel -

See this thread for an explanation of that behavior.

- Mike McDonald

Gravatar is a globally recognized avatar based on your email address. re: UnbindFormVars bug ?
  Rick Strahl
  Marcel DESMET
  Aug 6, 2019 @ 07:37am

Marcel,

The behavior is not a bug - it's by design based on the limitations of HTML. It can't work any other way and you have to explicitly exclude logical fields you don't want bound.

You have to exclude logical fields that are not bound explicitly because HTML has no way to detect the difference between an unchecked checkbox/radio or one that isn't there.

The thread Mike referenced has a good discussion of the why's of this behavior.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: UnbindFormVars bug ?
  Marcel DESMET
  Rick Strahl
  Aug 6, 2019 @ 09:11am

Thank you !
Marcel

© 1996-2019