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

popup to verify dirty fields before submitting to server?

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

    popup to verify dirty fields before submitting to server?

    Hello. I'm currently redesigning an app I had made to connect to a SharePoint SQL database, but due to many considerations I am redoing it from scratch. All the tutorial videos are well done, demonstrates the capabilities of the software nicely. I have a specific need though that I have not seen addressed, although it seems like it should be a common one.

    I have the user enter in several fields, and I would like some sort of an alert or popup to show them one last time exactly what data they are about to submit. This is because of the nature of the application, I cannot allow the technicians to alter data once it has been submitted, since later billing will be done against that data. (Can't have guys going back after things have been verified and changing billing codes.) I see several ways to do AJAX callbacks, but cannot see how I would query and display the dirty fields themselves in a popup window before submitting.

    I am certainly no real developer, learning as I go. Any help from someone who can point me in the proper direction is greatly appreciated.

    #2
    Re: popup to verify dirty fields before submitting to server?

    Jared,

    I would do this on the client-side. You haven't indicated UX or Grid... so let's say UX.

    Create a Window Container and put unbound controls in there... or static text fields that you can set .innerHTML. Anything that will allow you to perform a .getValue to get the values from your entered fields and then set those values into the unbound verification fields. If you use controls, set them to read only.

    Move the Submit button into this window as well.

    Add a "Verify" button to your main UX section which, when clicked, will perform the .getValue and .setValue (or set innerHTML if static fields) and then pop up the Window container. When the window pops up, you'll see the values for all your fields
    and your Submit button.

    Finally, on the Submit button... add an A5.msgBox.show message to pop up and ask if they're sure they want to submit. Check the answer and if yes then submit and take down the window. If no, just take down the window.

    To find info on how to use the A5.msgBox.show function get into the Alpha documentation and do a full text search on it.

    A second way to do this would be to add code to your Submit button... get the values and shove them into a formatted A5.msgBox.show message because it takes full HTML for a message.

    The message solution would look something like this...

    Code:
    var dt1 = {dialog.Object}.getValue('date1');
    var dt2 = {dialog.Object}.getValue('date2');
    var msg = 'Are you sure you want to submit these values?<br><br>'+dt1+'<br>'+dt2+'<br>';
    A5.msgBox.show('Verify Data',msg,'oc',function(button){
    if(button == 'ok'){
    		{dialog.Object}.submit();
    	}
    });
    Last edited by Davidk; 02-09-2016, 12:22 PM.

    Comment


      #3
      Re: popup to verify dirty fields before submitting to server?

      On initial read, I can tell I am going to have to break down this response bit by bit. Thanks, it looks like this is the direction I needed. It is indeed a UX component. I would like to not have to use a 'verify' button, as I am dealing with cable television techs, it's hard to even get them to use email sometimes much less than adding another button they are supposed to click every time before submitting a form. I will look into how to use the A5.msgBox.show. There's some 60 or 70 possible fields that may be dirtied, typically only a few. So I need some sort of a window containing unbound controls, one unbound for every bound? Then probably some show/hide code based on if/else the getValue is null, so the popup window stays small and only contains info about dirty fields?

      I see you threw in some example code above after I replied. That does make sense, I would just need to figure out how to not have 67 blank fields show up when 3 are dirty, I'd like the end use to only see and verify what was actually changed in the form. I can get on what you have there as an awesome start, regardless. I really appreciate the help!
      Last edited by jrodder; 02-09-2016, 12:32 PM.

      Comment


        #4
        Re: popup to verify dirty fields before submitting to server?

        I figured you'd be heading in that direction... what's the point of a long list of controls you don't need to see.

        Selwyn provided some excellent code to use the dialog .harvestRow() method... which is the same method used when the dialog is submitted.

        Then I added an old and new value comparison. This is in case the user changes a field, then changes their mind and puts back the old value. You don't really need this, but I figured... why not.

        This code picks out the dirty fields... and then grabs the old and new values for those fields. The old and new values are compared and, if different, are included in the msg.
        The msg only includes dirty fields.

        I haven't tested this against all types of controls, so you'll have to report back if you run into any issues. Something else you could do if format the found dirty fields into a table and submit that in the message.
        Again, this is ok for a short list... but if you have a user changing 80 fields this is going to look silly. In that case I'd push the dirty info into a List control and present that to the user.

        Code:
        var data = {dialog.object}._harvestRow(1);
        data = data.split('&');
        var txt = 'dirtyColumns.R1='; //ALPHA%0D%0AGAMMA
        var indx = -1;
        for(var i = 0; i < data.length; i++) { 
        	if( data[i].indexOf('dirtyColumns.R1') == 0) { 
        		indx = i;
        	}
        }
        
        if(indx == -1) { 
        //	alert('no dirty controls');
        } else {
        	var dirty = data[indx];
        	dirty = dirty.split('=');
        	dirty = dirty[1];
        	if(dirty == '') { 
        		//alert('no dirty controls1');
        	} else { 
        		//string is urlencoded
        		debugger;
        		dirty = dirty.split('%0D%0A');
        		
        		//loop through the controls found to be dirty
        		var msg = '';
        		var currInfo;
        		var newInfo;
        		var currValue;
        		var newValue;
        
        		for(z=0;z<dirty.length;z++){
        			//get the control's original value
        			for(var i = 0; i < data.length; i++) { 
        				if(data[i].indexOf('old.V.R1.' + dirty[z]) == 0){
        					currInfo = data[i];
        					currValue = currInfo.split('=');
        					currValue = currValue[1];
        				}
        			}
        			//get the control's new value
        			for(var i = 0; i < data.length; i++) { 
        				if(data[i].indexOf('V.R1.' + dirty[z]) == 0){
        					newInfo = data[i];
        					newValue = newInfo.split('=');
        					newValue = newValue[1];
        				}
        			}
        
        			if(currValue != newValue){
        				msg = msg + dirty[z] + ": " + newValue + "<br>";
        			}
        		}
        		
        		if(msg != ''){
        			msg = 'Are you sure you want to submit these values?<br><br>' + msg + '<br>';
        			A5.msgBox.show('Verify Data',msg,'oc',function(button){
        				if(button == 'ok'){
        					{dialog.Object}.submit();
        				}
        			});
        		}else{
        			{dialog.Object}.submit();
        		}
        	}
        }

        Comment


          #5
          Re: popup to verify dirty fields before submitting to server?

          That, my man, is some sexy code for a submit button right there. I don't think I would have been able to cobble that together myself, I'm just not that experienced yet. I will certainly give that a try and report back when I have some results. I am somewhat surprised this kind of thing doesn't exist in the AA wizards anywhere. As I said before, it seems like something a lot of people would find useful.

          As far as the dirtying 80 fields, in this case that will never happen. It's almost always going to be around 6-10. Ideally I would exclude a few that don't matter that would be dirty every time (account numbers, tech name and number, etc) and only look at billing codes but now that's just getting picky. :) This was a big requirement for the app to be actually useful, as we are trying to make it as easy as possible for them in the field, and cut down on operator error.

          Comment


            #6
            Re: popup to verify dirty fields before submitting to server?

            Here's a bit of my take on Alpha... and software development environments... in general. In Alpha there is a whole wack of amazing stuff. A lot. What you've suggested is a great process... but... have to say... it's the first time I've come across it. If you can ask some good questions... like yours... and get access to some tools that will help build what you want... then that's a great environment. I've yet to run across a process or and idea that Alpha can't handle... and handle it gracefully.

            I agree... for cutting down on errors... this is a great idea. Thanks for the chance to work on it.

            Comment


              #7
              Re: popup to verify dirty fields before submitting to server?

              david's contribution is excellent.
              you could also do another way if you are open to it.
              you say you have ux(dialog by another name). and have some 80 controls. then you add one more control this time it is a text area control. make it 4in wide 5 in deep. and wrap it in a container.
              all the other controls will be in another container.
              then all the other control will have a button that is called NEXT.
              the submit rest button will be in the text area container and that will be hidden to start with. the next button will make it appear.
              now in each control you have a code to copy the summary value and delete it and get the value of the control and append to the summary value and paste it back to summary field. this will be in the onChange event of the control.
              so the text are comes to visible and the technician submits the button or reset the dialog.

              take a look at this:
              http://screencast.com/t/wANGvwrmN
              and example since my text may be confusing.
              you can make it skip if the value is null.
              again another way to skin the cat.
              Last edited by GGandhi; 02-09-2016, 09:41 PM.
              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


                #8
                Re: popup to verify dirty fields before submitting to server?

                Just wanted to report back, this code worked flawlessly into a window, exactly as I had imagined would be needed. I wish I could upload a beer to you through a forum. Later I'll comb through that code line by line and try to make sure I understand how it all does what it does. I can look at it and understand, but it helps me to learn by going through and trying to translate each line into English.

                Comment


                  #9
                  Re: popup to verify dirty fields before submitting to server?

                  GGhandi, I'm checking out your screencast. I see you made the effort to not only respond but make a 5 minute video, I always like to see alternatives!

                  Comment


                    #10
                    Re: popup to verify dirty fields before submitting to server?

                    Just wanted to report back, this code worked flawlessly into a window, exactly as I had imagined would be needed
                    when something works, don't fix it.
                    glad to see you solve it that is more important.
                    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

                    Working...
                    X