Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #10301 > unrolled thread

CellEdit connected to numeric field

Started byzodcomag@gmail.com
First post2017-03-16 05:11 -0700
Last post2017-03-16 23:46 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  CellEdit connected to numeric field zodcomag@gmail.com - 2017-03-16 05:11 -0700
    Re: CellEdit connected to numeric field "Karl-Heinz" <invalid@invalid.invalid> - 2017-03-16 17:30 +0100
    Re: CellEdit connected to numeric field zodcomag@gmail.com - 2017-03-16 10:53 -0700
      Re: CellEdit connected to numeric field "Gerhard Bunzel" <g.bunzel@domonet.de> - 2017-03-16 23:46 +0100

#10301 — CellEdit connected to numeric field

Fromzodcomag@gmail.com
Date2017-03-16 05:11 -0700
SubjectCellEdit connected to numeric field
Message-ID<491218bf-9063-495e-916b-50f54501cd51@googlegroups.com>
The numeric field is transformed into string in the bBrowser.
I try to edit this field, as follows:

   elseif oCellEditEvent:EditMode=BEDIT_INIT		
      if nCol = 2 
         oColumn := oCellEditEvent:Control: ;       
            GetOpenColumn(oCellEditEvent:EditCell:Column)
         oCellEditEvent:EditControl:Picture := "999,999.99"
         oCellEditEvent:EditControl:Value := Transform;
            (oColumn:Value, "999,999.99")
         H_rLock(self, oServer)      // locking the record
      endif

   elseif oCellEditEvent:EditMode=BEDIT_END		  
      if nCol = 2
         oColumn := oCellEditEvent:Control: ;      
            GetOpenColumn(oCellEditEvent:EditCell:Column)
         oColumn:Value := Val(oCellEditEvent:EditControl:TextValue)
         oCellEditEvent:EditFlags := _xor(dword(_cast, ;
            oCellEditEvent:EditFlags), BEDIT_FLAG_SAVEVALUE)
      endif

But the new value is not inserted into the bBrowse, and not updated into the sever.

In the DbEdit_End the oColumn:Value is the old value.
What an I doing wrong

Many thanks
Henry


 

[toc] | [next] | [standalone]


#10305

From"Karl-Heinz" <invalid@invalid.invalid>
Date2017-03-16 17:30 +0100
Message-ID<eivsstFhdtfU1@mid.individual.net>
In reply to#10301
Hi Henry,

> But the new value is not inserted into the bBrowse, and not updated into 
> the sever.
>
> In the DbEdit_End the oColumn:Value is the old value.
> What an I doing wrong


what happens when you respond in the Celledit() to BEDIT_COMMIT ?

e.g. doing something like:


    CASE oEvent:EDITMODE == BEDIT_COMMIT


        IF oDCYourBrowser:server:RLOCK ()

            oDCYourBrowser:server:FIELDPUT ( #Fieldxyz , 
oEvent:EDITCONTROL:Value )

            oDCYourBrowser:server:Commit()

            oDCYourBrowser:server:UnLock()

        else

           ? "error"


        ENDIF


regards
Karl-Heinz

[toc] | [prev] | [next] | [standalone]


#10306

Fromzodcomag@gmail.com
Date2017-03-16 10:53 -0700
Message-ID<12025667-6ed5-461e-ac74-94b17f5e9cfb@googlegroups.com>
In reply to#10301
Thanks Karl-Heinz

It does work, but the oEvent:EDITCONTROL:Value return a string, and it has to be Val() in order to Fieldput() it into the numeric field.

Thanks again

Henry

[toc] | [prev] | [next] | [standalone]


#10307

From"Gerhard Bunzel" <g.bunzel@domonet.de>
Date2017-03-16 23:46 +0100
Message-ID<oaf4jm$uov$1@news-1.m-online.net>
In reply to#10306
Henry,

if you set the value with a string - you will get return a string:
oCellEditEvent:EditControl:Value := Transform(oColumn:Value, "999,999.99")

What about this:
oCellEditEvent:EditControl:Value := oColumn:Value


HTH

Gerhard Bunzel


schrieb im Newsbeitrag 
news:12025667-6ed5-461e-ac74-94b17f5e9cfb@googlegroups.com...

Thanks Karl-Heinz

It does work, but the oEvent:EDITCONTROL:Value return a string, and it has 
to be Val() in order to Fieldput() it into the numeric field.

Thanks again

Henry 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web