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

Checkbox in UX List Control

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

    Checkbox in UX List Control

    I am trying to add a checkbox to a list control in the UX component, with multi-select enabled that will provide additional user feedback that a row in the list has been selected. I can easily add the checkbox using a custom Control in the field tab of the component

    eg:

    xCheck_render = <<%html%
    <input type="checkbox" value=sel">
    %html%


    What I want to do is set the checked value each row when it is clicked, via the OnSelect Event. If I could obtain a pointer to the current checkbox control I could do this using jquery, by jQuery.attr('checked',true).

    Any suggestions appreciated

    Cheers Mike
    Mike Thomson

    #2
    Re: Checkbox in UX List Control

    You first need to set up a unique id for each checkbox. Once that's done you can use jQuery to get at the checkbox... but javascript will do it for you as well.

    Checkboxes seem to be a bit troublesome. Even though I can render a checkbox... and sets it's rendered value... I can't (easily) change it's value just by clicking on it. It will change... but then changes back... and I'm not sure why. So I had to resort to some funky stuff. Have a look. The component is attached.

    http://www.youtube.com/watch?v=ezUmV_dxSj4

    Getting the checkbox to render with a unique id per row is easy. If you find a better way of working with it please post.
    Attached Files

    Comment


      #3
      Re: Checkbox in UX List Control

      Thanks David for taking the time to post your reply - I notice that you are explicitly setting an on-click event for the checkbox control (in the list layout template), however I want it to be set when the list row is selected (not when checkbox is clicked). I have explored the "this" variable in chrome debugger and can find reference to the currently selected row. With this index I can then set attributes of an explicit control ID (set in the list layout template).

      Do you know (or anyone) how to obtain the current row index of the selected list item?
      Mike Thomson

      Comment


        #4
        Re: Checkbox in UX List Control

        Because you're not interacting directly with the checkbox... then you can trust it's current state. If you look through the events of the List control you'll see references to this, data, index and other good stuff. Index is the zero based row number.

        Using a zero-based placeholder {<ZeroBasedRowNumber>} to set the Id of each checkbox, the onTap or onClick event, which fires for the row tapped, could fire this code to change the values of the checkbox...

        Code:
        var currState = $('checkbox'+index).checked;
        
        {dialog.Object}.__checkRow = index;
        
        if (currState == true){
        	setTimeout("{dialog.object}.buttonClick('BTNCHECKOFF');",50);
        	}
        	else
        	{
        	setTimeout("{dialog.object}.buttonClick('BTNCHECKON');",50);
        	}
        You'll notice that the "if" statement code is opposite than if you were interacting directly with the checkbox. If the checkbox is true then set it false. However, if you're interacting directly with the checkbox the logic would be... if the checkbox is true then set it true.
        Last edited by Davidk; 03-22-2014, 11:35 AM.

        Comment


          #5
          Re: Checkbox in UX List Control

          Even better... and once again because you're not interacting with the checkbox directly... you can get rid of the button click stuff. This code works in onTap...

          Code:
          var currState = $('checkbox'+index).checked;
          
          if (currState == true){
          	$('checkbox'+index).checked=false;
          	}
          	else
          	{
          	$('checkbox'+index).checked=true;
          	}

          Comment


            #6
            Re: Checkbox in UX List Control

            Perfect Dave .. I didn't realise that index variable was being set for the list array ... Answers my question perfectly regarding current record in list - the solution is elegant. Thanks heaps!


            Final solution attached for others.listWithCheckboxes.zip
            Mike Thomson

            Comment


              #7
              Re: Checkbox in UX List Control

              Thank you for this solution I was just looking for how to do this.

              Tom

              Comment


                #8
                Re: Checkbox in UX List Control

                I used the methods described in this post to add a checkbox to my list control. Here are a couple additions to the method:
                • If you check Read Only in the List Properties, it solves the problem of the checkboxes togging back off/on after you try to set the check value.
                • If you have more than one list control, the three boxes (Check Off, Check On, Button) need to be directly above the list you are trying to affect.
                • To hide those three boxes you need to use display:none rather than checking the Hide property.
                Steve Wood
                See my profile on IADN

                Comment


                  #9
                  Re: Checkbox in UX List Control

                  This is perfect. Thank you. For some lists like reconciling checks I set the value of the controls like 'cleared' and 'reconciled' in the onTap event and it is saved back to the table. Now i can convert my remaining grid to lists.
                  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: Checkbox in UX List Control

                    Nice! Fitt's Law. It is so obvious and have felt the frustration of having my fat fingers slowing me down by searching the precise small point to touch. But I hadn't thought of it like that before.

                    Just need to balance between bigger targets and the need for smaller targets in order to fit more on the screen so that users don't have to scroll or take some other action to get to the bigger target.
                    Last edited by Al Buchholz; 11-13-2018, 09:48 AM. Reason: added link to google

                    Comment


                      #11
                      Re: Checkbox in UX List Control

                      Nice .. thanks for sharing this guys. Very useful information.
                      Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                      Comment

                      Working...
                      X