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

Select all items in multi-select list box by default

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

  • Select all items in multi-select list box by default

    How can I "pre-select" all items (select all items by default) in a multi-select list box (X-Diaolog box)?

    Or can I at least add a button to an X-Dialog box to allow the user to select all items?
    Thanks.
    Jay Talbott
    Jay Talbott
    Lexington, KY


  • #2
    Re: Select all items in multi-select list box by default

    Jay

    Set the resulting string to the initial string that contains the choices....
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    Comment


    • #3
      Re: Select all items in multi-select list box by default

      Al,
      Thanks for the prompt response.
      I am initializing the choices through an array, and returning a carriage return, line feed list.

      DIM SHARED vc_labor_line as C
      DIM SHARED vc_target_job as C
      DIM SHARED varC_result as C
      auto_list_vc_labor_line = table.external_record_content_GET("job_labor", "row", "row", "job_number='"+vc_job_number+"'")

      temp_count = w_count(auto_list_vc_labor_line,crlf())
      DELETE a_vc_labor_line
      DIM a_vc_labor_line[temp_count] as c
      a_vc_labor_line.initialize(auto_list_vc_labor_line)

      ok_button_label = "&OK"
      cancel_button_label = "&Cancel"
      varC_result = ui_dlg_box("Choose Labor lines to copy",<<%dlg%
      {region}
      Click on the line\(s) to copy:| [%M%.40,15vc_labor_line^#a_vc_labor_line];
      Enter target job number:| [.15vc_target_job];
      {endregion};
      {line=1,0};
      {region}
      <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
      {endregion};
      %dlg%)
      Not quite sure how to implement your suggestion.
      Thanks.
      Jay
      Jay Talbott
      Lexington, KY

      Comment


      • #4
        Re: Select all items in multi-select list box by default

        vc_target_job is the variable that contains the selection(s) when the xdialog is done, correct? So if you fill this variable before the xdialog is shown, all the choices will appear as selected originally?
        There can be only one.

        Comment


        • #5
          Re: Select all items in multi-select list box by default

          From what I read,

          to select all -
          vc_labor_line= auto_list_vc_labor_line

          to blank the selection -
          vc_labor_line=""

          If you post the table, we can test it.

          or use debug(1) and/or a5_show_variable() with the local_variables() argument.
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          Comment


          • #6
            Re: Select all items in multi-select list box by default

            Al,

            to select all Button ---> vc_labor_line= auto_list_vc_labor_line
            It did not work for me. What did I missing on here?
            Code:
            if a_dlg_button ="all" then
                vMailList = auto_list_vMailList
                a_dlg_button =""
            end if
            
            if a_dlg_button ="unselect" then
                vMailList =""
                a_dlg_button =""
            end if
            I tried this but not sure how to check on the items?
            Code:
            if a_dlg_button ="all" then
                dim k as n
                dim vAll as c
                for k = k to w_count(auto_list_vMailList,crlf()) 'w_count(a_vMailList)
                	vMailList = vall+word(auto_list_vMailList,k,crlf())+crlf()
                	ui_msg_box("test","show me "+vMailList) 'I can see an item until end of item
                next
                   'vMailList = auto_list_vMailList
                a_dlg_button =""
            end if
            CheckBox Sample.jpg

            Comment


            • #7
              Re: Select all items in multi-select list box by default

              Originally posted by johnkoh View Post
              Al,
              It did not work for me. What did I missing on here?
              Originally posted by Al Buchholz View Post
              or use debug(1) and/or a5_show_variable() with the local_variables() argument.
              You'll probably find that there are some formatting code that may need to be dealt with...

              so look at the variables and see what is there...
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              Comment


              • #8
                Re: Select all items in multi-select list box by default

                Quoting Al.......

                If you post the table, we can test it.

                or use debug(1) and/or a5_show_variable() with the local_variables() argument.
                There can be only one.

                Comment


                • #9
                  Re: Select all items in multi-select list box by default

                  Hello,

                  How about full scripts?

                  Code:
                  'Create an XDialog dialog box to prompt for parameters.
                  dim vMailId as c ="00029" 'for test
                  DIM SHARED vMailList as C
                  DIM SHARED varC_result as C
                  auto_list_vMailList = table.external_record_content_get("mail_list",\
                  "padr(Name,60,' ')+'^'+alltrim(maillist_id)",\
                  "Name","mail_id="+quote(vMailId))
                  
                  temp_count = w_count(auto_list_vMailList,crlf())
                  DELETE a_vMailList
                  DIM a_vMailList[temp_count] as c
                  a_vMailList.initialize(auto_list_vMailList)
                  
                  'Create an XDialog dialog box to prompt for parameters.
                  DIM SHARED vPrintList as C
                  DIM SHARED varC_result as C
                  'maillabel.set
                  tables_sets_vPrintList = <<%filenames%
                  Mail_list.dbf
                  %filenames%
                  
                  'Get just the objects for the specified table/set names
                  auto_list_vPrintList = a5enum("label",alltrim(tables_sets_vPrintList))
                  
                  temp_count = w_count(auto_list_vPrintList,crlf())
                  DELETE a_vPrintList
                  DIM a_vPrintList[temp_count] as c
                  a_vPrintList.initialize(auto_list_vPrintList)
                  
                  ok_button_label = "&Print"
                  cancel_button_label = "&Cancel"
                  varC_result = ui_dlg_box("List to Print",<<%dlg%
                  {frame=1,1:List to Print:}
                  {region}{lf};
                   [.45,15vMailList^$$a_vMailList];
                   <15,Select All!all> <15,Unselect!unselect>;
                  {endregion};{lf};
                  
                  {frame=1,1:Print with:}
                  {region}{lf};
                   [.40vPrintList^=a_vPrintList];
                  {endregion};{lf};
                  {line=1,0};
                  {region}{lf};
                  
                  <*15=ok_button_label!Print> <15=cancel_button_label!CANCEL>
                  {endregion};
                  %dlg%,<<%code%
                  if a_dlg_button ="all" then
                       '  vMailList = auto_list_vMailList
                      
                      dim k as n
                      dim vAll as c
                      for k = k to w_count(auto_list_vMailList,crlf()) 'w_count(a_vMailList)
                      	'vAll = k+auto_list_vMailList+crlf()
                      	vMailList = vMailList+word(word(auto_list_vMailList,k,crlf()),2,"^")+crlf()
                      	ui_msg_box("test","show me "+vMailList)
                      next
                      'vMailList = auto_list_vMailList
                      a_dlg_button =""
                  end if
                  
                  if a_dlg_button ="unselect" then
                      vMailList =""
                      a_dlg_button =""
                  end if
                  %code%)
                  
                  if varC_result="print" then
                      dim vListIds as c
                      vListIds = *for_each(x,"MailList_id = "+quote(word(alltrim(word(vMailList,2,"^")),1)), vMailList) 
                      ui_msg_box("to print list",""+vListIds)
                      filter = alltrim(vListIds)
                      filter = stritran(filter,crlf()," .or. ")
                  
                      'Printing on selected reports
                      filter = replace_parameters(filter,local_variables())
                      	:label.preview(vPrintList,filter)	
                  end if

                  Comment


                  • #10
                    Re: Select all items in multi-select list box by default

                    How can we look at this without a sample data table?
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    Comment


                    • #11
                      Re: Select all items in multi-select list box by default

                      Stan and Al,

                      Thank you

                      After added it(script) on a Form Button, it works very, very well.
                      One click, selected all and un-selected all.

                      Thank you for help

                      Comment

                      Working...
                      X