Alpha Video Training
Results 1 to 18 of 18

Thread: OnRowDblclick won't add a record to another table

  1. #1
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default OnRowDblclick won't add a record to another table

    I am trying to add a new record to another table using the double click event in a browse and neither one of these scripts does anything - what am I missing?

    Code:
    if parent.mode_get()<> "VIEW" then
        parent.commit()
    end if
    ''select a client and doublclick to add a new Intake
    ''convert to XD Browse 
    dim global userid as c
    dim c as p
    dim t as p
    c = table.current()  'Client
    t = table.open_session("INT_HDR",FILE_RW_SHARED)
    t.enter_begin(.t.)  'honor field rules
    t.date_in = date()
    t.CLIENT_SSN = c.ssn
    t.CLIENT_ID = c.client_id
    t.MEMB_ID = c.memb_id
    t.CSWRKR = userid
    t.enter_end(.t.)
    t.close()
    Code:
    'Genie Generated: Open the table that you want to update...
    dim tbl as p 
    tbl = table.open("int_hdr",FILE_RW_SHARED)
    
    tbl.enter_begin()
    tbl.DATE_IN = a5_eval_expression("=date()",local_variables())
    tbl.CLIENT_SSN = a5_eval_expression("=Ssn",local_variables())
    tbl.CLIENT_ID = a5_eval_expression("=Client_Id",local_variables())
    tbl.MEMB_ID = a5_eval_expression("=Memb_id",local_variables())
    tbl.CSWRKR = convert_type(userid,"Character")
    tbl.enter_end(.t.)
    tbl.close()
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: OnRowDblclick won't add a record to another table

    Have you tried debugging to see which steps are actually being executed?
    There can be only one.

  3. #3
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    I don't know how to use the debugger. I will try tracing and see if that reveals anything. If all that fails, I suppose I could add a browse button...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: OnRowDblclick won't add a record to another table

    Set code as below. Debug window will/should open when onrowdblclick envent fires. Use F12 to step through each line of code.
    Code:
    Debug(1)
    if parent.mode_get()<> "VIEW" then
        parent.commit()
    end if
    ''select a client and doublclick to add a new Intake
    ''convert to XD Browse 
    dim global userid as c
    dim c as p
    dim t as p
    c = table.current()  'Client
    t = table.open_session("INT_HDR",FILE_RW_SHARED)
    t.enter_begin(.t.)  'honor field rules
    t.date_in = date()
    t.CLIENT_SSN = c.ssn
    t.CLIENT_ID = c.client_id
    t.MEMB_ID = c.memb_id
    t.CSWRKR = userid
    t.enter_end(.t.)
    t.close()
    There can be only one.

  5. #5
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    Not even the debugger opens... I'm going to try a msg box - nope, the event just will not fire in a stand alone browse. This is pre v5 behavior! I will restart Alpha and see if that helps.
    It didn't. Bug report next
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  6. #6
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,563

    Default Re: OnRowDblclick won't add a record to another table

    Robin

    Errr... you need the debugger... ;) all this time I thought you were using it....

    Please post an example of what you are doing. If we can prove it's an bug, then you can submit it.

    Something fishy...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: OnRowDblclick won't add a record to another table

    Al,

    I gave a shot at trying to duplicate something similar to what was described and received very inconsistent results from the onrowdblclick in a standalone browse. Most times clicking into a cell from another row and then double clicking did not fire the onrowdblclick. Then clicking into another cell in the same row and double clicking did. Usually clicking into the leftmost cell in a row and double clicking did fire the onrowdblclick but some times it only deselected the cell contents and placed the cursor at the end of the cell contents (text).

    I wonder if it has something to do with the Windows mouse click speed settings?

    Attachment is a Windows 10 Steps Recorder session illustrating the occasional onrowdblclick event firing, .mht format viewable in Internet Explorer.

    onrowdblclick.zip
    Last edited by Stan Mathews; 01-17-2017 at 02:54 PM.
    There can be only one.

  8. #8
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    In settings I have the debugger set to no for launching with every script error - but this should not effect the Debug(1) command used in a script should it?

    Also, when attempting the bug report on build 4811 I was prompted to update to 4815 - so I did, but neither will run this browse event.

    Stan somewhere in the help I read that if the browse is read only then double clicking on any field in the row should run the event. I don't think I tried that...nope no difference.

    @ Al - I posted the script above - including the AS genie code. But my code doesn't matter it won't even fire just the msgbox()
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  9. #9
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,563

    Default Re: OnRowDblclick won't add a record to another table

    Stan

    I think I have relied on double-clicking on the row selector on the left of the row for a consistent result.

    I've also used a right click menu with a UDF called from it rather than the double click.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  10. #10
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,563

    Default Re: OnRowDblclick won't add a record to another table

    Quote Originally Posted by MoGrace View Post

    @ Al - I posted the script above - including the AS genie code. But my code doesn't matter it won't even fire just the msgbox()
    I'm looking for an example of your table and browse, so we can do the same steps you are.

    Think of submitting the bug report to the messageboard before sending it to Alpha.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  11. #11
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: OnRowDblclick won't add a record to another table

    Al,

    I've never used the functionality in my efforts so I had to look it up. I have to agree that the documentation does specify that it fires when the row selector is double clicked. That said, it does sometimes fire when individual cells are double clicked.

    Learned a bit, still confused.

    Thanks
    There can be only one.

  12. #12
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,563

    Default Re: OnRowDblclick won't add a record to another table

    Quote Originally Posted by Stan Mathews View Post
    Al,

    I've never used the functionality in my efforts so I had to look it up. I have to agree that the documentation does specify that it fires when the row selector is double clicked. That said, it does sometimes fire when individual cells are double clicked.

    Learned a bit, still confused.

    Thanks
    If I have real estate (ie room), I'll build a button on the row for the user to click. Says like - Details

    Though usually real estate is at a premium.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  13. #13
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    It's probably some system issue I am having. Every time Win 10 updates, something gets messed up, which is why I didn't try a reboot yet. Selwyn and Jerry both of couse have 'no problems'. So I guess it's me.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  14. #14
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Updating table takes 5 sec in a local PC setup.

    here is an experiment and see if you can improve upon to suit your needs:
    https://www.screencast.com/t/8ldWKVRvA
    Code:
    dim brws as P
    dim record as n
    
    brws = topparent:Control_browse1.this
    record = brws.current_record()
    ui_msg_box("","Record is "+record)
    
    dim tbl as p
    'debug(1)
    tbl=table.current()
    dim name as c
    dim address as c
    dim city as c
    dim state as c
    dim zipcode as c
    name = tbl.NAME
    address = tbl.ADDRESS
    city = tbl.CITY
    state = tbl.STATE
    zipcode = tbl.ZIPCODE
    
    dim cs2 as c = ""
    cs2 = cs2 + "id=" + crlf()
    cs2 = cs2 + "name="+name+ crlf()
    cs2 = cs2 + "address="+address+ crlf()
    cs2 = cs2 + "city="+city+ crlf()
    cs2 = cs2 + "state="+state+ crlf()
    cs2 = cs2 + "zipcode="+zipcode+ crlf()
    
    
    record_add("t2", cs2)
    while the code that is seen in the video was experimental, here is the code, all that is necessary, to do what i did.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  15. #15
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    Hi Gandhi,
    Well except for not having to open and close the target table, I am not sure getting the string created is really worth it.

    In regard to the OP, I did make a new browse with a simple msgbox and the double click event does seem to be working correctly with no other frills added. So now I'll try my script on it and see if that works. It could be that in preparing the browse for an XD conversion, I messed up the XML - or something.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  16. #16
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    Here was the culprit that doesn't work in a browse

    if parent.mode_get()<> "VIEW" then
    parent.commit()
    end if

    Whereas this DOES
    if ClientList.mode_get()<> "VIEW" then
    ClientList.commit()
    end if
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  17. #17
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: OnRowDblclick won't add a record to another table

    You might try (for portablility)

    if this.mode_get()<> "VIEW" then
    this.commit()
    end if

    It would make sense that a standalone browse doesn't have a parent.
    There can be only one.

  18. #18
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: OnRowDblclick won't add a record to another table

    Just a note to myself that if you convert a stand alone browse to an xml browse for use in an xdialog, the name of the browse for your script becomes "generated_browse"
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. OnRowDblClick
    By David in forum Alpha Five Version 6
    Replies: 1
    Last Post: 10-05-2005, 09:22 PM
  2. onRowDblclick
    By Romy Huang in forum Alpha Five Version 5
    Replies: 6
    Last Post: 03-04-2005, 10:16 AM
  3. OnRowDblClick help help
    By davidhp in forum Alpha Five Version 4
    Replies: 15
    Last Post: 06-12-2002, 05:35 PM
  4. OnRowDblClick
    By Jerry Hartness in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-24-2001, 11:39 AM
  5. OnRowDblClick
    By Arthur Casse in forum Alpha Five Version 4
    Replies: 12
    Last Post: 10-20-2000, 06:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •