Alpha Video Training
Results 1 to 3 of 3

Thread: Count selected rows in a list

  1. #1
    Member
    Real Name
    Scott Binger
    Join Date
    Oct 2011
    Posts
    316

    Default Count selected rows in a list

    Hi All -

    This is another one of those "should be pretty simple" questions, but I am drawing a complete blank on how to do it (simply that is... can come up with a few convoluted ways, if necessary):

    Background:

    Simple list control with one field;
    Based on SQL data;
    List is in "Multi-select mode" whereas when a user clicks (single clicks) a row, that row becomes selected. User can choose as many or as few rows as they'd like.

    Problem:
    I need to create a simple control (could be a static text control) which contains the count of SELECTED records in the list control and updates as row are selected. The later part (the update) I can handle, but the first part is eluding me.

    Thanks!

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,752

    Default Re: Count selected rows in a list

    Should this post be in this forum section? Is this just about the List Control?

    Based on your use of a TextBox Control... then... where ever you're processing the List selection... e.g. onClick, onSelect, then add this code...

    Code:
    {dialog.Object}.setValue('listCnt',this.selection.length);
    "this" is the List object when processing stuff within the List Control.
    .selection is a property of the List Control... which is an array of selected rows.
    Get the length of the array and perform a .setValue to the TextBox control.

  3. #3
    Member
    Real Name
    Scott Binger
    Join Date
    Oct 2011
    Posts
    316

    Default Re: Count selected rows in a list

    Thanks so much David. That worked perfectly. Not sure about the correct forum for this post. Happy to move it (if I can) and if its confusing where it is.

Similar Threads

  1. Getting count of rows in list after using populate
    By Pat Bremkamp in forum Tablet-Optimized Form Capabilities Beta
    Replies: 2
    Last Post: 10-02-2017, 08:55 PM
  2. List Control VISIBLE count? Used when a list has some rows hidden.
    By CarlMPearson in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 10-21-2014, 09:56 PM
  3. how to calculate the row count (No of rows) in list.
    By PaulAmmoun in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 07-29-2014, 04:15 PM
  4. selected rows in a browser
    By joseluismorales50@msn.com in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 05-17-2010, 04:59 PM
  5. Selected rows
    By gaby_h in forum Alpha Five Version 9 - Desktop Applications
    Replies: 21
    Last Post: 12-18-2008, 02:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •