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

Physical and Logical Records Don't match after a client side filter in a list control

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

    Physical and Logical Records Don't match after a client side filter in a list control

    I have 3 buttons which filter my list control on the client side to bring up records which have been read, unread, or both of them together (entire route is what I've called it). In order to do such a specific client filter I used this article:

    https://documentation.alphasoftware....r%20Method.xml

    My code is very straight forward, if it is unread the readTime field will be empty (or ''). This works great for filtering my list and has no problem with it. However when I press on a record in the filtered list, it does not bring me to the matching logical record number.

    1.png
    For example: If I read the first record in my list it (see picture one)

    2.png
    I then filtered the list for only the unread records (see picture two), it would only display the unread records. (see picture two)

    3.png
    However, if I click on first record in the physical list (JONES, FRED), it would take me to the second record in the physical list because it always navigates past the record I selected according to the number of records that were filtered out. (see picture three) You can see in the picture how the that was selected is gray, I went back to the list control after it navigated me to my record, and now it showed which record had been displayed.
    So if I had 2 read records it would take me 2 records past the physical record I selected. The actual (or I'm calling it logical) record number is always too far forward. I can't seem to figure out why it is doing this or if there is some way I can turn this off. I highly suspect that it has something to do with it being a client side filter, but I'm not totally sure.

    Here is my code for the filtering of unread records:

    Code:
    var readings_pntr = {dialog.object}.getControl('READINGS');
    readings_pntr.setFilter(false);//this just clears the previous filter
    readings_pntr.setFilter({      
    		
    readTime: function(readTime_){
    		if(readTime_ == '') return true;
    		return false;
    		}
    	
    	});

    #2
    Re: Physical and Logical Records Don't match after a client side filter in a list control

    Version / Build of Alpha ?

    Comment


      #3
      Re: Physical and Logical Records Don't match after a client side filter in a list control

      Originally posted by Davidk View Post
      Version / Build of Alpha ?
      Version: 12.4.5.4.5, Build: 5221

      Comment


        #4
        Re: Physical and Logical Records Don't match after a client side filter in a list control

        I think there's a bit of information missing here. You're working with a Detail View. How and when are you updating readTime?

        In a simple test I created my filters on readTime for read, unread, and both work without issue. I filter, select a row, and I'm taken to the Detail View of the row I selected.

        If I'm looking at unread row, select a row, view it's Detail and change the unread value to read, save, and sync... then moving back to my List I find that my List has automatically filtered out that read row.

        Comment


          #5
          Re: Physical and Logical Records Don't match after a client side filter in a list control

          Yes, I am working with a detail view. I update readTime whenever I submit a record by updating a "hidden" control that is hooked up to the detail view in my list control. It always either contains a value or doesn't, and so the filter just checks to see it it's there or not. The code is an action javascript within my action javascript which executes the save to the list control and the sync to the server. If you need it here is the code for 'readTime'
          Code:
           function formatAMPM(date) {
            var hours = date.getHours();
            var minutes = date.getMinutes();
            var ampm = hours >= 12 ? 'pm' : 'am';
            hours = hours % 12;
            hours = hours ? hours : 12; // the hour '0' should be '12'
            minutes = minutes < 10 ? '0'+minutes : minutes;
            var strTime = hours + ':' + minutes + ' ' + ampm;
            return strTime;
          }
          
          var d = new Date();
          var timestring = formatAMPM(d);
          var datestring = (d.getFullYear()) + "/" + ("0"+(d.getMonth()+1)).slice(-2) + "/" + ("0" + d.getDate()).slice(-2)
          
          {dialog.object}.setValue('READDATE',datestring);
          {dialog.object}.setValue('readTime',timestring);
          In your test did you do a server side filter or client side filter?
          I am building a disconnected app so I need to do a client side filter which is why I chose to follow the documentation I put in my first post. Also this is what it looks like when I click on my detail view panel. After it has been filtered, the list never brings me to the record I want if there has been a record which has been read previous to it.

          Detail View.png

          Comment


            #6
            Re: Physical and Logical Records Don't match after a client side filter in a list control

            Now we have a bit more info. A disconnected App. PhoneGap Build? Web App? Lots of nice List features turned on for disconnected operation?

            Yes, my filter test is client-side... which is what you mentioned in your first post.

            At this point you'd need to post a sample UX and table showing the issue. There are too many variables to guess at what may be going on. I have a suspicion that it's the latest revelation of "disconnected" that may be involved.

            Comment


              #7
              Re: Physical and Logical Records Don't match after a client side filter in a list control

              Ok, sorry for such a late response. I've been out of the office the past several days. So I built the the test ux from scratch setting it to be exactly like my other app, in it's simplest form. I turned on persist to local file system, in both the properties tab, and the list properties control. I did add an OnItemDraw even that will turn the read records green for convenience. The code for the submit button is written like this:

              Submit Data to Table
              vvv
              Synch Data to List

              It's also worth noting that in the "Submit" button, I submit the readTime by executing an action Javascript called Set_readTime

              The client side filters are built into the "Unread," "Read," and "Entire Route" buttons. The code for the "Unread" button looks like this:

              Clear previous filter
              vvv
              Run client side filter
              vvv
              Sort the list to display from top to bottom

              The code should be fairly self explanatory once you look at it, but that is the logic behind it.

              Once you get the UX component up, try filtering the list by pressing the unread button, and then select any record in the list, and the record which is brought up will be different from the record you selected in the list control!


              The attachments below include:
              The UX component named ClientSideFilter
              A Flat file that I've exported from my database. I've tested exporting and importing it, and it comes in just fine.
              A picture showing the delimiter settings I used, in case you need it.
              Attached Files

              Comment


                #8
                Re: Physical and Logical Records Don't match after a client side filter in a list control

                You're using SQL Server... what version?

                Comment


                  #9
                  Re: Physical and Logical Records Don't match after a client side filter in a list control

                  I'm running 2014

                  Comment


                    #10
                    Re: Physical and Logical Records Don't match after a client side filter in a list control

                    Probably doesn't matter that much, but a sql table dump would be better. An import of that data results in a nvarchar fields set at length of 255

                    Comment


                      #11
                      Re: Physical and Logical Records Don't match after a client side filter in a list control

                      Attached is your UX. The great thing about Alpha is that they let you do what you want. This is very big. Most development environments stop you from doing things even when it makes sense that you should be able to do it. By the same token, Alpha lets you wrap yourself around the axle while you're busy shooting yourself in the foot.

                      You must be very, extremely, knowledgeable about every single property you turn on or off... or else you lose toes.

                      Your biggest problem with the UX is the List Property setting "Allow NULL selection". With this turned off, your first record was always being selected. But, because you had a background colour being set, you could never tell. That's problem #1. Then you filtered the List. 1st row still selected... and somehow edited... not sure how.

                      By default, the Detail View property "Auto-commit detail view on row select" is turned on. If you turn this off and run your UX... when you try to edit row # 2 you'll get a message that your edits to the selected row must first be saved. When I saw that, I knew that something screwy was going on between a selected row and client-side filtering. I'd say this is an Alpha bug. I think Alpha is not resetting the selected row after a filter. That's problem #2.

                      Then, you had some data binding going on... outside of the List Control... with onDialogInitialize and afterDialogValidate both executing Server-side Actions. Now you're completely wrapped around the axle and your UX is a mess. I found this because your UX took about 10 seconds to save. The data binding was all messed up... but not a peep from Alpha. Problem #3.

                      So, if you want to fix your UX instead of using the attached, get into Data Binding and "Remove all Data Binding Settings". Doing this does not affect your List.

                      Then remove the Server side actions in those 2 server-side events.

                      Then turn on Allow NULL selection in your List Control.

                      Don't use an Action Javascript for the Javascript formatAMPM function. That gets very messy. Just put that function into Javascript functions. So much easier to get at.

                      Finally, in your UX Properties, Namespace property, you had MREplus+. I cringe at seeing special characters being used like this. Take out the "+" sign... it's just way too dangerous to use... and doesn't do anything for your UX.
                      Attached Files
                      Last edited by Davidk; 09-28-2018, 08:40 PM.

                      Comment


                        #12
                        Re: Physical and Logical Records Don't match after a client side filter in a list control

                        Thanks for the help David! That's really great advice and critique.

                        You said that the data binding is all messed up, what do you mean by that? I just copied it from a tutorial I watched and have memorized the process of
                        1) going to the onDialogInitialize server-side event and adding the "Load Primary Key for Parent Table of Dialog" action script, and then
                        2) going to the afterDialogValidate server-side event and adding the "Save Submitted Data to Tables" action script.

                        I've recently been looking into creating an unbound list control. Is that what you are referring to?

                        Also what should I do right now to fix problem #2?

                        Also in my main work space (which was similar to the test UX I sent you, just a much larger file) I have most of my blocks of code saved to Action Java scripts, not Javascript functions. Would you suggest that I move these all over to Javascript functions?

                        Thanks for helping me with my app
                        -Hank

                        Comment


                          #13
                          Re: Physical and Logical Records Don't match after a client side filter in a list control

                          Okay! So I am beginning to see what you meant by the problems with my data binding. I haven't really spent a lot of time learning what data-binding is. But now that I have done more research and played around with it, I can now see that I was binding my detail view controls both directly to the database, and to the list control. Because I am building a disconnected app, I now only have the detail controls hooked up to the list, and then I just sync the list to the server when I need to. Now the client side filter works with no problems!! Thank you so much for spending time helping me figure this out Davidk!

                          Comment


                            #14
                            Re: Physical and Logical Records Don't match after a client side filter in a list control

                            That's right... List Controls are data bound by themselves. In this case there is no need of UX data binding.

                            I prefer Javascript functions. It's extra processing steps to use Action Javascript. The Action must be interpreted, opened, and the code executed. And... it's a lot of steps getting to the code for review or alteration. If you're just running javascript in an Action it's much simpler to put that code into functions.

                            Comment


                              #15
                              Re: Physical and Logical Records Don't match after a client side filter in a list control

                              Okay, that's good to know. Thanks for the help!

                              Comment

                              Working...
                              X