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

Get column values from a UX List Control

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

    Get column values from a UX List Control

    I hope someone can help with an issue which I didn't think would be difficult, but has puzzled me for several hours:

    I have a UX with a List Control that displays columnar data for future training courses that are offered (here's what the List Control looks like List_Control1.jpg).

    In the "xbasic functions" section, I have written code to get the values of several fields (that are displayed on the UX) in a SQL "INSERT" command to update a table.

    Here's my problem: I can Dim an "e.datasubmitted" command to get the value of any control on the UX. BUT, when I do e.datasubmitted.courses ("courses" is the name of the List Control), it returns only data from the first column (Class ID) of highlighted row.

    I know I've done this before, but only the first column is returning a value. Here's what I've tried (NOTE: the numbers at the beginning are NOT in my code... I put them there, so that I can easily refer to them in this post):

    1. dim courses as c = e.dataSubmitted.Courses
    2. dim classID as c = word(courses,1,crlf())
    3. dim courseID as c = word(courses,2,crlf())
    4. dim className as c = word(courses,3,crlf())

    When the program is run, line 1 (above) returns only the data in the FIRST COLUMN; Line 2 correctly returns the data 1st Column of the highlighted row. I expected line 3 (above) to give me the 2nd column and line 4 to give me the 3rd column (courses,3?), but both return no data at all!

    I'm obviously using an incorrect syntax and I hope someone can show me how I can Dim the data of the specific columns in the highlighted row.

    Thanks so much!

    #2
    Re: Get column values from a UX List Control

    Try this...

    Code:
    dim listArray[0] as c
    listArray.initialize(e.dataSubmitted.COURSES)
    This will load the e.dataSubmitted.COURSES crlf delimited, currently selected row data, into an the listArray.

    Lots of ways you could process the crlf delimited List row data... this is just one way.

    Comment


      #3
      Re: Get column values from a UX List Control

      David-

      First of all, thanks so much for responding to my question... and for doing it so quickly. The Alpha community is so generous with their time and knowledge. I really appreciate your help.

      Anyway, I tried your solution, without success. I'm sure it's because of my inexperience programming with "array" data.

      I tried doing it several ways, but none of them returned data. Here are a couple of samples showing the syntax I used :
      dim listArray[0] as c
      listArray.initialize(e.dataSubmitted.COURSES)
      'dim courses as c = e.dataSubmitted.Courses
      dim classID as c = word(listarray[0],1,crlf())
      dim courseID as c = word(listarray[0],2,crlf())
      dim className as c = word(listarray[0],3,crlf())

      dim listArray[0] as c
      listArray.initialize(e.dataSubmitted.COURSES)
      'dim courses as c = e.dataSubmitted.Courses
      dim classID as c = word(listarray,1,crlf())
      dim courseID as c = word(listarray,2,crlf())
      dim className as c = word(listarray,3,crlf())

      dim listArray[1] as c
      listArray.initialize(e.dataSubmitted.COURSES)
      'dim courses as c = e.dataSubmitted.Courses
      dim classID as c = word(listarray[1],1,crlf())
      dim courseID as c = word(listarray[1],2,crlf())
      dim className as c = word(listarray[1],3,crlf())


      As I said, I'm sure the problem is that I don't know the correct syntax when referring to array data. Any additional help you can offer would be appreciated.

      Thanks again,
      Phil

      Comment


        #4
        Re: Get column values from a UX List Control

        Hey Phil, it's much, much simpler than what you have. As long as you've selected a row in your List... then you just need to access an array element after you've converted your crlf data into an array.

        The data is found in e.dataSubmitted.LISTCUST for my List named LISTCUST. The data is crlf delimited... so it looks like this in the debugger...

        Code:
        1
        Michaelx
        Graham
        Davids Company
        4294911516
        0
        0
        So... we use the Alpha method <array>.initialize() to feed the crlf data into an array.

        Once there we can access the elements of that array, for example, by number...

        Code:
        dim fname as c = listArray[2]
        dim lname as c = listArray[3]
        dim cname as c = listArray[4]
        You see how the array matches up with the original crlf data.

        Hope that helps.

        Comment


          #5
          Re: Get column values from a UX List Control

          I'm assuming this is happening on clicking the list.

          In the on click of the List, set the value of the fields you need into some textbox fields in your UX and pass those values to your SQL.


          for example 4 textbox fields in your UX as place holders.

          SQLcourses
          SQLclassID
          SQLcourseID
          SQLclassName

          then

          in the list onClick where Courses is the name of the list. Move the columns in the list to the placeholders.

          {dialog.Object}.setValueFrom('SQLcourses','LIST::Courses ::Courses');
          {dialog.Object}.setValueFrom('SQLclassID','LIST::Courses ::ClassID');
          {dialog.Object}.setValueFrom('SQLcourseID ','LIST::Courses ::CourseID');
          {dialog.Object}.setValueFrom('SQLclassName','LIST::Courses ::ClassName');


          then
          in your xbasic

          dim courses as c = e.dataSubmitted.SQLcourses
          dim classID as c = e.dataSubmitted.SQLclassID
          dim courseID as c = e.dataSubmitted.SQLcourseID
          dim className as c = e.dataSubmitted.SQLclassName


          Pete
          Insanity: doing the same thing over and over again and expecting different results.
          Albert Einstein, (attributed)
          US (German-born) physicist (1879 - 1955)

          Comment


            #6
            Re: Get column values from a UX List Control

            But Pete, if the data is already in e.dataSubmitted.LISTNAME, then why would you want to add however many additional textboxes just to get their values? You'd have to set up, maintain and render all those extra textboxes and then have Alpha process them, effectively duplicating data being sent to the server. I can't see any reason for this.

            Comment


              #7
              Re: Get column values from a UX List Control

              Agree, I just thought Phil may understand it easier, and its true IF these values already exist in the UX (like using a detail view) he need would only need.

              dim courses as c = e.dataSubmitted.courses
              dim classID as c = e.dataSubmitted.classID
              dim courseID as c = e.dataSubmitted.courseID
              dim className as c = e.dataSubmitted.className
              But he don't say exactly what is in the UX and what is not.

              Also David - do you have knowledge of UDP socket data streams into Alpha?
              Insanity: doing the same thing over and over again and expecting different results.
              Albert Einstein, (attributed)
              US (German-born) physicist (1879 - 1955)

              Comment


                #8
                Re: Get column values from a UX List Control

                I've looked at it using node.js

                Comment


                  #9
                  Re: Get column values from a UX List Control

                  David and Pete: THANK YOU so much. You gave me two excellent options. My list control didn't have a detail view and I was unable to get the "array" solution to work for me, so I used Pete's solution. I probably would have preferred not to add the extra "holding" fields, but I hid them, so it wasn't a big deal. The performance of the UX didn't appear to be impacted (this app isn't a mobile app... it'll be used exclusively with a PC web browser). My SQL INSERT command worked perfectly, as did the rest of the code.

                  I really appreciate all of your help!

                  Comment


                    #10
                    Re: Get column values from a UX List Control

                    Cool. Many ways to do things both valid in this case, Davids method is something you should investigate when you have time - just so you know you have another method to call on if needed, arrays are very efficient as David said.

                    As a note - you will see in Selwyns latest SQLLite Video for PhoneGap he is now using UX fields as Placeholders for SQL string to execute againt, interesting times.
                    Insanity: doing the same thing over and over again and expecting different results.
                    Albert Einstein, (attributed)
                    US (German-born) physicist (1879 - 1955)

                    Comment

                    Working...
                    X