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

Disabling Grid Buttons

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

    Disabling Grid Buttons

    Hello everybody,


    I am working on a time clock using a grid and a custom UX component. Each record has an in and out value. I have clock out buttons on each row, and I also have an action button (ClockIn) that I want disabled if any records for that employee have not been clocked out on. Accordingly, the row buttons should be disabled if there is no clock ins.

    I figured the easiest way to do this would be to enable/disable the buttons based off of whether or not the other button is enabled or disabled. For example, if ClockIn button is disabled, then all ClockOut buttons will be enabled (and there would be a show/hide expression on the out buttons to limit them to just the row that has an in and not out value).

    My issue comes when I am trying to setup the javascript on the onGridRenderComplete event, specifically when trying to set the pointer to the clock out button which is _UNBOUND_BUTTON_1.

    var ClockInBtn = {grid.componentName}_BUTTONS_CLOCKIN; <--- works just fine
    var ClockOutBtn = {grid.componentName}_UNBOUND_BUTTON_1; <--- throws up script error
    var ClockOutBtn = {Grid.ComponentName}.V.R{Grid.RowNumber}._UNBOUND_BUTTON_1; <--- also throws up script error

    Once I learn what the proper syntax is I can then continue to build the code that will determine which button should be enabled/disabled.

    Thank you in advance.

    #2
    Re: Disabling Grid Buttons

    I cannot help you with the syntax. Just wanted to mention that I wrote a time clock app for desktop and went the same path you are going. I had clock in and clock out buttons enable/disabled based on the last button press. I quickly learned that people routinely forget to either clock in or clock out. Now I just keep both buttons enabled and let them click them as they see fit.
    Andrew

    Comment


      #3
      Re: Disabling Grid Buttons

      I am not sure that you can set the enable/disable with another button visibility. how about when people clock in they fill out the time if that field is complete then you can disable the clock in button, on grid initialize you enable clock in button disable clock out button.
      both times I think it should be based on a field in the grid not the other button's visibility.
      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


        #4
        Re: Disabling Grid Buttons

        Originally posted by BCJack View Post
        Hello everybody,


        I am working on a time clock using a grid and a custom UX component. Each record has an in and out value. I have clock out buttons on each row, and I also have an action button (ClockIn) that I want disabled if any records for that employee have not been clocked out on. Accordingly, the row buttons should be disabled if there is no clock ins.

        I figured the easiest way to do this would be to enable/disable the buttons based off of whether or not the other button is enabled or disabled. For example, if ClockIn button is disabled, then all ClockOut buttons will be enabled (and there would be a show/hide expression on the out buttons to limit them to just the row that has an in and not out value).

        My issue comes when I am trying to setup the javascript on the onGridRenderComplete event, specifically when trying to set the pointer to the clock out button which is _UNBOUND_BUTTON_1.

        var ClockInBtn = {grid.componentName}_BUTTONS_CLOCKIN; <--- works just fine
        var ClockOutBtn = {grid.componentName}_UNBOUND_BUTTON_1; <--- throws up script error
        var ClockOutBtn = {Grid.ComponentName}.V.R{Grid.RowNumber}._UNBOUND_BUTTON_1; <--- also throws up script error

        Once I learn what the proper syntax is I can then continue to build the code that will determine which button should be enabled/disabled.

        Thank you in advance.
        The timekeeping app I wrote uses one button. They would click IN the first time which changes the word IN to OUT so when they click it the second time, they're done.

        If they forget to clock in, they'll hit IN and then OUT and someone will have to edit that record. They'd have to edit that error regardless. Lastly, if you have two buttons, your user may hit the wrong one anyway. Less is more generally speaking when you want to reduce a user's potential for error.

        Comment


          #5
          Re: Disabling Grid Buttons

          Thank you all for responding.

          The reason why I have one In button and many out buttons is because when a user clocks in, they must also fills in a few things, like the task they are doing, and when they clock out they must mark their progress and have the ability to make any time adjustments. This could be achieved with dynamic code on a button, but I am afraid that is a bit beyond my skills alone, particularly how I would setup the button and the component editing that record to determine what record needs to be edited.


          I think you are right, Govindan. It should be based off a field, but I do not know how to make the clock in button reference the field in the last record filtered on that userID. But if I did, would a enable/disable expression be the way to do what I need?

          Comment


            #6
            Re: Disabling Grid Buttons

            they must also fills in a few things
            if you can post a screencast of the grid or the fields that contains or any of the task they have to fill it in then it will be easy to figure it out.
            or you can enable the clock in on grid execute, once they clock in they fill out some information, that will enable the clock out button.
            need more info to figure things out.
            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


              #7
              Re: Disabling Grid Buttons

              2015-06-03 14_53_13-Alpha Anywhere.png

              2015-06-03 14_58_09-Alpha Anywhere.png

              PunchedTimeIn and PunchedTimeOut are the fields they will enter values into. Job and JobLineItem are the fields they will also select from when clocking in, and Progress and BreakTime are the fields they will enter data into when they clock out.

              Thank you very much for taking your time to help me.
              Attached Files

              Comment


                #8
                Re: Disabling Grid Buttons

                http://screencast.com/t/9t8NHCBSeX

                take a look at this screencast.
                this is only to show how to hide/unhide a button alternating with another one based on some value in the grid.
                you can use this and modify to suit your need.
                let me know if you need any clarification.
                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


                  #9
                  Re: Disabling Grid Buttons

                  That is it! Thank you so much. I apparently was making it waaaaaay more complicated in my mind.

                  You mentioned about typically not having two separate fields for date and time. I did not want to do this, but I could not figure out to how to have date & time picker for one field, and I figured I just could not do it or it was too complicated for the amount of time I had to spend on this overall thing. After your video, I went back and figured it out, so thank you for that as well.
                  Last edited by BCJack; 06-03-2015, 07:57 PM.

                  Comment


                    #10
                    Re: Disabling Grid Buttons

                    After further testing I have discovered one issue with this: the showing/hiding of each button is conditional on each row. For example, if you have two records, one with a time in and out, the other with just a time in, a user can clock in and create a new record if he selects the record with an in and out. I want to hide the clock in button if ANY record has an out field that is empty, not just the currently selected row. If it helps any, there is no reason why a user will need to select a row just as long as the clock out button on that row still works.

                    Comment


                      #11
                      Re: Disabling Grid Buttons

                      instead of action button if you create another button and make it, clock in, you will have two buttons, but only one should be visible all the time, may be that is a way to implement what you like.
                      I discarded the dialog and grid, when I have a chance I will try again. may be you will need little bit more conditions for enable/disable in those buttons since you don't want any button in a row that has time in and time out.
                      I will check it out later on.
                      ( so you will have only one active row - incomplete row at any given time?)
                      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


                        #12
                        Re: Disabling Grid Buttons

                        Thank you for your reply.

                        I would like the clock in button to be an action button due to having a clock in button that makes new records on each record can be quite confusing to the user.

                        Originally posted by GGandhi View Post
                        ( so you will have only one active row - incomplete row at any given time?)
                        That is correct. If they want to clock into something else they must first clock out of anything they might be clocked into.

                        Comment


                          #13
                          Re: Disabling Grid Buttons

                          I think I either need to disable the user selecting records in the grid and have the grid select the last row on initialize or put a formula in the enable expression that looks at the last record regardless of which one is selected. Any suggestions?

                          Comment


                            #14
                            Re: Disabling Grid Buttons

                            i tested a new theory, but it seems it is difficult to do the way you want so far. if i find something i will post back.
                            Last edited by GGandhi; 06-06-2015, 09:49 AM.
                            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


                              #15
                              Re: Disabling Grid Buttons

                              Thank you for working with me on this. I appreciate your effort and patience with me since I know so little in regards to all of this. I did go ahead and merge the date and time fields, however.

                              I have come up with a third option, but it seems a little to unnecessary just to control the buttons. Making SQL IF expression that will show all records for that employee if all out fields have time in them, otherwise showing only the records with no out time. Sounds over-the-top to me, and I am not sure if doing such a thing is feasible in regards to refreshing the grid as records are added, but in theory it sounds legit.

                              Comment

                              Working...
                              X