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

Return to current row after sorting an embedded browser

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

  • Return to current row after sorting an embedded browser

    How do I use action script to:
    1) remember the current record in an embedded browse on a form
    2) do an A -Z sort on the embedded browse
    3) return focus to the previous 'current record' after the sort routine has run.

    Using action scripts, I have been able to:
    1) set the current record as a variable (I think this works), sort the embedded browser. The sort works but the focus gets set to the first record in the embedded browse.

    How do I get A5 to remember the current row number and return to that value after the sort has run?

  • #2
    Re: Retrun to current row after sorting an embedded browser

    There is no such thing as an embedded browser, there is an embedded browse.

    You want to get the row number of the selected record, set the order to something other than row number, then find by row number. That doesn't make any sense in my admitted limited comprehension. It would seem you want to get the unique value of the current record which can be found in the new sort order. Then sort A-Z by that field, then find the record with the unique value obtained previously.
    There can be only one.

    Comment


    • #3
      Re: Retrun to current row after sorting an embedded browser

      Marcus there's an action script action strangely called
      "go to record number"
      (You're getting flack tonight)
      well night here anyway
      Last edited by Ray in Capetown; 11-27-2011, 06:21 PM.

      Comment


      • #4
        Re: Retrun to current row after sorting an embedded browser

        I've tried the goto record number tool. When the routine runs I get an error saying
        'topparent.recno_goto(var_recno_target)
        Record number is past end of table'.

        I have one parent record and 12 child records. The inital variable is to 10, so it is trying

        I think the goto record tool is acting on the parent level of the form data. I need it to operate on the browse data, which shows data from a child table from the data set.
        Is there a way to adjust the code so the 'goto record number' operates only on a browse showing child table data? I think that will do it.

        Comment


        • #5
          Re: Return to current row after sorting an embedded browser

          That is correct. I can see ActionScript cant perform the operation that you want, is fairly complex

          The browse works on rows and when you change column order the row order is altered.

          You want to obtain a RECORD number from the underlying child table and after re-organizing the table order, find the row that links to that record number and set focus to it.

          It is possible but more advisable to use query and/or find methods at browse level to suit the specific purpose.
          Otherwise you would need xbasic synchronization between table and form levels.
          Last edited by Ray in Capetown; 11-28-2011, 05:13 PM.

          Comment


          • #6
            Re: Return to current row after sorting an embedded browser

            You've probably already figured this out.. but this is what I do to go to a specific record on a browse for a child table:

            while Browse_name:Some_id.value<>varSomeID 'basically GET the id of the child record before you perform the sort or whatever operation you do
            topparent:Browse_name.fetch_next() 'then navigate through the browse until the matching id comes up
            if Browse_name.mode_get()=2
            ' ui_freeze(.f.) 'optional command if you don't want to "see" the navigation through the records in the browse
            end
            end if
            end while

            Hope that helps.


            Don

            Comment


            • #7
              Re: Return to current row after sorting an embedded browser

              while Browse_name:Some_id.value<>varSomeID 'basically GET the id of the child record before you perform the sort or whatever operation you do
              topparent:Browse_name.fetch_next() 'then navigate through the browse until the matching id comes up
              if Browse_name.mode_get()=2
              ' ui_freeze(.f.) 'optional command if you don't want to "see" the navigation through the records in the browse
              end
              end if
              end while
              I have been somewhat succesful employing the above method, however when using this on a filtered browse and the item that is changed no longer meets the browse filter, then it is gone and searching through the records causes a crash, which I suppose is running into the end of the file. How can you simply employ an EOF check using the simple code above?

              Comment


              • #8
                Re: Return to current row after sorting an embedded browser

                What's the application John?
                Concierge?
                Ted Giles
                Example Consulting - UK
                .

                sigpichttp://ec12.example-software.com//
                See our site for Alpha Support, Conversion and Upgrade.

                Comment


                • #9
                  Re: Return to current row after sorting an embedded browser

                  Yes, same app I have started working on after a year. I have a filtered embedded browse and a couple of fields on a form from that browse. When I change a value in the browse from a field that it is sorted on, the sort changes which usually sends the record to the bottom of the browse, and Alpha shows this as the top line of the browse and there are no other records. This looks funny so what I wanted to do is let it sort, fetch the first record and change the pointer in the browse to mactch that changed record, looks much cleaner.

                  It worked fine, until...
                  The table is filtered and I changed the value beyond the scope of the filter so the record was gone, it seems the while loop error'd out and crashed everything. I have seen eof() used before, but involved getting the table (this data and filter is based on a set which is problematic) and I was wondering if there was an easier way. I thought about just checking if the changed value was one of the choices out of the filter and not running the script, but it has been giving me problems and I thought there might be an easier way.

                  Comment


                  • #10
                    Re: Return to current row after sorting an embedded browser

                    Originally posted by johngtatp View Post
                    I have been somewhat succesful employing the above method, however when using this on a filtered browse and the item that is changed no longer meets the browse filter, then it is gone and searching through the records causes a crash, which I suppose is running into the end of the file. How can you simply employ an EOF check using the simple code above?
                    use before while statement...
                    topparent:Browse_Name.fetch_first()

                    Comment


                    • #11
                      Re: Return to current row after sorting an embedded browser

                      use before while statement...
                      topparent:Browse_Name.fetch_first()
                      I do this already. What is happening is the record disappears from the filtered browse so it is no longer visible. As the script goes through the while function it goes to the first record then steps through each record in the browse but then gets to the end of the file as there are no more records because the one it was on has been filtered away. This causes a crash. I currently "fixed" this by not allowing a change that would allow the record to get through the filter.

                      Comment


                      • #12
                        Re: Return to current row after sorting an embedded browser

                        Originally posted by johngtatp View Post
                        I do this already. What is happening is the record disappears from the filtered browse so it is no longer visible. As the script goes through the while function it goes to the first record then steps through each record in the browse but then gets to the end of the file as there are no more records because the one it was on has been filtered away. This causes a crash. I currently "fixed" this by not allowing a change that would allow the record to get through the filter.
                        I'm not sure what your doing between the while statement, but have you tried:

                        while Browse_name:Some_id.value<>varSomeID .and. Browse_name:Some_id.value>null_value()

                        if that doesn't work you'll at least have to provide the code between the while statement for me to help further.


                        Don

                        Comment


                        • #13
                          Re: Return to current row after sorting an embedded browser

                          Marcus,

                          After Sorted or changed something, then the current browse's focus are changed. See this. may help on your problem.

                          http://msgboard.alphasoftware.com/al...le-fetch_first

                          Comment

                          Working...
                          X