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 Pointer

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

    Embedded Browse Pointer

    The issue I have has been discussed here many times but I am still in need of a solution.

    "There are times when in an embedded browse when visually a record is in focus (highlighted), but the actual pointer is on a different record and so when an action is taken, a non-highlighted record will be the one the action uses. " (Taken from another post - Set Child record corruption...).

    I have a button on a form with an embedded browse that runs a simple Find by Text on one field in the browse. This works as expected and the focus moves to the found row (record) in the browse. If I then push a button to perform an action on the highlighted record in focus (read a current field into a variable, test the variable, etc.), the action is performed on the first record in the browse, not the one that is highlighted. If I click around and select different records in the browse sometimes I can get the browse to "synch" back up, sometimes you have to close the form and open it again.

    Why would the underlying browse pointer get out of sych with the selected row on the screen and how can I get this to stay synched? Is it a "feature" that would be used to not have them in synch?

    #2
    Re: Embedded Browse Pointer

    To elaborate on my issue, please reference the attached screen shot.

    From this screen, the Production Scheduler picks the product he wishes to add to that days production (workorder) and clicks "Add to Workorder". If he uses the Find Structure feature to locate the record in the embedded browse he is interested in, he types in the search field (variable) and hit "Find Str#". This works fine and he finds the record he is looking for. Whenever the find is used, clicking "Add to Workorder" adds the first record in the browse to the workorder, not the record that was found (highlighted). Again, it appears the record with focus is not where the record pointer is. How do I keep this in sync?



    The underlying code for the Find Str# button is:
    :Pick_off_Production_Ord:browse1.fetch_first()
    :Pick_off_Production_Ord:browse1.locate_next(VAR->FINDUNIT3, "PRODUCTION_ORDER_DETAIL->UNIT_LABEL")

    Comment


      #3
      Re: Embedded Browse Pointer

      I don't know if it will make any difference but try

      :Pick_off_Production_Ord:browse1.activate()

      before your other code.

      When I checked the active object when run without that I get the name of button being pushed instead of the browse. Since the browse is not the active object, who knows what record in the browse is used?

      Code to report name of active object.
      ui_msg_box("",""+parentform.Active())
      There can be only one.

      Comment


        #4
        Re: Embedded Browse Pointer

        Thanks Stan.

        Adding :Pick_off_Production_Ord:browse1.activate() didn't help.

        Is there another method to find (not query) a record in an embedded browse?

        The code
        :Pick_off_Production_Ord:browse1.locate_next(VAR->FINDUNIT3, "PRODUCTION_ORDER_DETAIL->UNIT_LABEL")
        works well for the find but is obviously screwing up the record pointer.

        By this way, the Find worked perfectly in A5V4.5.

        Comment


          #5
          Re: Embedded Browse Pointer

          Donald, I couldn't open your screen shot.

          Here's an example that fetches through the linked child table records, stopping when the target record is found. Seems to stay in synch pretty well.

          http://screencast.com/t/BRVK58t5uXn

          And here's the code (runs from button on Vendor form in AlphaSports). "Object1" and "Object3" are embedded browses.
          Object3 displays linked child table records in a set that contains two tables. The link is one to many.


          Code:
          [FONT=Courier New]vendor_id = parentform:object1:vendor_id.text  'get id from from
          count = dbcount("product","vendor",vendor_id)
          trace.writeln(ltrim(str(count)))
          
          parentform:object3.activate()
          parentform:object3.fetch_first()
          found_it = .f.
          for i = 1 to count
          	if "ZZZZ" $ parentform:object3:description.text then
          	'if "Johnson" $ parentform:object3:description.text then		
          		found_it = .t.
          	    exit for
          	end if
          	parentform:object3.fetch_next()
          next i
          
          if found_it then
          	trace.writeln("Found it: " + Parentform:object3:description.text)	
          else
          	trace.writeln("not found")
          	parentform:object3.fetch_first()
          end if[/FONT]
          -- tom
          Last edited by Tom Cone Jr; 10-27-2011, 05:17 PM.

          Comment


            #6
            Re: Embedded Browse Pointer

            Tom,

            Wow, thanks for the screencast - I will try that method. I captured your script from my screen.

            Attached is another try at the screenshot I uploaded earlier.

            Pick Production Screen.JPG

            Thanks much,
            Don

            Comment


              #7
              Re: Embedded Browse Pointer

              Tom,

              I could not get the dbcount() function to work (I don't think there is a key value for the field in the Embedded Browse I was searching for). I did however get the following to work:

              'Date Created: 27-Oct-2011 05:33:36 PM
              'Last Updated: 28-Oct-2011 08:44:10 AM
              'Created By : Don
              'Updated By : Don

              tbl = table.current()
              count = 0
              child_tbl = table.get("production_order_detail")
              child_tbl.fetch_first()
              while .NOT. child_tbl.fetch_eof()
              count = count + 1
              child_tbl.fetch_next()
              end while
              parentform:browse1.activate()
              parentform:browse1.fetch_first()
              found_it = .f.
              for i = 1 to count
              if FindUnit3 $ parentform:browse1.unit_label.value then
              found_it = .t.
              exit for
              end if
              parentform:browse1.fetch_next()
              next i
              if found_it then
              else
              parentform:browse1.fetch_first()
              end if

              However, I still have the same problem - the found row in the browse is in focus (highlighted) but the record pointer is not in synch. After the search is performed, physically clicking the highlighted row selector or any other record in the browse still does not bring the pointer into synch.

              This is the same issue that has been reported in other posts. I even deleted the browse from the form (the app was built in A5V4.5) and recreated it and still have the same issue.

              Can you think of anything else I could try?

              Thanks,Don

              Comment


                #8
                Re: Embedded Browse Pointer

                I've sent you a private message.

                Don, you should get acquainted with [ Code ] tags. Will make your postings much easier to read.

                Use the "Go Advanced" button when editing a post or reply. Then select your xbasic code and click
                the pound symbol on the editor's toolbar ( # ). This will insert code tags around your script,
                and your indents and tab spaces will be preserved. Makes scripts much much easier to read.

                -- tom

                Comment


                  #9
                  Re: Embedded Browse Pointer

                  Donald
                  The problem is not the finding code.
                  The solution would be simple.
                  I used a screen that I use for production scheduling. I added to the top (Circled yellow highlight) the exact coding you use to find.
                  The highlighted record, as you see, is found as yours is. When I click "add the selected item", you can see that the correct item is marked. Not the first record on the screen

                  What is you "Add to .." code?
                  Attached Files

                  Comment


                    #10
                    Re: Embedded Browse Pointer

                    Tom- The zipped file is too large to email. Later today, I would like to send you a PM that would allow you to download the file if you would still care take a look at it.

                    Ray - The "add to" code adds the current record to the workorder_detail table, but the first step is to assign data from the current record in the browse to some variables. This "add to" code works fine as long as the search button is not used (either my original way or Tom's method). Once the search button is used, the embedded browse becomes out of synch with the pointer. I know that the pointer is out of synch because with a simple "test" button added to the screen that fills a variable with say, the serial number of the current record, the value it grabs is the value in the first record in the browse not the hightlighted one.

                    Comment


                      #11
                      Re: Embedded Browse Pointer

                      Don, if you haven't solved the problem, I'll be happy to take a look.

                      I share Ray's suspicion that the trouble lies elsewhere. We need to see the entire sequence in context.

                      Comment


                        #12
                        Re: Embedded Browse Pointer

                        Originally posted by DORaymond View Post
                        This "add to" code works fine as long as the search button is not used
                        so then it doesn't
                        Once the search button is used, the embedded browse becomes out of synch with the pointer.
                        yes true they are out of synch, but the problem is that you are using that record pointer, not the browse pointer. As I showed- if I do exactly the same selection that you did, my table record is the top one on the browse as yours is, and the browse pointer is the "Found" record. I then use the browse pointer (thats at the correct record) - not the table one - follow?

                        Comment


                          #13
                          Re: Embedded Browse Pointer

                          I am only trying to get the hang of this myself but I noticed that the search you use is a browse search
                          Code:
                          :Pick_off_Production_Ord:browse1.locate_next(
                          not a table one

                          Comment


                            #14
                            Re: Embedded Browse Pointer

                            Ray,

                            What you say makes sense. How then do I do my search moving the table pointer that is behind the embedded browse?

                            Comment


                              #15
                              Re: Embedded Browse Pointer

                              Originally posted by DORaymond View Post
                              Ray,

                              What you say makes sense. How then do I do my search moving the table pointer that is behind the embedded browse?
                              this returns the record number that the browse has its eye on
                              topparent:Browse1.Current_Record()

                              Comment

                              Working...
                              X