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

XDialog Coded Listbox vs. Checkbox

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

    XDialog Coded Listbox vs. Checkbox

    I took this from the Learning XDialog database where you use the '{{Data=value}' directive to code the listbox to set the value in a variable to one value, but to display another value.

    The example in the lesson uses a listbox, but I have an instance where I would like to use it as a checkbox instead and cannot get it to work. I am including an attachment to show what I am talking about. If you run the script for the listbox and watch what shows up in the list below as you select entries, it is all correct. What I want is for it to do the same when you run the script for the checkbox. What shows up is the whole string, and not just the 'data' value.

    Thanks for your help. Dan
    Last edited by danh; 04-06-2009, 03:19 PM. Reason: Forgot attachment...
    - Dan Hooley
    - Custom Desktop or Web database development -

    #2
    Re: XDialog Coded Listbox vs. Checkbox

    I think this may be the nature of the check box. Depending on any other comments you get regarding this you might submit it as a bug. But the help pages regarding {data} speak of using it with List boxes and tree controls. ie, no mention of check boxes. It is weird though that the data displays properly in the checkbox control.

    Here is a work around. (My changes in red)

    Code:
    dim clientlist as c
    dim count as n
    clientlist = table.external_record_content_get("clients","'{data='+customer_id+'}'+alltrim(lastname)+', '+alltrim(firstname)","lastname")
    count = line_count(clientlist)
    'dim a_selected[count] as c
    dim a_select[count] as c
    a_select.initialize(clientlist)
    
    ui_dlg_box("Coded Check Boxes",<<%dlg%
    {wrap=40}
    {lf};
    {justify=center}
    Customer: \(sets the value of the 'customerId' variable);
    [%M,O={@@}%.40,10customerId^$$a_select[B][COLOR=Red]!selectChange[/COLOR][/B]];
    Actual value in the 'customerId' variable: ;
    [%M%.40,10customerId];
    \(if you type a different value in this text box the list box will reflect the different client);
    {lf};
    [COLOR=Red]Actual Customer Id pulled out of the  'customerId' variable using the *for_each\() function: ;
    [%M%.40,10customerId2];[/COLOR]
    {hyperlink=Show the actual data in the list box list!showdata};
    {lf};
    {justify=center}
    <Close>;
    %dlg%,<<%code%
    '!select_client (end of Checkbox)
    '^#a_selected    (end of textbox)
    'if a_dlg_button = "select_client" then
    '    a_dlg_button = ""
    '    a_selected.clear()
    '    a_selected.initialize(customerid)
    'end if
    [COLOR=Red]If a_dlg_button = "selectChange" then
        a_dlg_button = ""
        customerId2 = *for_each(x,word(word(x,2,"="),1,"}"),CustomerId)
    end if[/COLOR]
    if a_dlg_button = "showdata" then
        a_dlg_button = ""
        showvar(clientList)
    end if
    %code%)
    You don't need to apply the conversion within the dialog if you don't need to display it there. Just do the conversion before you actually need to use the values.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

    Comment


      #3
      Re: XDialog Coded Listbox vs. Checkbox

      Hi Tim & Dan,

      Originally posted by Tim Kiebert View Post
      .... Depending on any other comments you get regarding this you might submit it as a bug.
      I doubt it is a "bug" per say, just a limitation (but it's always a good wishlist item). While Alpha has a wide variety of functions and methods, one of my biggest complaints is illustrated here. Many functions do a feature or two, but don't carry it through all variations of usage to allow a consistency. The parameters to a function are sometimes overly complex (e.g. too many flags), or don't follow a logical pattern to allow dropping off the trailing parameters (which goes to a default), or have similar parameters to similar functions.

      Recent trivial examples of this on the message board are Mod() not working 100% with decimals, and Round() not working with negative decimal positions. While not bugs per say as they worked beyond what Alpha might have concieved, neither were they trapped for invalid ranges of parameters. This kind of falls into the same.

      Another example is that listview boxes (at least some variants - I don't recall precisely) can't (or didn't - Haven't really checked v9 in this respect) have an image in a row unless it is associated and in the 1st column. Why not any/every column ability to have images?

      Originally posted by Tim Kiebert View Post
      But the help pages regarding {data} speak of using it with List boxes and tree controls. ie, no mention of check boxes.
      As above, it's not listed as a feature, but you would ideally expect a consistency

      Originally posted by Tim Kiebert View Post
      It is weird though that the data displays properly in the checkbox control.
      I'm kind of surprised to, but apparently aspects of the same code do the same filtering.

      Your solution was exactly right, with one possible, not common, exception. If you had a very big list (I suspect larger than you ever would want to have as a checkbox) , it might have been better (read as faster) to take the current line changed, and just change/add/delete that in the output list.
      Regards,

      Ira J. Perlow
      Computer Systems Design


      CSDA A5 Products
      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
      CSDA Barcode Functions

      CSDA Code Utility
      CSDA Screen Capture


      Comment


        #4
        Re: XDialog Coded Listbox vs. Checkbox

        Hi Ira,

        Glad you chimed in on this, thanks.
        I think you put the issue very well. One of the key words I took from your reply is 'Consistency'. I guess what I described as weird is really a manifestation of inconsistency. Since the checkbox displays like similar controls do when supplying it with the same data one would expect the same output.

        Originally posted by csda1 View Post
        .....to take the current line changed, and just change/add/delete that in the output list.
        Could you further explain what you mean by this. ( I am having one of my 'thick' moments.)
        Tim Kiebert
        Eagle Creek Citrus
        A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

        Comment


          #5
          Re: XDialog Coded Listbox vs. Checkbox

          Hi Tim,

          Originally posted by Tim Kiebert View Post
          Could you further explain what you mean by this. ( I am having one of my 'thick' moments.)
          I guess it's just too late in the day for you there!:D

          Anyway, you are updating the list, reprocessing the all the checked values each time there is a change. You could (and I'm not sure if you get just the row select number of the input - I think if the target is numeric type, it will, but assuming you can) take the row number from the list, and just add/delete or change that line in the output list (maybe a collection might work well for this), rather than using *for_each() to process the entire list. *for_each() is fast, but for a really big list still has to process a lot. Regex_merge() might be an alternative to *for_each()
          Regards,

          Ira J. Perlow
          Computer Systems Design


          CSDA A5 Products
          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
          CSDA Barcode Functions

          CSDA Code Utility
          CSDA Screen Capture


          Comment


            #6
            Re: XDialog Coded Listbox vs. Checkbox

            Originally posted by csda1 View Post
            I guess it's just too late in the day for you there!:D
            And the couple of glasses of port may not be helping either. :D

            But I see clearly now. Thanks
            Tim Kiebert
            Eagle Creek Citrus
            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

            Comment


              #7
              Re: XDialog Coded Listbox vs. Checkbox

              Thank you guys for the response. That is an interesting workaround. It works great.

              One question, though, regarding the change, I want to use this in an embedded xdialog on a form and use variable binding to bind the result to a table field. So in essence, it needs to work in reverse, so it displays the result from the table field in view mode, if that makes sense. If you look again at the listbox, you can type in a valid customer ID in the bottom box, and it will automatically select the corresponding entry in the list. This needs to happen in order for it to work on an embedded xdialog on a form with variable binding, and it is not the case with the checkbox with the change. Is there a workaround for that...?? (:
              - Dan Hooley
              - Custom Desktop or Web database development -

              Comment


                #8
                Re: XDialog Coded Listbox vs. Checkbox

                The initial problem I posted here about the checkbox not working like the listbox has been identified by Selwyn as a bug, and should be fixed on the next release. It's this kind of service that keeps me believing in the product!

                Selwyn gave me a workaround using another control (not sure the difference). That gave me my checkbox back, but it created another problem. It deletes the entry in the first record when the form is opened (which might be a bug, too), so you have to cancel changes in the OnInIt event to keep the entries intact. That seems to take care of the problem for now, but the bug fix will be better.

                Attached is an updated example for those interested.

                Thanks again for all your help!
                Dan
                - Dan Hooley
                - Custom Desktop or Web database development -

                Comment


                  #9
                  Re: XDialog Coded Listbox vs. Checkbox

                  Tim,
                  Thank for this

                  If a_dlg_button = "selectChange" then
                  a_dlg_button = ""
                  customerId2 = *for_each(x,word(word(x,2,"="),1,"}"),CustomerId)
                  end if

                  Comment

                  Working...
                  X