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

Refresh Embedded Browse

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

    Refresh Embedded Browse

    I have read everything/tried everything I can find out here relating to refreshing an Embedded Browse.

    - Form with "Parent" on top... Embedded Browse of "Children" below.
    - Form Properties include a Filter on the "Child" table.
    - Changing a drop-down, changes the value of a variable in the 'Child' Filter

    How 'should' I cause the Embedded Browse to refresh? I assume my drop-down's "Change" Event should refresh, resync, whatever... but I have tried everything... with very inconsistent results. I am not trashing Alpha, but without any changes to my code or the data... I seem to see, from time to time, execution by execution, minute by minute... changes in behavior of the application.

    What I am looking for is how others develop Forms like this... that result in a stable, predictable application. This cannot be, should not be, this hard. I hope I am the idiot here... but I'm starting to believe that certain portions of Alpha are just plain "flacky." That's fine... even understandble in a product this robust... but I need a "best practice" for this very typical application.

    Thanks,
    "all things should be as simple as possible... but no simpler"

    Mike

    #2
    Re: Refresh Embedded Browse

    Mike, how about posting a sample?

    Comment


      #3
      Re: Refresh Embedded Browse

      Thanks for the reply.

      I'll work on that... but it's not as easy as you may think... long boring story.

      But, in the mean time... do you/does anyone have any suggestions as to what works/doesn't? There just are not that many moving parts here... you know?

      How 'should' one cause Alpha to refresh (resync, whatever) an Embedded Browse when the Filter associated with it is modified?

      Sorry, just frustrated here...

      I'll put together something/a sample and upload as soon as I can.

      Thanks,
      "all things should be as simple as possible... but no simpler"

      Mike

      Comment


        #4
        Re: Refresh Embedded Browse

        The sequence I would expect would be something like this:

        a) user changes desired filter
        b) onChange runs a new query against the embedded browse object
        c) onChange refreshes display of the browse object

        Should not be terribly difficult, but changing the variable used in the filter expression defined initially in the properties of the form layout, alone, will probably not get it done.

        Comment


          #5
          Re: Refresh Embedded Browse

          Tom,

          According to Alpha's Help, there are a number of ways, methods, etc. to cause the engine to do what one would expect when the filter is changed. One of those mentions, from the Help, is below.

          But... it certainly does not seem to work.

          ========================================
          <OBJECT>.RESYNCH()

          Syntax

          <OBJECT>.RESYNCH()

          Description

          The <OBJECT>.RESYNCH() method applies to:

          Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)

          Forms (for <OBJECT> use either the <FORM> pointer, the name of the form, PARENTFORM, or TOPPARENT)

          The <OBJECT>.RESYNCH() method does a new query, re-fetches all data for the form or browse, and then repaints it.
          Supported By

          Alpha Five Version 5 and Above

          Limitations

          Desktop applications only.

          Example

          This script is attached to a button on a form. It re-synchronizes the form with the data in the table and repaints all of the controls on the form, including any embedded browse controls.

          Parentform.resynch()


          This script refreshes an embedded browse named browse1. Note that an embedded browse must have focus before being updated.

          browse1.activate()

          browse1.resynch()
          ===============================================
          "all things should be as simple as possible... but no simpler"

          Mike

          Comment


            #6
            Re: Refresh Embedded Browse

            Hi

            I'm still using v8, and browses have always seemed flaky. What one procedure works for doesn't necessarily work for another, but whenever I've used a filter, the following seems to work best consistently.

            Code:
            [I]formname[/I]:[I]browsename[/I].Fetch_First()
            [I]formname[/I]:[I]browsename[/I].Activate()
            [I]formname[/I]:[I]browsename[/I].Resynch()
            If It Works First Time, There's Something Wrong!!!

            Comment


              #7
              Re: Refresh Embedded Browse

              Mike, I don't think the help file contemplated the use of a base level query. I think they were talking about a different situation. i.e. refreshing the display when an external process (another form for example) has changed the underlying data. Resynching will rerun the original query and thereby adjust the display for the changes that were made externally.

              Here, you're doing something entirely different. You're trying to change the properties of the form layout itself, by manipulating the base filter expression in the layout. When you store the filter expression in the form properties you create a base level query. In my experience Resynch cannot change the base level query. You must create a new base level query, then refresh the display.

              Comment


                #8
                Re: Refresh Embedded Browse

                Tom,

                I guess... but the fact that "sometimes" it re-syncs (using the word in the English sense vs the method sense) and sometimes it doesn't, indicates that perhaps the engine doesn't quite know what it intends to do. That's the scary part.
                "all things should be as simple as possible... but no simpler"

                Mike

                Comment


                  #9
                  Re: Refresh Embedded Browse

                  You say:
                  Originally posted by michaelwpayton View Post
                  I have read everything/tried everything I can find out here relating to refreshing an Embedded Browse.
                  I believe you did. You probably didn't read the repeated pledges I made time and again and every chance I had, so I will try it one more time:

                  Please DO NOT, NOT EVER,.. USE A FORM BASEQUERY.

                  No, it is not entirely your fault. You'd say: Alpha offers it then why no use it? And why doesn't it work?
                  Alpha offers it BUT you've got to understand what it does and how it works.
                  And why doesn't it work? It does, but if you don't quite know how it works you'd think it doesn't.

                  In a sense, you are trying a Harry Houdini stunt and it is not going your way. There is no getting out of that straight jacket or those shackles.

                  How so?
                  You have a form basequery.
                  That basequery has a filter that has a variable.
                  You want to be able when you change the value of that variable, to see the new child records that meet the new value.
                  Sounds simple.
                  It is. But not exactly.
                  Why?
                  Because you keep going back into that same straight jacket known as "basequery" as a final step. So, even though the variable changes and even though the filter changes, but right before Showtime, you pass through the same old basefilter that is part of the form design so all the changes in the variable and filter, amount to nothing when you finally go through that base filter.
                  Let's do it slow motion:
                  1-You load the form, the child records shown are compatible with the filter in the basequery
                  2-That filter is based on a variable
                  3-You change the variable somehow
                  4-Now you want by whatever maneuvers you employ to see child records that meet the new value
                  5-Not a chance. Because in the final step as form is refreshed, it will PASS THROUGH THAT BASE FILTER.
                  Unless you physically change the definition of that filter, you don't have a chance. I don't believe alpha provides that ability. I haven't looked and looking would be a major waste of time, as I have no intention of ever using a base filter.

                  Now I could be wrong and someone might have a way to make this work even with the base filter and this Harry Houdini metaphor is totally wacky, but personally I wouldn't even try. It's waste of time. I just think base filter is such a bad idea. The board is replete with threads that had to do with base filter. Search the board and you will see and you will also see that every time I sounded off the same message.

                  What is the alternative?
                  Take out that base filter.
                  Run a query on OnInit event and later at anytime you change the variable.
                  Last edited by G Gabriel; 02-26-2009, 08:57 PM.

                  Comment


                    #10
                    Re: Refresh Embedded Browse

                    G., thanks for the explanation, (again). I finally am beginning to understand what you are saying concerning the base query. I'll begin to implement the suggestion.
                    Ernie

                    Comment


                      #11
                      Re: Refresh Embedded Browse

                      G, changing the basequery for a form is not especially difficult.

                      Assume the existence of a form called "Form1", based on the Customer table in AlphaSports. Assume that the designer embeds this filter expression in the properties of the layout:
                      Code:
                      "Bill_State = 'MA'"
                      This will limit the display to customers in Massachusetts. To change this so that the form will be limited to customers in California, you'd do this...
                      Code:
                      Form1.BaseQueryRun("Bill_State = 'CA'","Lastname")

                      Comment


                        #12
                        Re: Refresh Embedded Browse

                        Originally posted by michaelwpayton View Post
                        - Form Properties include a Filter on the "Child" table.
                        - Changing a drop-down, changes the value of a variable in the 'Child' Filter
                        Try dropping the form level filter and use code instead. As someone said, put this in the OnInit:
                        Code:
                        this:tables:child_table_name.filter_expression = "Your_Item=whatever"
                        this:tables:child_table_name.order_expression = ""
                        this:tables:child_table_name.query()
                        Then in the dropdown's OnChange event, put this:
                        Code:
                        parentform:tables:child_table_name.filter_expression = "Your_Item="+s_quote(vItem)
                        parentform:tables:child_table_name.order_expression = ""
                        parentform:tables:child_table_name.query()
                        parentform.resynch()
                        browse_name.refresh()   ''not sure you need this line
                        Peter
                        AlphaBase Solutions, LLC

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


                        Comment


                          #13
                          Re: Refresh Embedded Browse

                          Thanks everyone... we coded around it... I appreciate your counsel and patience.
                          "all things should be as simple as possible... but no simpler"

                          Mike

                          Comment


                            #14
                            Re: Refresh Embedded Browse

                            Originally posted by Tom Cone Jr View Post
                            G, changing the basequery for a form is not especially difficult.[/CODE]
                            Tom:
                            That might very well be. I just don't see the point of constraining the form with a basequery when you could run a query anytime you need it, when you need it.

                            Comment


                              #15
                              Re: Refresh Embedded Browse

                              That might very well be.
                              Right. It is. :)

                              Using queries that are dynamic (not embedded in the structure of the layout) is much more flexible, and in the hands of an experienced developer is certainly the way to go. I suspect basequeries are available to assist the less experienced. Folks who can build a filter expression with the help of form design genies, but who are baffled or intimidated by the prospect of writing code to do the same thing. I rarely use basequeries myself, for example. I mentioned the <form>.basequeryrun() method only because it sounded as though you might have forgotten about it. The mention was not intended to suggest that manipulating basequeries is the preferable course in the typical case. In cases where the designer wants to let the user change the filter applicable to the form the use of basequeries is not the preferable course.

                              -- tom

                              Comment

                              Working...
                              X