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



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

ink.setbackground sets the form to dirty

  • Filter
  • Time
  • Show
Clear All
new posts

  • ink.setbackground sets the form to dirty

    I am using a list view to display an image with an ink overlay. When you select an the image in the list view, a detail view is populated. I am using the onselect to set the background of the ink control in the detail view with the method in the video The problem is that using this method to set the background cause the ink control to get set to dirty but the ink data has not changed.

    Is there a way to update the background without causing the form to get set to dirty?

    I am using the following code in the onselect event of the list control:

    var image1 = {dialog.object}.getValue('document_path');
    var ink = {dialog.object}.getControl('ink1');
    ink.setBackground({ image: {data: image1}});

  • #2
    Re: ink.setbackground sets the form to dirty

    I believe this is because you have Auto Commit turned on in your Ink Control. With Auto Comment turned on, any activity concerning the Ink Control will be committed and therefore dirties the UX. With Auto Commit turned off setting the background does not dirty the UX.

    For more control, turn Auto Commit off... and then when you're finished with the Ink Control and ready to do something else (however you do that... via button etc.) use the .commit() method of the Ink Control before you do anything else. This will keep the UX clean until you actually commit the ink.


    • #3
      Re: ink.setbackground sets the form to dirty

      Yes you are correct I have auto commit turned on. I wanted to use that feature to help the users ensure that that user did not loose there Ink Data. The ink data was not update just the background image. I am looking for a solution so that want the ink data is changed it is update (not when the background is changed).

      Using a button to commit the ink data does not work because I want to use next and previous buttons to navigate the list and update the detail view. If a user actually made changes to the ink control, they loose there data.

      Why does the control become dirty when you set the background image?


      • #4
        Re: ink.setbackground sets the form to dirty

        Because you are doing something to the image... it's just the way it was put together.

        For a solution... use the .commit() method where ever a use might click. E.g. on your next and previous buttons. Just .commit() first... and then navigate. Your ink data will not be lost.


        • #5
          Re: ink.setbackground sets the form to dirty

          Using .commit() is basically the same thing as turning on auto commit. The down side is every time a user looks at the ink data and then navigates away, the record is marked as dirty even though they did not change the ink data. This causes a lot of unneeded work on the server just because the user looked at a record.

          Thanks for your help.


          • #6
            Re: ink.setbackground sets the form to dirty

            Have to disagree a bit. Using .commit(), when it's called, has the same effect as auto commit... but it's in your control when to call it. Really big distinction there. And... more importantly... what does this have to do with the server? .commit() doesn't make a server call. .commit() updates the Ink control on the client. This has the effect of making the UX dirty... and then you can call a server update when you're ready.

            Overall, I agree with you that setting the background of an ink control shouldn't set the UX dirty. At least, I can't really see a reason for it... there may be though.

            However, there's other stuff you can do.

            With the Ink control Auto Commit on or off (doesn't matter - that's up to you) you can check the status of the UX before you set the background.

            If the UX is already dirty... then all good... setting the background has no ill effect.

            But, if the UX is clean before you set the background... then set the background and then reset the UX.

            var ink = {dialog.Object}.getControl('ink1');
            //is the UX dirty before setting the Ink Control
            var isDirty = {dialog.Object}._isDirty;
            ink.setBackground({ image: { data: url}})
            	//nothing to do here


            • #7
              Re: ink.setbackground sets the form to dirty

              That was the method I was looking for "{dialog.Object}.resetForm(false)". Unfortunately, when the resetform is run, the background image is removed and you are only left with the ink data and a non-dirty form.

              Thanks for the Idea.


              • #8
                Re: ink.setbackground sets the form to dirty

                I'm work with Alpha version 3638 and I don't see that behaviour at all. Attached is a sample UX with 2 PanelCards, with Ink Control set to NOT Auto Comment and a number of test buttons.

                If you can re-produce the set of circumstances in which a .resetForm removes the background image I'd like to see what's doing that.
                Attached Files


                • #9
                  Re: ink.setbackground sets the form to dirty

                  Thank you for your response. I have been working when I can on a few test cases. I was never able to get your test cast to remove the background image with a reset. However, I was able to get the component to remove the background image when the image is set from a list or a ux populate with a list of primary keys. I took me a while because I thought I lost my mind when I broke my test case. NOTE - when you have a list control providing the data for a background image, make sure you have set the image filed transformation template to "<absolute>\<value>". Without that info, alpha does not convert the reference file to a url reference. Anyway, I believe my test case removes the background image when you submit a rest probably because of how the image is referenced.

                  I found 2 bugs in my testing that I will be reporting to Selwyn. When you save ink data with only a background, the next time you load the ink data, the component locks up. I assume this is a result of a problem with javascript. The following is data I saved into my ink control without any ink data other than the background (which breaks the component): NOTE that the data below was saved from firefox preview (if you save from working or live preview, then the image reference is the absolute file reference - c:\myimagepath\imagename.jpg).

                  The other bug is just a performance issue that most people will never see. I found it by watching the session folder under the a5webroot. The number of images copied to the folder are copied by an exponential factor of 2 when you have a background image on an ink control.

                  version 1.0
                  settings %json%
                  {"page":{"width":5,"height":3,"unit":"in","dpu":300,"lines":false,"background":{"image":{"data":"A5SessionFile/23fd839b-6fd2-41e5-bdf8-00def0bf681c.JPG","type":"image","position":"center","size":"contain"},"color":""}},"meta":{"bounds":{"l":1500,"t":900,"r":0,"b":0},"created":"2016-06-08 04:36:37 am","modified":"2016-06-08 04:40:36 am","pen":{"color":"#000000","width":4,"lineCap":"round"}}}
                  When you save ink control with lines/drawings and with a ink background, the component continues to work correctly:
                  version 1.0
                  settings %json%
                  {"page":{"width":5,"height":3,"unit":"in","dpu":300,"lines":false,"background":{"image":{"data":"A5SessionFile/7fb9f568-5e0f-4158-80aa-255719107252.JPG","type":"image","position":"center","size":"contain"},"color":""}},"meta":{"bounds":{"l":369,"t":271,"r":1250,"b":588},"created":"2016-06-08 04:46:54 am","modified":"2016-06-08 04:47:02 am","pen":{"color":"#000000","width":4,"lineCap":"round"}}}
                  A pen 4 #000000
                  S 1247,310,pIpHyP-40X-36X-37+36-56+37-56+44-73+32-77+29-52H-48D-49D-56+-41d-60u-36p-37-32xttxlphu+lDtLpXt+53-32+52y+68t+81l+101++129X+109+33+89+48+64+44+48+41M+32DT+L
                  Ink Control is an awesome feature that I have many plans for and will shortly be implementing in my production environment.