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

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

    I've found that Xbasic 'topparent:{browsename}.refresh()' and the ActionScript equivalent "Object->Refresh Object" seems to work consistently here... I'll use it elsewhere as necessary... thanks for everyone's input

    Comment


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

      I know this thread has been dead for a month already, but I think I may have found the problem. My buttons usually don't have a TAB stop set, including my Find key button. So what I did was redirect the cursor back to the field being searched (a variable in this case) and guess what? No jump to the next record! Not even in the browse.

      It seems we forget easily the things we learned at first... :D
      Robin

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

      Comment


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

        Bring up an old thread to see is anyone has anything new. I have a form with embedded browse. I have an on change event on a field in the form that runs an append operation to add records to the child table based on the value that was put in the field. After the operation has run I can not get the form browse to show the records every time

        I have tried all of the following together, in different order, one or a few by them self and never get all the records to show all the time.

        parentform.resynch()
        parentform:browse1.refresh()
        browse1.activate()
        browse1.resynch()


        After the operation has run I even tried to move another form in front of this form & that makes no change.

        Comment


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

          Here is what I ended up with, and it works for me. This is for the Event on my Save button.

          topparent.resynch()
          topparent:browse1.repaint()

          Hopr this will help.

          Gunter

          Comment


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

            Originally posted by turbojack View Post
            ...I have an on change event on a field in the form that runs an append operation to add records to the child table based on the value that was put in the field....

            I have tried all of the following together, in different order, one or a few by them self and never get all the records to show all the time.

            parentform.resynch()
            parentform:browse1.refresh()
            browse1.activate()
            browse1.resynch()
            It may not be intuitively obvious but the important thing is "Exactly how did you add the records?" This has a lot to do with the ability to properly resynch the form. Show us how you added the records.

            Comment


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

              Here is what I ended up with, and it works for me. This is for the Event on my Save button.

              topparent.resynch()
              topparent:browse1.repaint()
              Tried and no difference


              Originally posted by CALocklin View Post
              It may not be intuitively obvious but the important thing is "Exactly how did you add the records?" This has a lot to do with the ability to properly resynch the form. Show us how you added the records.

              Here is code. This code is in a funtion. That is called from on change of the pahse Id. I have not included the code that is calling the funtion. After the funtion is called is when I am trying to get the browse to refresh. This code is cut & paste with small change from operation gene.

              Code:
              phaseid = alltrim(phaseid) ' trims extra charaters from phase since character field
              
              DIM Append as P
              
              a_tbl = table.open("sr_detail")
              append.t_db = "Phase_detail"
              ON ERROR GOTO ERROR11012007064841937
              
              append.m_key = ""
              append.t_key = "recno()"
              append.m_filter = "sr_id = " + S_quote(srid)
              append.t_filter = "Phase_Id = "+ s_quote(phaseid) +"  .AND. Auto_Sr = .T."
              append.type = "All"
              append.m_count = 4
              append.m_field1 = "Sr_id"
              append.m_exp1 = convert_type(srid,"C")
              append.m_field2 = "Srdetail_Phase"
              append.m_exp2 = "@Phase_Detail->subphase_Id"
              append.m_field3 = "Srdetail_Descrip"
              append.m_exp3 = "@Phase_Detail->Subphase_Desc"
              append.m_field4 = "Line_Billable"
              append.m_exp4 = "@Phase_Detail->Billable"
              append.t_count = 0
              
              a_tbl.append()
              
              GOTO CONTINUE11012007064841937
              ERROR11012007064841937:
              ON ERROR GOTO 0
              ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
              END
              CONTINUE11012007064841937:
              a_tbl.close()
              'If the Operation is run from within a Form or Browse, then refresh the window
              if is_object(topparent.this) then
              	if topparent.Class() = "form" .or. topparent.class() = "browse" then
              		topparent.Refresh_layout()
              	end if
              end if

              Comment


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

                Try changing the table.open() to table.get(). When you do this, you also have to remove (or at least rem out for the test) the table.close() command because the table.get() command is using the current table and you can't close the current table because the form is still open.

                ONE PROBLEM WITH THIS METHOD: If the master table - the one that you are appending to - has no records, the script as presented will fail because the form will already be in ENTER mode. I'm not sure what you would do to handle this. It might be necessary to add a dummy record then delete it after the append.

                Also, there is a problem with the way you have the error routine set up. No matter what happens, the error messsage will always say that the error was in the append routine. Even if an error occurs because the form isn't open (not likely during use but I did it during testing), the error message still says "Error running append operation". The error trapping should only be around the a_tbl.append command. Let the system handle the rest.

                Another little known fact about error trapping: When an ON ERROR command is encountered and the script jumps to an error trapping section, the ON ERROR is automatically changed to ON ERROR goto 0. If this didn't happen and another error occurred in the error trapping routine it would get into an endless loop of erroring itself out. The original ON ERROR command is restored when a RESUME command is issued. This means that your ON ERROR goto 0 is totally unnecessary. (This is a very common, but harmless, "mistake".)

                Final comment on errors: My training was to always put error routines at the end of the script. This avoids the need to use GOTO commands to skip over them and makes the 'normal' routine easier to follow because it isn't interrupted with the error routines. This was also part of the reason my instructor said to always include an END statement on scripts even if you don't need it initially. That way, if you add an error routine later you won't have to worry about accidentally running the error routine when the normal script ends. Besides, having an END statement confirms that this really is an END point and not just an incomplete script or one with the end accidentally deleted. Obviously this is a matter of personal preference but I thought I'd point out the reasons as they were explained to me.

                Here's the script I used in my test. (It was also modified by my free script formatter - which, now that I think about it, may require some modification of the install routine for A5v8 which I will get done in the next day or two. The script formatter modifies - according to user settings - spacing, capitalization, indentation, adds single quotes after END statements so you can distinguish between END and END IF, etc., and it adds '--------------- before and after label commands to make them easier to find.)
                Code:
                'phaseid = alltrim( phaseid )   'trims extra charaters from phase since character field
                DIM Append as P
                a_tbl = table.get( "test" )
                append.t_db = a5.Get_Path() + "\std_airports.dbf"
                append.m_key = ""
                append.t_key = ""
                append.m_filter = ""
                append.t_filter = "left(airprt_idf,1)='k'"
                append.type = "All"
                append.m_count = 4
                append.m_field1 = "Airprt_Idf"
                append.m_exp1 = "@std_airports->Airprt_Idf"
                append.m_field2 = "Ap_Namef"
                append.m_exp2 = "@std_airports->Ap_Namef"
                append.m_field3 = "Latitudef"
                append.m_exp3 = "@std_airports->Latitudef"
                append.m_field4 = "Longitudef"
                append.m_exp4 = "@std_airports->Longitudef"
                append.t_count = 0
                ON ERROR goto ERROR11012007064841937
                a_tbl.append()
                ON ERROR goto 0
                'a_tbl.close()
                'If the Operation is run from within a Form or Browse, then refresh the window
                IF is_object( topparent.this ) THEN
                   IF topparent.Class() = "form" .or. topparent.class() = "browse" THEN
                      topparent.Refresh_layout()
                   END IF
                END IF
                END'
                '---------------
                ERROR11012007064841937:
                '---------------
                ui_msg_box( "Error", "Error running Append Operation" + crlf() + error_text_get() )
                END'

                Comment


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

                  Thank Cal for taking the time to look at this and all the time it took to write your post.

                  Now I have to go & digest all that you have written

                  Comment

                  Working...
                  X