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

Signature control - how can we determine it's a blank graphic

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

  • Signature control - how can we determine it's a blank graphic

    We tried using the .signatureIsEmpty() javascript function in the ExecuteServerSideAction action script

    we added an alert("Empty"); but it's not seeing it as empty.

    Does anyone know how to identify that the 'signature' capture image is empty, so we can set a flag, or run some logic so we know the user didn't do anything?

    We understand that a single dot in the image would not be considered empty, but we want to at least capture the empty condition
    Last edited by workaholic06; 06-17-2022, 02:19 PM.
    Earl Allin
    REAInc.net

    We can help you with mentoring and custom programming services in Alpha, .NET, React, PHP, ColdFusion, and more..

  • #2
    Maybe another approach: store in a variable an empty graphic you created yourself. Than compare the submitted value of the graphic with that?
    Ger Kurvers
    Alpha Anywhere / V4.6.1.9- Build 6488
    Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

    Comment


    • #3
      I actually thought of that.. but since they already have the signatureIsEmpty() function... i thought i'd try that first..

      Thanks for your reply! it is definitely going to be the approach I take if we can't figure out the function.
      Earl Allin
      REAInc.net

      We can help you with mentoring and custom programming services in Alpha, .NET, React, PHP, ColdFusion, and more..

      Comment


      • #4
        This seems to be another example of how sharing the actual code of what you're doing can aid
        in finding the proper solution.
        Are you testing using the same method shown in the documentation ? https://documentation.alphasoftware....empty%20method
        Gregg
        https://paiza.io is a great site to test and share sql code

        Comment


        • #5
          The person who started this post is helping me with this. I am on build 6655-5457. I have just tried both of the following and the value that gets put into label1 is false whether there is a signature showing in the capture box or not. I clear the box, then commit, then submit, and get false result, when I would expect a true result. The code is in the After Save Succeeded Javascript client side event in the action scripting Save Submitted Data To Tables called by server side event afterDialogValidate, and the Signature Capture control is named VENDOR_SIGNATURE.

          var flagEmpty = {dialog.object}.signatureIsEmpty('VENDOR_SIGNATURE',0);
          {dialog.object}.setValue('label1',flagEmpty);

          var flagEmpty = {dialog.object}.signatureIsEmpty('VENDOR_SIGNATURE');
          {dialog.object}.setValue('label1',flagEmpty);
          Carol King
          Developer of Custom Homebuilders' Solutions (CHS)
          http://www.CHSBuilderSoftware.com

          Comment


          • #6
            I just saw this post in this thread by DavidK, so I am going to go play with this concept:
            https://forum.alphasoftware.com/foru...gnatureisempty

            "You'd put this Javascript code anywhere you want to test your Signature Capture control.

            Code:
            var sigEmpty = {dialog.Object}.signatureIsEmpty('SIG2',600);
            Where 'SIG2' is the variable name of your control and sigEmpty will be either true or false.
            Make sure your variable name is upper case. In this case I'm testing to see if SIG2 < 600 and if so, then it's empty... and so sigEmpty will be true

            The 2nd param would be dependant on where you're running the component. E.g. In Chrome is seems like an empty Signature has a length of 2518. Whereas in Firefox an empty Signature is 542. The browser in an iOS device reports 2010. Mileage may vary.

            So... you need to be aware of where you're running."
            Carol King
            Developer of Custom Homebuilders' Solutions (CHS)
            http://www.CHSBuilderSoftware.com

            Comment


            • #7
              So, the above did not work. I tried the following in Firefox, while the signature capture box was empty, and still got false put into my label1 control.

              var flagEmpty = {dialog.object}.signatureIsEmpty('VENDOR_SIGNATURE',600);
              {dialog.object}.setValue('label1',flagEmpty);
              Carol King
              Developer of Custom Homebuilders' Solutions (CHS)
              http://www.CHSBuilderSoftware.com

              Comment


              • #8
                Just to make it clearer, I put a button on my signature capture ux, and onClick of the button has inline javascript as follows, and always returns that the signature is not empty, no matter if it is or not.
                Code:
                var flagEmpty = {dialog.object}.signatureIsEmpty('VENDOR_SIGNATURE',600);
                if (flagEmpty) {
                alert("Signature is empty.");
                } else {
                alert("Signature is not empty.");
                }
                Carol King
                Developer of Custom Homebuilders' Solutions (CHS)
                http://www.CHSBuilderSoftware.com

                Comment


                • #9
                  I just went into the database and manually emptied the VENDOR_SIGNATURE OLE field and then used sql to get the value in that field in xbasic and then tested the result with:
                  Code:
                  if rs.DataIsNull(1) = .t.,
                  and It DOES give me a true result.
                  Carol King
                  Developer of Custom Homebuilders' Solutions (CHS)
                  http://www.CHSBuilderSoftware.com

                  Comment


                  • #10
                    Originally posted by kingcarol View Post
                    Just to make it clearer, I put a button on my signature capture ux, and onClick of the button has inline javascript as follows, and always returns that the signature is not empty, no matter if it is or not.
                    Code:
                    var flagEmpty = {dialog.object}.signatureIsEmpty('VENDOR_SIGNATURE',600);
                    if (flagEmpty) {
                    alert("Signature is empty.");
                    } else {
                    alert("Signature is not empty.");
                    }
                    I didn't know this but there is a sister function called {dialog.Object}.inkIsEmpty(UXControlName);

                    I don't use the signature capture control, rather I use the ink control for my signatures, so I put the same code you have on your signature ux into a test button on my ux and it works.
                    So, it might be worth sending a report to Alpha about the signatureIsEmpty function. Not sure why the inkIsEmpty function works but not the signatureIsEmpty one?

                    javascript.jpg

                    result.jpg
                    Alpha Anywhere v12.4.6.4.2 Build 8245-5650 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                    Comment


                    • #11
                      Here's a quick demo of the inkIsEmpty function .. https://www.screencast.com/t/RhtVws842G
                      Alpha Anywhere v12.4.6.4.2 Build 8245-5650 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                      Comment


                      • #12
                        On the ink control, does it think its empty after signing, submitting, the clearing it, then submitting?
                        Carol King
                        Developer of Custom Homebuilders' Solutions (CHS)
                        http://www.CHSBuilderSoftware.com

                        Comment


                        • #13
                          Hmm, I'm not sure I can test that Carol since my use is not set up that way. I have a blank signature field when the user opens the UX. When they click the checkbox it reads in the signature based on their login info and populates the signature field.
                          When the UX is submitted it is closed so the next form that is opened will be blank again.
                          Alpha Anywhere v12.4.6.4.2 Build 8245-5650 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                          Comment


                          • #14
                            I would ask AA about this, I don't use either control but did test them today, what's going on with the control is ambiguous.
                            When is it ever empty? - Just send a note to Selwyn for assistance on it, send your test case.
                            Pete

                            signatureIsEmpty Method


                            Syntax

                            {dialog.Object}.signatureIsEmpty(UXControlName [, length]);

                            Arguments
                            UXControlNameID of the Signature Control
                            lengthThe "length" to compare the base64 encoded string to determine whether or not the signature is empty.

                            Description

                            Returns value indiciating whether or not the Signature control is empty.

                            Discussion

                            Returns true if a signature control is empty (has not been signed). The base64 encoded signature is compared against a 'length' parameter to determine if the control is empty.

                            If you do not pass in a length parameter, a default parameter value (appropriate for the type of browser you are using) is used.

                            Note that even if a signature control has not been signed, the base64 encoded value in the control is not be empty.

                            Example

                            var flagEmpty = {dialog.object}.signatureIsEmpty('signature1');
                            Insanity: doing the same thing over and over again and expecting different results.
                            Albert Einstein, (attributed)
                            US (German-born) physicist (1879 - 1955)

                            Comment


                            • #15
                              I can't help but wonder if the trick is to grab the length of the control while it's "empty", then compare that length to the length of the control after it's been submitted.
                              Gregg
                              https://paiza.io is a great site to test and share sql code

                              Comment

                              Working...
                              X