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

List Control Alphabet Buttons - making my own

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

    List Control Alphabet Buttons - making my own

    I am working on setting up a template for myself for using List Controls in UX components (since I am thinking of moving a lot of my grids to list controls). On the grids, I quite often use the Alphabet Search buttons, but could not find anything comparable for the List Control. So.... I launched off and made my own on a template, which involved creating 36 buttons, quite tedious... The reason I am posting this is that I wondered if anybody might have a suggestion for how to set those up so that each time I make a new UX component with these, I don't have to go through all 36 buttons and change them to search the right field in the list control. Here is a video that might explain this better: http://screencast.com/t/oCRjAZHl

    Also attached is my template ux component and anyone is welcome to use it if it helps you in any way. (maybe someone will post a new and improved one here, though.... fingers crossed)
    ZZZ_ListControlSearchTemplate.zip
    Carol King
    Developer of Custom Homebuilders' Solutions (CHS)
    http://www.CHSBuilderSoftware.com

    #2
    Re: List Control Alphabet Buttons - making my own

    Well, you've already set your buttons to look at CompanyName. So, one method is to always make sure you have the key/search field named as CompanyName (though if you choose this path you may want to change everything once to "SearchField" or something like that.)

    So even if your table has, say, FacilityName your Select statement would be "..... FacilityName as SearchField...."

    As a slight alternative, you could still bring in FacilityName but also bring in "...FacilityName as SearchField...." and perhaps even hide it with CSS, but still have it present for your buttons.

    But wait and see - someone will probably come up with something more clever and fitting here.
    -Steve
    sigpic

    Comment


      #3
      Re: List Control Alphabet Buttons - making my own

      Steve, good idea!
      Carol King
      Developer of Custom Homebuilders' Solutions (CHS)
      http://www.CHSBuilderSoftware.com

      Comment


        #4
        Re: List Control Alphabet Buttons - making my own

        I tried Steve's idea and am not succeeding. See the button labeled TestA in the revised component attached.

        ZZZ_ListControlSearchTemplate_2.zip
        Carol King
        Developer of Custom Homebuilders' Solutions (CHS)
        http://www.CHSBuilderSoftware.com

        Comment


          #5
          Re: List Control Alphabet Buttons - making my own

          This is a bit clunky but I had a go at extracting some of the logic for the values that need to be set in the filter.(as you can tell I am not a trained programmer) It works on it's own but haven't figured how to make it work with the search message on and hide events you have.

          1) Instead of the List Control Action you have for the filter put the following code in each of the button controls

          Code:
          MyButtonFilter(this.id);
          you can obviously call it anything you like.

          2) Then use a JavaScript function to do the filtering. Within the function you only need to amend the List ID reference and the search field reference when the control is re-used.

          Code:
          function MyButtonFilter(ButtonID) {
          
          // Button ID looks like this example  DLG1.V.R1.BUTTON_23
          // Extract ID part at the end
          var ActualButtonID = ButtonID.substr(10,ButtonID.length-10); 
          
          
          // Create the command code to get the button Text
          var CommandText = '{dialog.Object}.getValue('+'\''+ActualButtonID+'\''+')';
          // Now get the Button Text
          var ButtonText = eval(CommandText);
          
          
          //------------------------------------------------------------------------
          // The two parts needing to be amended for each implementation of the list
          //------------------------------------------------------------------------
          // Amend ListName ID and SearchField Name
          var ListName = 'LIST1';
          var SearchField = 'CompanyName';
          
          
          // Create Filter Command Text
          var CommandText_Part1 = '{dialog.object}._filterList('+'\''+ListName+'\'';
          var CommandText_Part2 = ','+'\''+'lower( left('+SearchField+', 1) )= ';
          var CommandText_Part3 = 'lower('+'\\'+'\''+ButtonText+'\\'+'\''+')'+'\''+','+'\''+'\''+','+'\''+'\''+')';
          var FilterCommandText = CommandText_Part1+CommandText_Part2+CommandText_Part3;
           
          
          var ApplyFilter = eval(FilterCommandText);
          
          }
          Last edited by DBM; 11-30-2014, 04:43 PM.

          Comment


            #6
            Re: List Control Alphabet Buttons - making my own

            An update on the earlier post. If the input to the function is the actual button ID

            Code:
            MyButtonFilter2('BUTTON_27');
            instead of this.id it overcomes the earlier issue but does mean entering the specific code for each button.

            then alter the function at the top to skip the translation from full id to the actual button ID. This works OK with your other code. I guess the context of using this.id is disrupted when the other code is run. Maybe one of the experienced guys can solve it.

            If there is a potential for buttons to be re-named when the component is copied / re-used that would determine if a more generic solution is needed.

            Comment


              #7
              Re: List Control Alphabet Buttons - making my own

              Yup, sorry that first suggestion didn't work. I hadn't tried it, but I did download your component and did this:

              Behind the TestA button, comment out your existing List Control Action. Add, right above or below it, some InLine Javascript:

              Code:
              search('A');
              Now, create a javascript function over in the code section:

              Code:
              function search(sv) {
              	//{dialog.object}._filterList('LIST1','lower( left(CompanyName, 1) ) = lower(\'A\')','','');
              	filter = 'lower( left(CompanyName, 1) ) = lower(\''+ sv + '\')'
              	{dialog.object}._filterList('LIST1',filter,'','');
              	
              }
              I left the commented line there because that's the javascript that the action scripting was producing - it's just reference but helps you "see" better what's going on.

              So now you have a single javascript function where, for each component you use, you simply need to change the name of the Search field once in the function.
              -Steve
              sigpic

              Comment


                #8
                Re: List Control Alphabet Buttons - making my own

                Something else you might consider too Carol:

                Behind every button, you have this:

                Code:
                A5.msgBox.show('Searching.','<div style=\'padding: 20px;\'>Searching for records that start with your selection.<br>Please wait...</div>','none',function() {});
                You could replace this with something like

                Code:
                showwait();
                Then, make a javascript function like this:

                Code:
                function showwait() {
                     A5.msgBox.show('Searching.','<div style=\'padding: 20px;\'>Searching for records that start with your selection.<br>Please wait...</div>','none',function() {});
                }
                This also allows you to modify the message easily if you decide to -- don't have to do it 36 times.
                -Steve
                sigpic

                Comment


                  #9
                  Re: List Control Alphabet Buttons - making my own

                  Here's a real brute force, 10 second way of doing what you'd like. I'd also bet Selwyn's got List Alpha Search Buttons in his back pocket somewhere.

                  Open up your excellent, button filled, UX... and Select all your Alpha search buttons.

                  Then... Menu, Copy Selected Controls to Clipboard.

                  Next... open up your new UX... let's say it's brand new... no controls...

                  Menu, Paste Controls from Clipboard... then ok.

                  There's all your nice buttons.

                  Now... at the botton tab area click XBasic.

                  Position your cursor on the top row. Right-click, Replace. Now replace CompanyName with MyNewName and click Replace All. There are 109 of them by the way... yikes.

                  Now click the Settings tab... and Alpha will happily save your changes. Not very fancy... but...

                  Comment


                    #10
                    Re: List Control Alphabet Buttons - making my own

                    David's response reminded me of how we used to do this (some still do) on the desktop forms (yeah I feel like an old-timer reminiscing...) and how this might translate to the web forms. The answer is a ButtonList control. I don't have time to model one right now but it's pretty simple, I'm pretty sure it would work. And I'd probably use javascript very similar to what I suggested earlier.
                    -Steve
                    sigpic

                    Comment


                      #11
                      Re: List Control Alphabet Buttons - making my own

                      I'm going to be trying your suggestions, Steve. But, in response to David's suggestion, I don't see Xbasic in a bottom tab area on the ux component like I do on grid components. His suggestion was actually the first one I thought of for how to replace the field names, but I couldn't find the xbasic tab.
                      Carol King
                      Developer of Custom Homebuilders' Solutions (CHS)
                      http://www.CHSBuilderSoftware.com

                      Comment


                        #12
                        Re: List Control Alphabet Buttons - making my own

                        I was thinking the same thing about the ButtonList control last night. In fact, the ButtonList control has sample JSON data for Alpha Button Searches. You just need to add your numbers in there to complete the list. Here's a UX implementing the ButtonList control, searching against a List.
                        Attached Files

                        Comment


                          #13
                          Re: List Control Alphabet Buttons - making my own

                          Carol, this is the xbasic tab David was talking about.

                          xbasicbutton.PNG
                          Alpha Anywhere V12.4.1 Build 3594-4665
                          Application Server V12.4.1 Build 3594-4665 Running on Windows Server 2008 R2 Standard 4GB Ram X3430 @ 2.40GHz
                          MySQL 5.5.38

                          Comment


                            #14
                            Re: List Control Alphabet Buttons - making my own

                            thanks, Joe, but I don't have that tab and I have the latest release. here's a screenshot

                            12-2-2014 4-44-26 AM.jpg
                            Carol King
                            Developer of Custom Homebuilders' Solutions (CHS)
                            http://www.CHSBuilderSoftware.com

                            Comment


                              #15
                              Re: List Control Alphabet Buttons - making my own

                              I am no where near aa version 12 but in a ux or dialog the xbasic is still below that level, you may have to scroll down the whole page using the extreme right scroll bar to see the xbasic, setting tabs,
                              I think.

                              http://screencast.com/t/TXpLHy4HB
                              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

                              Working...
                              X