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

Checkboxes in a UX

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

  • Checkboxes in a UX

    I have a UX with three lists linked together in child-parent relationships. The third list has a detail view with fields mapped to checkbox controls on the UX. These fields are of the TINYINT(1) type in a MySQL table. I have the checkboxes' field type set to Numeric, set to "Treat field as a Logical field." The default value is set to 0. When I put a checkmark in any of the fields, and then synchronize, the value is not changed; it remains as 0. Not only that, if any of the other fields previously had a checkmark (value of 1 in MySql), they also get set to 0. Does anyone have a clue why this behaves this way?

    Thanks!
    Nathan

  • #2
    Re: Checkboxes in a UX

    In your List control, Fields, for the fields that are mapped to MySQL as TinyInt... change the property "Transform data type" from none to "ToLogical". TinyInt is very odd. Without Transforming the data type in the List, these fields are displayed as "T" or "F". When transformed using "ToLogical" they are displayed as "true" or "false" which will now match your mapped UX controls.

    Comment


    • #3
      Re: Checkboxes in a UX

      David,

      Thanks for your response. I did as you said, but unfortunately the behavior hasn't changed.

      Nathan

      Comment


      • #4
        Re: Checkboxes in a UX

        True... very true... (get it... a logical joke). Sorry... I didn't test far enough. I'd changed true to false... but... of course... they're all being changed to false... regardless of the value wanted.

        TinyInt and Bit are a bit of a pain because they're seen by Alpha as Logical. But... logical on the Server side is, in this case, T or F... not the client-side true or false. So... there's a conversion issue.

        So... leave the List Field with a Transform data type as "ToLogical"... and your data mapped checkbox as Numeric, Treat field as a Logical field. At least we see all true and false this way.

        On your Save button... the button which Saves the Detail View to the List... add some code...

        You already have this...

        Code:
        var lObj = {dialog.object}.getControl('LIST1');
        lObj.updateListFromUXControls();
        Add this in for each Logical List field...

        var chkTest = lObj.selectionData[0].ChkTest;
        switch(chkTest){
        case true:
        lObj.selectionData[0].ChkTest = "T";
        break;
        case false:
        lObj.selectionData[0].ChkTest = "F";
        break;
        }

        My List field is named "ChkTest". After the data is saved to the List (before sync), I get it's value from the List. The List is displaying true or false, but it's real data is T or F. So... change the data.

        The List was already showing true or false, so that doesn't change. But the underlying data now matches what MySQL wants.

        This is the reason I don't use TinyInt... it's too hard to work with. I'll waste a bit of space an use int(1). I always know I'm dealing with 1 or 0.

        Comment


        • #5
          Re: Checkboxes in a UX

          Here's another way... which more closely follows the principles of Alpha...

          In your List field, set the Transform data type to "None". Your field would show as T or F in the List now.

          Next, let's use the List Field property "onListUpdate Javascript". This lets us do a reverse Transform. The code for this is...

          Code:
          switch(this._value){
          	case true:
          		return "T";
          		break;
          	case false:
          		return "F";
          		break;
          }
          The client-side is returning true or false from the Detail View checkbox. We need to change that to something MySQL understands... via the List. So we change true to T and false to F. The List, when syncing, gives MySQL 1 or 0.

          This is much cleaner and we don't have to muck around with the Save code.

          Comment


          • #6
            Re: Checkboxes in a UX

            I have many checkboxes in detail views for list and they work as they should. I have the same settings as Nathan has in post 1. Something else is going on.
            Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

            Comment


            • #7
              Re: Checkboxes in a UX

              "When I put a checkmark in any of the fields, and then synchronize"
              Are you submitting the updates to the list first?
              Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

              Comment


              • #8
                Re: Checkboxes in a UX

                Frank,

                Sorry to take so long to respond. I was traveling last weekend and am only now getting back to this project. Yes, I am submitting updates to the list first.

                Nathan

                Comment


                • #9
                  Re: Checkboxes in a UX

                  I will try to put something together to show you how I have it set up as soon as I get a chance. Hopefully that will help. As I said before I have many lists with details and the check boxes work fine.
                  Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                  Comment


                  • #10
                    Re: Checkboxes in a UX

                    I know this is a stupid question - but are you SURE that your detail view mapping is 100%? Even if it is 100%, I would recommend unmapping the fields, save, then remap the fields.

                    Just in case there is a mapping issue.

                    Also, you might want to setup a div to show the SQL commands that are getting generated in the save. There might be a clue in there.

                    Comment


                    • #11
                      Re: Checkboxes in a UX

                      I actually have my checkboxes set up as Type: logical with the default value javascript of the tinyint(1) which shows up as type L field under the fields tab of the list control to 'return true;' or 'return false;'.
                      Last edited by frankbicknell; 01-07-2017, 02:05 PM. Reason: error
                      Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                      Comment


                      • #12
                        Re: Checkboxes in a UX

                        I'm not talking about how they are setup in the control, I am talking about how they are mapped between the List and the controls in the detail view.

                        I am suggesting you remove that mapping, put it back, and then check the sql that is being created to insure that it is doing what you think that it is doing.

                        Comment


                        • #13
                          Re: Checkboxes in a UX

                          I'm sorry Larry, my response was to Nathan.
                          Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                          Comment

                          Working...
                          X