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

Do Grid Base Filter Arguments (SQL) Refresh?

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

    Do Grid Base Filter Arguments (SQL) Refresh?

    I have a grid based on the following query:

    Code:
    SELECT * FROM LOADHEADERS WHERE ENTRYDATE >= :beginDate AND ENTRYDATE <= :endDate
    :beginDate and :endDate get their values from two session variables (session.begindate and session.enddate). This all works fine except when I try to change either or both of the session variables and then refresh the grid: Apparently, the values of the arguments are not refreshed. The query uses the values of the session variables when the grid was initialized. If I close the grid, then reopen, the new session variable values are picked up.

    I want to use these arguments (as opposed to setting a filter clientside) because of the number of records involved. I don't want to download everything to the client and THEN apply a base or user filter.

    Is this the way Alpha usually operates and, if so, then is there an efficient way to get the query to refresh its arguments? One thing I COULD do, I suppose, would be, in OnSQLSelectQuery, to build my own SELECT query using the new values of the session variables as arguments. Seems kind of inefficient, but I suppose as a last resort I could try it.

    Any ideas would be appreciated.

    #2
    Re: Do Grid Base Filter Arguments (SQL) Refresh?

    I use this embed a lot: OnSearchPartFilterCompute

    Comment


      #3
      Re: Do Grid Base Filter Arguments (SQL) Refresh?

      Originally posted by lvasic View Post
      I use this embed a lot: OnSearchPartFilterCompute
      Yea, thanks, but that seems to be fired when the user clicks the "Search" button in the grid and I'm not sure altering anything in that event will affect the "base" SELECT statement I defined at design time.

      To be more specific, I've added an Action Button to the grid that calls a Dialog into which the user can enter a new date range (start and end dates). When the form is submitted I simply set the session variables session.beginDate and session.endDate to those new values and refresh the grid. I've verified the values of the session variables have been changed successfully but these values are never read into the base SELECT statement's arguments (that is, until I close and then re-open the grid).

      Again, thanks for the info.

      Comment


        #4
        Re: Do Grid Base Filter Arguments (SQL) Refresh?

        Have you tried using the dynamic filter? Plus, the OnSearchPartFilter compute will run when the grid is first opened.

        Comment


          #5
          Re: Do Grid Base Filter Arguments (SQL) Refresh?

          Dynamic filter? Hmmm, I'm going to have to search for info on that. Thanks.

          What I'm doing now is going into the OnSQLSelectQuery and setting the query's arguments (e.arguments.set()) to the session variables, this way I am certain of always having the arguments current. I don't know what kind of performance hit this is, I may have to institute a "flag" to only do this when those session variables change.

          Comment


            #6
            Re: Do Grid Base Filter Arguments (SQL) Refresh?

            Apparently, the values of the arguments are not refreshed. The query uses the values of the session variables when the grid was initialized. If I close the grid, then reopen, the new session variable values are picked up.
            when you build your grid the data is collected from the server and the server is gone. you will be working with the data in your hand, if you want a new set of data, say for different dates then you will have to reissue the query and get the data. that's why it does not work with the first session variables.
            I want to use these arguments (as opposed to setting a filter clientside) because of the number of records involved. I don't want to download everything to the client and THEN apply a base or user filter.
            is this because you have a lot of data, and you expect the load time will be prolonged?
            if you build your grid with a search part and put the dates as a range and hide the grid when search is not active you will have the entire dataset available, but it loads quicker.
            will that not work in your case?
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: Do Grid Base Filter Arguments (SQL) Refresh?

              Originally posted by GGandhi View Post
              when you build your grid the data is collected from the server and the server is gone. you will be working with the data in your hand, if you want a new set of data, say for different dates then you will have to reissue the query and get the data. that's why it does not work with the first session variables.
              Well, that's what I'm looking for, information. So you're saying that the query specified in the grid is executed ONCE, when the grid is first run, and that's it? But then what I don't understand is: If I enter new information through the grid and do a refresh (either straight or for a particular row), how then does that information get back to the grid? And what exactly do you mean by "reissue the query"? How do I do that without closing and then reopening the grid? Frankly, I've done some experimenting and this is NOT consistent with what I'm observing; e.g. I can refresh the grid and in the OnSelectQuery event change the value of the arguments in the SELECT query and I will get records that were not in the original resultset. So, somehow, that query IS being rerun, it's just not picking up the new values of the session variables. I'm not saying you're wrong, you are much more experienced than I am and this may just be a misunderstanding on my part, but it's difficult for me to believe that the design-time query is not being rerun at some point.

              is this because you have a lot of data, and you expect the load time will be prolonged?
              Yes, precisely
              if you build your grid with a search part and put the dates as a range and hide the grid when search is not active you will have the entire dataset available, but it loads quicker.
              will that not work in your case?
              I need to do a lot more research. I have a search part but I'm not sure why then the data would load quicker? Isn't the filter in the search part applied on the client side? I don't want to pull the entire database down from the server and then do filtering on the client side.

              Again, my question is, to put it in your terms, how do you exactly "reissue the query" and, if you can, why aren't the session variables in my filter reevaluated? Consistent with what you've said, I've tried resetting the arguments in the OnSQLSelectQuery, and this actually works, but Alpha then, somewhere, resets the arguments to their original value so I keep needing to do this. Also, I get some weird behavior when the resultset is empty so I needed to abandon this method.

              Thanks for taking the time to post and try to help me out.

              Comment


                #8
                Re: Do Grid Base Filter Arguments (SQL) Refresh?

                Well, that's what I'm looking for, information. So you're saying that the query specified in the grid is executed ONCE, when the grid is first run, and that's it? But then what I don't understand is: If I enter new information through the grid and do a refresh (either straight or for a particular row), how then does that information get back to the grid?
                if you filter out your database table to yield from jauary1 to june 30 and show the grid all the information up to that point will be available via that grid ( something similar to additive filtering)not earlier than jan 1st or later than june 30th. if you want those dates I am sure you will have reissue the query to get the dates by some means like selectQury you mentioned. since you need a different source for the grid.
                http://screencast.com/t/4VMuaKj9
                see the image, I do not know the reason but this is how I knew.
                would you try this method and see if it fits the bill
                and when you have the entire table available at your disposal, you can keep on changing the value as many times you want and there won't be a problem
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #9
                  Re: Do Grid Base Filter Arguments (SQL) Refresh?

                  Gandhi:

                  That's an interesting option. Right now the set is not too large but I know it will grow and become unwieldy. Let me experiment with your suggestion and see if it helps me get to an acceptable solution.

                  Thanks much for bringing this to my attention.

                  Comment


                    #10
                    Re: Do Grid Base Filter Arguments (SQL) Refresh?

                    good, let me also suggest something to you.
                    in the grid part ( not on the search part) go to properties and scroll down all the way and check this property
                    http://screencast.com/t/v2We3hdM0
                    and run your grid and see the select statement that come up, it is only bringing few records from the table not the whole lot. so in the event your data becomes unwieldy still alpha is going to bring small segment your load time will probably not vary.
                    at least I think.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                      #11
                      Re: Do Grid Base Filter Arguments (SQL) Refresh?

                      Yes, you're right, I am not understanding something here. Submitting a search from the Search part is definitely NOT just client-side, it goes back to the server. Further, even if I set the design-time filter to not return ANY records, I can subsequently execute a Search and go back to the server and get whichever set of records I want. So the design-time filter seems ONLY to affect the initial load; thus, there's no need to make it "dynamic"; i.e. change the arguments in the design-time WHERE condition programmatically. Just use the Search part. At least I think. :)

                      Thanks again.

                      Comment

                      Working...
                      X