PB 6.5 rowfocuschanging

Posted on 2006-03-23
Last Modified: 2013-12-26
I have something strange happening and I'm not quite sure why.  I have 2 datawindows dw_master, dw_child. When a user clicks on a new row in the master I have code in the rowfucuschanging of dw_master that will prompt user to save changes if there are any. The messagebox options are yes, no, cancel.

When I press cancel, I'm prompted again to save my changes, I press cancel again and this time I'm returned to the window. Why would the rowfocuschanging be fired twice??

NOTE: This is a pfc datawindow, so I'm not sure if that has anything to do with it. The master detail is not setup. Do I have to set up the master/detail relationship to get rowfocuschanging to work.

Here is the code that was added to the rowfocuschanging

IF dw_acct_code.ModifiedCount() > 0 OR dw_acct_code.DeletedCount() > 0 THEN
      //Case: Changes are pending in the Account Code dw
  li_rtnval = gnv_app.Message("APPL_ABS_LD_SAVE_ACCOUNT_CODES")
   CHOOSE CASE li_rtnval
      CASE 1 //user chose ok
       //save the changes, if save fails prevent the rowfocus from changing
            IF wf_save() <> 1 THEN RETURN 1
     CASE 3 //user chose cancel
      //prevent the row from changing
      This.SelectRow(0, FALSE)
      This.SelectRow(currentrow, TRUE)
      RETURN 1
Question by:tacinpgh
    LVL 18

    Expert Comment


    try commenting the lines...
    This.SelectRow(0, FALSE)
    This.SelectRow(currentrow, TRUE)

    and see if the problem persists...

    LVL 14

    Expert Comment


    If you are using pfc datawindow then why are you not using it's rowmanager and linkage services ????

    It will handle everything without any extra coding.


    Author Comment


    The first thing I did was to comment the "select row" lines. The problem was still occurring.  I think I have found a workable solution. I believe the problem is having messagebox in the rowfocuschanging. If I take the messagbebox out and place it in a post_event  of rowfocuschanging, Thw window is acting correctly.

    Sandeep -- I inherited this app along with the all of the bugs.  Can you point me to documentation about setting up the linkage?? I would like to use the linkage service if it is possible

    Author Comment

    Sandeep -- I have set up the linkage but when I modify detail records and then select a new master record I am not prompted to save my detail record changes, The records are just lost.

    I put the linkage in the pre-open event of the window


    dw_detail.inv_linkage.of_Register("acct_code_idx_id", "acct_code_idx_id")
    LVL 14

    Accepted Solution


    The documentation comes with installation setup itself if you have installed pfc. It must be there in help directory (c:\program files\sybase\powerbuilder8.0\help). File name is pbpfcXX.hlp (where XX is version).

    and here you need to set two more services for linkage service.

    inv_linkage.of_setconfirmondelete(TRUE) ( this is if required )


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Safearray problem c++ 4 73
    How can I import a NetBeans Java project into Eclipse? 4 1,180
    Tomcat6 in eclipse 2 31
    C#  WebForms or MVC 4 82
    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now