Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

Data validation in bBrowser 30 Dec 2019 09:42 #12394

  • BiggyRat
  • BiggyRat's Avatar
  • Topic Author



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?

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

Data validation in bBrowser 30 Dec 2019 13:10 #12395

  • Joachim Bieler
  • Joachim Bieler's Avatar


  • Posts: 36
  • 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

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

    Data validation in bBrowser 30 Dec 2019 13:21 #12396

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    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...

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

    Data validation in bBrowser 30 Dec 2019 13:52 #12397

    • Joachim Bieler
    • Joachim Bieler's Avatar


  • Posts: 36
  • 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

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

    Data validation in bBrowser 30 Dec 2019 14:00 #12398

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    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?

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

    Last edit: by BiggyRat.

    Data validation in bBrowser 30 Dec 2019 14:23 #12400

    • Joachim Bieler
    • Joachim Bieler's Avatar


  • Posts: 36
  • Sorry, I mean 'bSample - Edit.aef'.

    Regards,
    Joachim

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

    Data validation in bBrowser 30 Dec 2019 14:38 #12401

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    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

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

    Data validation in bBrowser 31 Dec 2019 07:04 #12416

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    Got it! Thanks very much Joachim for the pointers!

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

    • Page:
    • 1