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

BUG(?) populating a custom list from Xbasic with just one field

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

    BUG(?) populating a custom list from Xbasic with just one field

    What I'm trying to do is populate a list control with the file names of all files that match a specific key in the UX component. The problem I've discovered is that any attempt at using an Xbasic function that returns a comma-delimited crlf list with only one field causes the list builder to crash when moving to the Fields tab with a message "missing right parenthesis". I believe this is a bug and I've reported it to Alpha along with the test file attached. Ultimately my goal is to include all the photos from a directory in a list that have filenames that start with the key in the UX component. Some records may have one picture while others could have ten. I know I can use a linked grid for this and I've accomplished that already but I really want to move most things to UX components where possible in order to take advantage of their flexibility.

    In the attached file if you open the ListTest component and then select List1, go to properties and change the source to Custom, set the xbasic function to myXBfunction and then click Fields you'll see the fields defined in that function. Now if you go back and change the function to myfiles and click fields you'll get the error message. I've also modified the myXBfunction to remove all except the lastname field and then tried this again and you get the error message since it is only one field.
    Attached Files
    Last edited by compuaid; 07-13-2013, 04:51 PM. Reason: Include attachment
    Brad Weaver, President
    ComputerAid International
    Ottawa ON Canada
    Versailles KY USA
    www.compuaid.com

    #2
    Re: BUG(?) populating a custom list from Xbasic with just one field

    Until you hear back from Alpha try faking it out by adding a dummy field.

    I have to say I did have trouble getting this to work... the List control fieldlist wouldn't display anything... but eventually just got it working... not sure why it wasn't.

    I changed the myfiles xbasic function code to:

    Code:
    function myfiles as c (e as p)
    ' If you set the list to custom and specify myfiles as the function
    ' the list builder fails when you attempt to move to the list fields
    ' tab with a message "Missing right paranthesis"
    'debug(1)
    dim values as c
    dim newvalues as c
    values = filefind.get("*.*",FILE_FIND_NORMAL,"PN")
    newvalues = *for_each(currFile, currFile + "|xxx",values)
    myfiles = "Filenames=C|DummyField=C" + crlf() + newvalues
    
    
    end function
    Attached Files

    Comment


      #3
      Re: BUG(?) populating a custom list from Xbasic with just one field

      Thanks so much David and I hope the you survived the flooding okay last week. I'll throw this into my production beta and see how it goes.
      Brad Weaver, President
      ComputerAid International
      Ottawa ON Canada
      Versailles KY USA
      www.compuaid.com

      Comment


        #4
        Re: BUG(?) populating a custom list from Xbasic with just one field

        No flooding here in Markham. The rains a few weeks ago were much worse here and most of the local ponds flooded the trails... but nothing downtown. Weather is so odd this year... great summer though.

        Comment


          #5
          Re: BUG(?) populating a custom list from Xbasic with just one field

          This is fixed in the latest prerelease and should be in the next full release patch. Thanks Selwyn!
          Last edited by compuaid; 07-18-2013, 10:34 PM. Reason: Typo
          Brad Weaver, President
          ComputerAid International
          Ottawa ON Canada
          Versailles KY USA
          www.compuaid.com

          Comment


            #6
            Re: BUG(?) populating a custom list from Xbasic with just one field

            The code works - thanks for sharing!
            I need to show a file list based on the value in a textbox that has the folder name.
            Has anyone tackled this and got a solution?
            A video from Selwyn (hint, hint) demonstrating how would, I am sure, be welcomed by many.

            Comment


              #7
              Re: BUG(?) populating a custom list from Xbasic with just one field

              Garry,

              Here's a project that contains a UX control that does what you want. The key to the control is in the custom xbasic function embedded in the list source.

              The function is defined as:
              Code:
              function getfiles as C (e as p)
              	dim directorypath as c
              	dim filelist as c
              	
              	' If there's a value in the file_directory text box retrieve the file list
              	if eval_valid("e.datasubmitted.file_directory") 
              		directorypath = alltrim(e.datasubmitted.file_directory)
              		' Append \*.* to directory name
              		directorypath = directorypath + chr(92)+"*.*" 
              		filelist = filefind.get(directorypath,FILE_FIND_NORMAL,"N")
              	else
              		'otherwise just set the list to blank
              		filelist = ""
              	end if
              	getfiles = "Filenames=C"+crlf()+filelist
              end function
              This works in the latest pre-release version of Alpha Anywhere. If you are using the original production version then you'll have to use the work-around for the single field issue above in addition to the function I've provided so that Alpha thinks there are two fields in the list.
              Attached Files
              Last edited by compuaid; 08-08-2013, 08:33 AM.
              Brad Weaver, President
              ComputerAid International
              Ottawa ON Canada
              Versailles KY USA
              www.compuaid.com

              Comment


                #8
                Re: BUG(?) populating a custom list from Xbasic with just one field

                Brad,
                In my case I am opening the UX from a grid for editing and so datasubmitted is empty when getfiles is executed.
                To overcome this problem I populate a session variable in the grid and use it in the UX when populating the custom list and this works
                The bit I have not yet figured out is how to refresh the list when the value in file_directory changes.

                Comment


                  #9
                  Re: BUG(?) populating a custom list from Xbasic with just one field

                  Given that I want to open the selected file in the list control, what is the syntax to refer to the "Return field" when the list control is unbound as it is not then in e.datasubmitted?

                  Comment


                    #10
                    Re: BUG(?) populating a custom list from Xbasic with just one field

                    In the list properties I'd use the OnSelected event to get the value of the selected file and assign it to another field on your UX component or to save it to a session variable. I've attached a couple of screen shots of the changes I made that work to assign the selected file to an unbound text box on my UX control called Selected.

                    ListProperties.JPGOnSelect_Javascript.JPGDemo.JPG
                    Brad Weaver, President
                    ComputerAid International
                    Ottawa ON Canada
                    Versailles KY USA
                    www.compuaid.com

                    Comment


                      #11
                      Re: BUG(?) populating a custom list from Xbasic with just one field

                      Brad, thank you for the assistance. I will investigate further and think with your information and some other videos I came across that I can program the required functionality.

                      Comment

                      Working...
                      X