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

Use multi-select in list control to insert selected records to a UX bound table

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

  • Use multi-select in list control to insert selected records to a UX bound table

    Hello all,

    It seems like this should be a fairly straight-forward process, however I have been unable to find a solution.

    In short, I have a list control that lists all company items ready to "add" to purchase order.

    I'm trying to have a functionality for a user to click all the items that they want to use to "build" a purchase order. I have a SQL table built which would house all the item details for a given PO.

    I was hoping to simply click all the desired items, then use a button that would fire a list control action that would add all selected items to my repeating section to list all the selected items. I'm currently using the action - "Populate controls with data from a current row in list", which works, however it only adds one row at a time, as stated in the function. Is there one that would populate data from all "selected" rows?

    Any ideas? I'm open to any suggestion. I basically want the functionality to select multiple and click a button to send all selected items to another table...

    Thank you in advance for your help.

    -Casey

  • #2
    Re: Use multi-select in list control to insert selected records to a UX bound table

    You could do this a number of ways depending on how complex you wanted to get..

    Since you are utilizing the repeating section and populating the controls I'm assuming from the OnSelect event of the list, you need to access the repeating section and list arrays to get it working like that.. Are you dead set on using a list control?

    Have you considered using the repeating section (details table) and doing a dropdown on say... the order item field so that users are able to select order items from a dropdown and add as many order items as they'd like to?.. Ideally, when the order item is selected, if you have any additional fields that need to be saved to details table, you can do a fill-in based on order item selection..

    Comment


    • #3
      Re: Use multi-select in list control to insert selected records to a UX bound table

      Hello Riley,

      Right, I have examined different ways and thought of doing a drop-down menu for each line of the repeating section, however just thought from a user experience standpoint might be most useful to see all the items listed in one clean list and just click away on the items they want to order, as opposed to going to each line and scrolling down to each. Just seemed like more clicks. Also my item lookup table which is about 10k items sometimes take longer in drop-down than a list does....

      I would also like to just know how to insert multiple records into a table. THis has been my only block wall on thinking of how to do certain things. Being able to update records one at a time is a breeze, but when it comes to inserting a bulk batch of records I have not found a simple way to do.

      In the meantime, can you elaborate on using "list arrays"? I have yet to use this functionality.

      Thanks again, Casey

      Comment


      • #4
        Re: Use multi-select in list control to insert selected records to a UX bound table

        Hi Casey..

        I'm following up on this request as I have a similar concept I need to implement and it seems as if it is a common enough scenario that I would need to implement the concept over and over.

        In my particular case, I have a list of users (upwards of 800) and a list of applications (upwards of 200). I'd like to present a screen showing a selected application and then have two lists.

        One list would contain all the users that currently have access to the selected application
        The second list would be for all other users who don't have access

        The idea would be to move items between lists so that user access could be removed as well as moving unassigned users into the access list.
        I've gotten as far as setting up the two lists with 4 buttons (>, >>, <, <<) and the queries work so that they show current access users and the remaining users.

        My question is, once the lists are completed to a users satisfcation, how do you go about saving the data.

        The underlying database is SQL Server and we are talking about 3 tables (RegisteredUsers, Applications, and a cross table RegisteredUsersXApplications).
        The cross table has 3 fields, an auto increment primary key, a foreign key to RegisteredUsers and a foreign key to Applications)

        Thanks,
        Jeremy

        Comment


        • #5
          Re: Use multi-select in list control to insert selected records to a UX bound table

          The List control has a few properties that can be used to determine which rows are selected: .selection, .selectionKey, .selectionData, and value. selectionData, for example, is an Array of Objects, 1 for each row selected, carrying full data on each selected row.

          Code:
          var lObj = {dialog.Object}.getControl('list1');
          var rowData = lObj.selectionData;
          You'd then loop through rowData doing whatever you need. Or pass the data back to the server where you'd loop through and create your insert statement.

          SQL has the capability of inserting multiple rows.

          Comment


          • #6
            Re: Use multi-select in list control to insert selected records to a UX bound table

            Casey/Jeremy, Did either of you get this to work? I have a similar need and struggling to get it to work. Thanks.

            Comment


            • #7
              Re: Use multi-select in list control to insert selected records to a UX bound table

              Bump

              Comment


              • #8
                Re: Use multi-select in list control to insert selected records to a UX bound table

                I did server side processing.

                On the javascript click event I added some code to call a server side function "SaveListData"
                1_SubmitButton Click Event.jpg

                The the "SaveListData" has a built in e._listData that contains the data.
                I then found a post on how to handle the list data server side.
                2_SaveListData.jpg

                Comment


                • #9
                  Re: Use multi-select in list control to insert selected records to a UX bound table

                  Jeremy - thanks so much for providing this - can you, by any chance, recall the post you found for handling the list data server side?

                  Comment


                  • #10
                    Re: Use multi-select in list control to insert selected records to a UX bound table

                    Sorry, after looking further it was actually a video series.
                    If you access the Video Finder from within Alpha by going to the Help Menu and selecting "Video Finder" there is a 6 part series that contains "everything" I know about lists. It was invaluable.
                    Once the video finder opens, enter "UXL_V12--21" in the Filter.

                    2016-09-12_14-26-12.jpg

                    Comment


                    • #11
                      Re: Use multi-select in list control to insert selected records to a UX bound table

                      Thanks so much Jeremy. That's my new favorite Alpha video series! LOTS of information.

                      One question: any idea how to move data from list A to list B WITHOUT removing it from list A? The list control action, "Move selected rows from one List to another List" is nice, but I don't want to remove the data from List A.

                      Comment


                      • #12
                        Re: Use multi-select in list control to insert selected records to a UX bound table

                        Hey Scott, after you move your selected record, you could always refresh the original list, although that involves an additional callback.

                        Alternatively, it may be cleaner to just use the appendRows method and simply add a new row to your second list.

                        Here is an example using sample data. Just add this code to the onClick event of the first list.

                        Code:
                        var fn = this.selectionData[0].Firstname;
                        var ln = this.selectionData[0].Lastname;
                        var ci = this.selectionData[0].City;
                        
                        var listObj = {dialog.object}.getControl('LSTTEST2');
                        var _d = [{Firstname: fn, Lastname: ln, City: ci}]
                        listObj.appendRows(_d);
                        Nate Mitchell PMP

                        Comment


                        • #13
                          Re: Use multi-select in list control to insert selected records to a UX bound table

                          Nate, thank you so much for your note and providing the sample code. It works exactly how you describe. Much appreciated.

                          Comment


                          • #14
                            Re: Use multi-select in list control to insert selected records to a UX bound table

                            A working UX component with a list control that saves multiple selected rows to a north winds table, or sql table in general with an accompanying video would be very helpful. UXL_V12-21 touches on handling this data, but stops short of doing something useful with the submitted data like saving the entire list, or saving selected rows to a table. Seems this would be the most common use for the submitted data.

                            Comment


                            • #15
                              Re: Use multi-select in list control to insert selected records to a UX bound table

                              Thanks for this thread. I needed to get an array of primary keys for selected records in a List. I set my List to return Primary Key and used...

                              var lObj = {dialog.Object}.getControl('list1');
                              var rowData = lObj.selectionKey;

                              ...which returned an array such as ",0,1,4,2" which is in the order that the records were selected. Oddly it has a comma in the front which I stripped off. I then could use the array in a Callback to do back-end processing.

                              But David - how in the world did you know about these List properties? The term ".selectionKey" is not in the documentation, release notes or in-line help.
                              Steve Wood
                              Join the ALPHA DEVELOPERS NETWORK
                              There is no Cloud. It's just someone else's computer.
                              Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                              AlphaToGo | IADN (100% Alpha Anywhere Websites)

                              Comment

                              Working...
                              X