Data validation in bBrowser

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
Anonymous

Data validation in bBrowser

Post by Anonymous »

Ive been all over the manual, through all the examples, but cannot find out how to validate an entry in a bbrowser object.

All I want to achieve is if the user enters a value larger than another display a warning box.

Specifically if _Field->AMTPAID > _FIELD->INVGT. In other words, they paid more than the invoice total, spit out a warning box.

Can someone please enlighten me?
User avatar
Joachim Bieler
Posts: 36
Joined: Mon Aug 19, 2019 1:51 pm

Data validation in bBrowser

Post by Joachim Bieler »

You can use the callback method CellEdit() to validate values during a cell edit process. The method CellEdit() is called automatically by the bBrowser in the owner of it. The method is passed an object of class bCellEditEvent. A validation of the edit value would be possible for example if the access bCellEditEvent:EditMode has the value BEDIT_END. You find an example for this in the sample application 'bSample - Edit.aef'. Please have a look in method dtwEditDBStruct:CellEdit().

Regards,
Joachim
BiggyRat

Data validation in bBrowser

Post by BiggyRat »

Thanks Joachim, I've tried that, from the sample file, it works, but not instantly. If the value is 0.00 then I enter 700.00 (which is over the limit and should trigger it) it doesn't flag the message until after I've REENTERED the field a second time...
User avatar
Joachim Bieler
Posts: 36
Joined: Mon Aug 19, 2019 1:51 pm

Data validation in bBrowser

Post by Joachim Bieler »

I'm sorry, but I have no idea what the problem might be. Please send me a Test-Application (as source code) with that I can reproduce the problem. The easiest way to do this is to use the sample application 'bSample - CellEdit.aef' and adapt it in such a way that the problem occurs.

Which version of bBrowser do you use?

Regards,
Joachim
BiggyRat

Data validation in bBrowser

Post by BiggyRat »

Ok, ill try that, thank ypu Joachim. I use bbrowser 4 for VO Pro with source code Can't say I've seen celledit.aef is it part of the install?
User avatar
Joachim Bieler
Posts: 36
Joined: Mon Aug 19, 2019 1:51 pm

Data validation in bBrowser

Post by Joachim Bieler »

Sorry, I mean 'bSample - Edit.aef'.

Regards,
Joachim
BiggyRat

Data validation in bBrowser

Post by BiggyRat »

Ah, OK, so I'm not 100% mad then! <g> To be honest I deleted all the code I'd tried before, and it's 12:45 (almost) in the morning, but this is where it sits atm:

method CellEdit(oEvent) class AInvReceiptWin
// callback method for cell edit
local oColumn as bDataColumn
Local cText

// evaluate edit mode
if oEvent:EditMode=BEDIT_CREATE
// create special edit controls
oColumn := oEvent:Control:GetOpenColumn(oEvent:EditCell:Column)
if oColumn:ValType="D"
oEvent:EditControl := oEvent:Control:EditCreate(oEvent:EditCell:Column, oEvent:EditCell:Row, oEvent:EditCell:RecNo, #DateTimePicker)
endif
endif
/* if oEvent:EditMode=BEDIT_END
// close edit
oColumn := oEvent:Control:GetOpenColumn(oEvent:EditCell:Column)
if oColumn:FieldSym=#AMTPAID
// column NAME
// check field name
cField :=oEvent:EditControl:Value

// search field name in server
oasServer := self:oDCBrowser1:Server
oasServer:SuspendNotification()
iRecNo := oasServer:RecNo */

return nil
BiggyRat

Data validation in bBrowser

Post by BiggyRat »

Got it! Thanks very much Joachim for the pointers!
Post Reply