Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Browse resynch/refresh - proper method?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Browse resynch/refresh - proper method?

    I believe in v5 one used browse.refresh() to properly update a browse after an xbasic query, etc.

    In v7. (not sure about v6) we had to switch to parentform.resynch() to do the same, and if you used browse.refresh() you had big problems.

    What is the proper method in v8? parentform.resynch() + browse.refresh() ?

    Will this (or whatever the recommended method is) hold true, for say v9?

    This is not a trivial question. When the change was made in v7, I for one had to change the xbasic method for dozens of embedded browses. To this day, I keep finding some/code that needs to be fixed. Before I begin the laborious conversion process, I would just like to have a sense of what we might expect.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



    #2
    Re: Browse resynch/refresh - proper method?

    Someone must know the answer - at least to the question of the current (i.e v8) proper resynch xbasic method for embedded browses. Eh?

    P.S. Once someone tells me the secret, I'm going to wrap a function around the method. Then I will place the function in the zillion and one code snippets as need be. Then, when Alpha changes the method in v9, all I'll have to do is modify the function, so if version = 7, do this, if version = 8, xyz and so on. But first I would like to know the secret, thanks.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: Browse resynch/refresh - proper method?

      Peter, so far, in testing V7 techniques work in V8. I am going to convert a big and complicated app from V7 to V8, in the near future. And I'll let you know if I run into any problems. But this was the one I moved from V5 to V6 and then to V7 and had to change all browse.refresh()'s to parent form.resynch() when moving to V7.
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #4
        Re: Browse resynch/refresh - proper method?

        Thanks, Martin. I have seen some differences in behavior between v7 & v8. For example, on one browse I have a calc field that changes value based upon a variable checkbox. Here are the differences:

        v5 = browse.refresh()
        v7 = parentform.resynch()
        v8 = parentform.resynch() + browse.refresh() - if I don't use both, it won't update the browse properly.

        I have seen some other variations, as well. I just haven't figured out a 100% consistent method, yet. But, I agree, parentform.resynch() does work in many (perhaps the vast majority) of cases.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #5
          Re: Browse resynch/refresh - proper method?

          Somewhere I remember seeing that there are some new "events" for browse objects and I believe some (most?) of them were for working with specific cells. I was wondering if one of these would be a better solution.

          Anybody know where to find this list?

          I can't find it in the Help files. It might be there but not in the "What's New in V8" section and not in the first 50 or so of the list of 500 returned by searching "browse". Searching on "browse event" without quotes wasn't much better and searching for "browse event" in quotes was useless.

          Comment


            #6
            Re: Browse resynch/refresh - proper method?

            A search of object events gives this:

            Events for Browse Objects
            The browse object triggers the following events:
            Note : Placing a browse on a form creates the browse object. There are no events for stand alone browse windows, only browse objects on forms.
            Event Name
            Occurs When
            OnExit
            When the browse object is exited. This will occur after the form that encloses the browse object is closed.
            OnInit
            When the browse object is created. This will occur after the form that encloses the browse object is instantiated.
            OnFetch
            When the browse is re-synchronized (i.e. when Alpha Five fetches a record). Whenever the user navigates to a new row in the browse, this event and the OnRowChange event will fire. However, the OnFetch event will also fire if the browse is re-synchronized without navigating to a new row.
            CanRowChange
            Just before you navigate to a new row.
            OnRowChange
            When you navigate to a new row in the browse.
            OnRowDblClick
            When you double click on a row selector. If the browse object is read only, then this event will fire if you double click within the row.
            CanArrive
            Before the browse object on the form gets focus.
            CanDepart
            Before the browse object on the form can loose focus.
            OnArrive
            After the browse object on the form has got focus.
            OnDepart
            After the browse object on the form has lost focus.
            In the following example, assume you have a table called Customers. You have a form for this table that shows a browse view of your records. When you double click on a row in the browse, a form called Customer_dlg is opened as a dialog allowing you to edit the record.
            'Open "customer_dlg" invisibly
            frm = :form.load("customer_dlg", "dialog")
            'Set a variable to the current record's customer Id value
            cust_id = parent:browse1:cust_id.value
            'Set the index on the "customer_dlg" form
            frm.index_set("cust_id")
            'Find the correct record
            frm.find(cust_id)
            'Show the dialog box this also automatically activates it
            frm.show()
            'When the user closes the dialog box, the dialog is not really
            'closed. It must be closed with the close() method.
            frm.close()
            In the following example, a script attached to the CanDepart event causes a calculated field in the parent table to update when focus leaves the embedded browse. Consider the sample Invoice application that ships with Alpha Five. Say you wanted to have a summary field in the invoice_header table that summarized the extended totals in the child invoice_items table. Assume that you had a field in the invoice_header table called summary (numeric 12,2), and had defined the following calculated field rule for this field:
            dbsum("invoice_items", "invoice_number", INVOICE_NUMBER, "extension")
            While this expression is correct, you would find that the field was not displaying the correct value when you entered new line items into the embedded browse. The reason for this is that calculated fields only evaluate when a record is in change or enter mode, and when you are entering line item records, the invoice_header table is in view mode, not change or enter.
            By putting this script on the embedded forms CanDepart event, you can force the calculated fields in the invoice_header table to recalculate:
            parentform.commit()
            t = table.current()
            t.change_begin()
            t.change_end(.T.)
            parentform.resynch()
            The following sequence of events were generated when an operator moved the cursor to a embedded browse, selected a row, changed one of the entries, and moved the cursor off the embedded browse.
            Sequence of Events for Embedded Browses

            Event Name
            Type

            Event Name
            Type
            1
            CanArrive
            Control
            11
            OnChangeRecord
            Record
            2
            OnArrive
            Control
            12
            OnFetch
            Form
            3
            CanRowChange
            Control
            13
            CanChangeRecord
            Record
            4
            OnFetch
            Form
            14
            OnChangeRecord
            Record
            5
            OnRowChange
            Control
            15
            CanWriteField
            Field
            6
            OnActivate
            Form
            16
            CanDepart
            Control
            7
            CanArrive
            Control
            17
            OnDepart
            Control
            8
            CanEditField
            Field
            18
            OnWroteField
            Field
            9
            OnEditField
            Field
            19
            CanSaveRecord
            Record
            10
            CanChangeRecord
            Record
            20
            OnSaveRecord
            Record





            Russ

            Comment


              #7
              Re: Browse resynch/refresh - proper method?

              Well, it lost it's formatting, but you get the idea.

              Russ

              Comment


                #8
                Re: Browse resynch/refresh - proper method?

                That's the OLD stuff. There are a whole bunch of NEW events available in v8 but I think they have to be done in xbasic somehow.

                I remember seeing them somewhere but I can't find them now - when I need them.

                And, that last long list is just a list of ALL events presented in the sequence that they occur when you have an embedded browse on a form. Some of those events are NOT browse events but are instead record events, form events, and field events. (Note the "Type" column.)
                Last edited by CALocklin; 03-11-2007, 12:32 PM.

                Comment


                  #9
                  Re: Browse resynch/refresh - proper method?

                  Cal, I think you may be referring to events associated with the new buttons that can be embedded in a browse, as well as clicking on a column title, and stuff like that.
                  Cole Custom Programming - Terrell, Texas
                  972 524 8714
                  [email protected]

                  ____________________
                  "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                  Comment


                    #10
                    Re: Browse resynch/refresh - proper method?

                    Cal
                    Glad to see I as not loosing it. I was looking for the same think a while back. When I was reading it I knew where I was going to be able to use them to fix some problems I had. I am thinking it was in the preview section that got removed when V8 became official or maybe they have yet to get that working so they removed it from the features. I even looked in places in v8 that I could think of as to where I could put the progaming.

                    Comment


                      #11
                      Re: Browse resynch/refresh - proper method?

                      Originally posted by martinwcole View Post
                      Cal, I think you may be referring to events associated with the new buttons that can be embedded in a browse, as well as clicking on a column title, and stuff like that.
                      Could be. Where's the Help info?

                      Comment


                        #12
                        Re: Browse resynch/refresh - proper method?

                        Well, LOL, when you add a button, as I recall, there is a button that says - "how to write script for this item" or some such

                        and basically the same for the column title button, for the browse property ontitleclick

                        you can find out what to do there - but I don't know where the "documentation" is, if at all.
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                          #13
                          Re: Browse resynch/refresh - proper method?

                          Originally posted by martinwcole View Post
                          Well, LOL, when you add a button, as I recall, there is a button that says - "how to write script for this item" or some such....
                          You're missing the point. There are some NEW (xbasic only?) events for something in browses - maybe just the buttons as someone else pointed out - but the problem is that I can't find any documentation on those NEW events. Even the What's New doesn't mention them but I'm sure I read something about them in one of the "flyers" that came out. Apparently nobody else can find them either and they won't do us much good until we can.

                          If anybody can find them, then we can determine if they will help solve Peter's issues. That was my original hope.

                          Comment


                            #14
                            Re: Browse resynch/refresh - proper method?


                            Cal
                            if this is what you are referring to here is sample of a few browses which has some events in it, i sent to Alpha a while back (i don't remember what the issues was)
                            Daniel Weiss
                            EZ Link Software

                            Comment


                              #15
                              Re: Browse resynch/refresh - proper method?

                              Peter

                              I used the parentform.resynch() and browse.refresh() after a find by key behind a button. It works intermittently. Sometime when clicking the button for a second time for another find by key it refreshes and jumps to the prevous find poition in the browse.

                              Any suggestions?

                              Peter

                              Comment

                              Working...
                              X