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

Embedded Browse on Form won't update correctly

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

    Embedded Browse on Form won't update correctly

    Can anyone suggest how I might get an embedded browse on my form to show industry code information correctly? Here is my problem.

    Referring to the schematic diagram below, I have a main form which shows all my client records in an Explorer-like display - clients shown in a browse list (BROWSEmain) on the left and the client details for the selected client on the top right.

    I also have industry codes showing in another browse (Browse1) and another classification system in one other browse (Browse2).

    The set on which this main form is based looks like this:

    - client table (clientno is the unique key)
    - industry codes table (linked to clientno in 1-to-many relationship)
    - other classification (linked to clientno in 1-to-many relationship)

    I allow no updating on the main form at all. Clicking on the "show" button opens the Industry Codes form (see attached) and allows the user to see:

    - all the industry codes in a list box on the left, and
    - all the assigned industry codes for the currently selected client in a second list box on the right.

    The user can then add to or remove from the list of codes for the selected client.

    The problem I have is as follows. After the user adds to or removes from the industry codes for the selected client, BROWSE1 on the main form displays codes incorrectly. The display problems are numerous including: line where code was previously now displayed as blank on a white background; remaining code displayed repeatedly, removed code still shows; added code not shown.

    I know my industry code update script is working correctly, for example if I close the main form and open it again at the same client, the BROWSE1 now displays the correct information.

    I have tried forcing BROWSE1 to update by including the following code in the OnActivate event attached to my main form, but to no avail:

    Code:
    parentform.commit() 
    parentform.resynch()
    parentform.refresh_layout()		' Refresh form layout.
    '
    browse1.activate()
    browse1.resynch()			' Refresh industry codes browse.
    '
    browse2.activate()
    browse2.resynch()			' Refresh other classifications browse.
    I have also tried including a order expression for the industry numeric code on the set (so that it's different to the default record number - previous experience with another problem with browses in A5). But this doesn't seem to work either (A5 won't allow numeric order by expressions, even when I use the str() function).

    So, does anyone have any good way of overcoming this problem with my browse display? I just want the display to show correctly after updating the industry code for a client without having to close and re-open the form again.

    #2
    OK, I guess that diagram really put everyone off. Here's the same diagram again and hopefully it can be read this time. :D

    Comment


      #3
      Take a look at some of the stuff Peter Wayne has published about refreshing browses. He's got some very enlightning stuff there.

      Basically, I've come to consider it this way. The browse is essentially displaying a certain query of records and (a) if records are added or removed from outside the form, it doesn't update very well unless your re-establish the query (see Dr. Wayne's stuff) and (b) if you want to update one of the existing records, it's best to either change the field object on the form itself or use Table.get() rather than Table.open().

      I've actually been known to have a routine that would close the form and re-open it. This works but there is a short flicker on the screen and you need to be sure you can get back to the desired record. However, by implementing "a" and "b" above, I haven't found this necessary any more.

      Comment


        #4
        Thanks, Cal. Interesting. Reading between the lines I think I am hearing that there is a known problem with Alpha Five in the situation I describe above. But what I want to do is nothing bizarre or out of the ordinary, surely.

        I want to open a second form, do some updating to a table there and then return to my original form and have it show the changes to this table I have made in the second form. Are you telling me I can't do this? Surely not. My first form is just displaying information based on a set - simple stuff that A5 should be able to handle with aplomb.

        There must be some Xbasic code I can add to the OnActivate event for the first form so that the records displayed in Browse1 are shown correctly. At the moment the display in Browse1 looks like a dog's breakfast. :(

        Comment


          #5
          Brett, I'd be curious to see the code you're using in the second form to update the user's records.

          Cal's advice is excellent. Unfortunately, refreshing an embedded browse object has occasionally been difficult for many of us over the years. We all look forward to the day when the browse object is rewritten.

          As Cal suggests, there's a difference in using the second form to write changes to the instance of the table being displayed in the first form, and using the second form to write changes to a new instance of the table being displayed in the first form. This is illustrated in Dr. Wayne's solution to a "freshenbrowse challenge" long ago:

          http://msgboard.alphasoftware.com/al...ight=challenge

          -- tom

          Comment


            #6
            I'll add my 2 cents. TOPPARENT.RESYNCH() works for me.

            Comment


              #7
              Originally posted by Edward Larrabee
              I'll add my 2 cents. TOPPARENT.RESYNCH() works for me.
              Nope, this definitely does not work in my case. I wish it did.

              Comment


                #8
                If it did (as it should) traffic on the A5 boards would drop by (my guess) 10% since I don't think any single topic has generated more traffic than this one.
                Finian

                Comment


                  #9
                  Originally posted by Tom Cone Jr
                  Brett, I'd be curious to see the code you're using in the second form to update the user's records.

                  Cal's advice is excellent. Unfortunately, refreshing an embedded browse object has occasionally been difficult for many of us over the years. We all look forward to the day when the browse object is rewritten.

                  As Cal suggests, there's a difference in using the second form to write changes to the instance of the table being displayed in the first form, and using the second form to write changes to a new instance of the table being displayed in the first form. This is illustrated in Dr. Wayne's solution to a "freshenbrowse challenge" long ago:

                  http://msgboard.alphasoftware.com/al...ight=challenge

                  -- tom
                  Tom, I have attached my code for the adds and deletions of the industry codes, as requested. Many thanks too for the link to Peter Wayne' message. I have downloaded and gone through his article - am still puzzled though. I will post another reply below on what I have now done.

                  Comment


                    #10
                    OK, thanks to all. Here is what I have now decided to do. I downloaded and experimented with Peter Wayne's example, without too much success and I couldn't really understand the code which was from an earlier version of the action scripting editor that I did not recognize. I was interested to learn that the browses are populated from a query rather than, as I had imagined, the set directly behind the main form. This makes the odd behavior of A5 a little more understandable.

                    I was amazed that this very same problem (browse on main form not being updated) has been around for so long. It has confounded the experts, people whose A5 expertise I have the utmost respect for, since at least 2002 and still the same problem persists. I'm afraid there will be no prizes from me to those responsible for leaving it for so long.

                    My interim solution has been to leave my 'OnActive' code on the main form virtually untouched except to add 'topparent.resynch()' to the start of the code (but I don't think this actually achieves anything). The other thing I have done is add some more code to the 'close' button on the second form that does the following:

                    1. opens the main form (the same instance)
                    2. issues a 'goto' record - the same record as had focus when the 2nd form was opened.

                    Now, this is not what I would call a solution, rather a work-around. The problem is still there, it's just less of a dog's breakfast now than it was before. I'll still keep looking for a better solution, as a better one is required, because I don't like giving half-baked solutions to a client with their completed application.

                    I hope the good folk at Alpha Software appreciate how serious a problem this is and can reassure us developers that steps will be taken to provide a more durable solution. After all this is supposed to be a database product for non-programmers and this type of problem has the potential to dissuade potential A5 users fast!

                    Comment


                      #11
                      Just as a note I have had many struggles with embedded browses over the past week plus. Luckly great threads by the community have really helped me out.

                      I would like to add my vote to this getting fixed in the future. Embedded Browse updates that it.

                      But thanks to the community and this forum. I finally have everything working nice and smooth.

                      Thank You,
                      Mike

                      Comment


                        #12
                        Re: Embedded Browse on Form won't update correctly

                        i know this is an old thread, but i have been having the same problem and just wanted to post the work around i used.

                        Code:
                        Dim Shared GotoRec
                        gotorec = recno("seed orders")
                        'msgbox(gotorec)
                        
                        'Go to first record in current form at parent level.
                        topparent.fetch_first()
                        'Go to a specified record number in current form at parent level.
                        DIM var_recno_target as N
                        var_recno_target = Gotorec
                        topparent.recno_goto(var_recno_target)
                        basically stores the current record number ( parent) to a variable
                        then goes to the first record,
                        then back to the record # as saved by the variable.

                        its messy, but like i said, its a work around, and it does in fact work.

                        maybe someone will find that useful

                        Comment


                          #13
                          Re: Embedded Browse on Form won't update correctly

                          Brett:
                          The preponderance of threads regarding browse refresh on this board is such that many, myself included, tend to just skip over these threads.

                          But since this is the second thread in less than 48 hrs regarding this issue, and maybe there are more that I did not read as I do not follow this board as I used to, so here is my 50 cents solution.

                          Like everyone else, I had my frustration with this issue until almost couple of years ago when I came up with a little trick that has worked for me ever since and never failed me, not once.

                          I referred to that in a different thread, but here it is again. It is so simple, it's one of those things that make you say: why didn't I think of that!

                          If you are adding (or deleting) records to your embedded browse, add to the end of your script couple more lines:

                          first line to activate the browse itself after the add or delete routine ends,
                          second line to activate a field in the topparent, any field.

                          That's all folks!

                          Give it a try and watch the magic! I have tried many other tricks, but none works as consistently as this one. None.

                          Comment


                            #14
                            Re: Embedded Browse on Form won't update correctly

                            This is an old thread, now resurrected. As far as I am aware the "embedded browse" problem is a known bug in A5. I think I recall reading somewhere that it will be fixed in version 8. Yippee! In the meantime I have found a work-around that seems to fix my A5 applications - just make the form containing the embedded browse modal.

                            Comment

                            Working...
                            X