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

Assigning the Values to the dropdown list using Xbasic cde.

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

    Assigning the Values to the dropdown list using Xbasic cde.

    Hi All,

    Here I have two drop down lists.If I select one value from first drop down list then the corresponding value(which is from database) should assign to the second drop down list.

    I am unable to assign values (those are getting from database) to the drop down list using xbasic coding .Can you please help me out.

    Dropdown_Auto_Assigning.jpg

    #2
    Re: Assigning the Values to the dropdown list using Xbasic cde.

    Best to post in the forum for the version you are using 10 or 11 or 12? Also best to attach a sample of your database rather than a picture.
    There can be only one.

    Comment


      #3
      Re: Assigning the Values to the dropdown list using Xbasic cde.

      Originally posted by Parveen View Post
      Hi All,

      Here I have two drop down lists.If I select one value from first drop down list then the corresponding value(which is from database) should assign to the second drop down list.

      I am unable to assign values (those are getting from database) to the drop down list using xbasic coding .Can you please help me out.

      [ATTACH=CONFIG]38234[/ATTACH]
      What are you doing to populate the dropdowns? Are you using an action javascript? Or have you written your own xbasic? Please post what you have.
      Alpha Anywhere latest pre-release

      Comment


        #4
        Re: Assigning the Values to the dropdown list using Xbasic cde.

        Originally posted by TheSmitchell View Post
        What are you doing to populate the dropdowns? Are you using an action javascript? Or have you written your own xbasic? Please post what you have.

        Thank you for your reply.I am using v11 and I wrote own xbasic code in in dropdown list onselect event.

        Here I am getting below three values from database.

        DCN
        Java
        Android
        How to assign these three values to the dropdown list using xbasic code.Please let me know..

        Comment


          #5
          Re: Assigning the Values to the dropdown list using Xbasic cde.

          Well, to start with, I don't think there is an onSelect event for dropdown boxes. Not all fields have all events --- but Alpha's interface lists all of them, even when they're not applicable. Dropdowns do have an onChange event. And that sounds a little more like when you'd want to execute your script anyway - when the selected value for your list changes. So, start by moving your code from onSelect to the onChange event for your dropdown.

          After that, if you're still having problems...........

          If you're using cascading dropdowns - the value in the first dictates the value in the second - then you should look at using the Cascading Choices properties in the dropdown choices definition dialog:
          cascadingChoices.png

          You can also use {grid.object}.populateDropdownBox (or {dialog.object}.populateDropdownBox) to update dropdown boxes. These are javascript methods. You can return javascript to execute from any ajaxCallback and some of the server-side events (read the comments in each to figure out how to return the javascript--if it doesn't mention anything about returning javascript, then you can't do it in that particular event.)
          Code:
          'dim choices_arr as c =<<%s%
          ''Apple'
          ''Banana'
          ''Pear'
          ''Strawberry'
          '%s%
          
          
          'Format for storing a value seaprate from displayed value
          'Note: you are building a JavaScript array for use in populateDropdownBox
          'This is just an example of the format you need to create.
          dim choices_arr as c=<<%s%
          ['Apple',1]
          ['Banana',2]
          ['Pear',3]
          ['Strawberry',4]
          %s%
          
          'replaces all the crlf() with commas. Results:
          'For array with no stored value: 'Apple','Banana','Pear','Strawberry'
          'For array with stored value: ['Apple',1],['Banana',2],['Pear',3],['Strawberry',4]
          choices_arr = crlf_to_comma(choices_arr)
          
          dim js as c = ""
          ' Need to enclose choices_arr inside "[" and "]" --- this makes it into a JavaScript array
          *concat(js,"var choices = [" + choices_arr + "];" + crlf())
          *concat(js,"var replaceExistingChoices = true;" + crlf())
          *concat(js,"var rowNum = " + e._currentRow + ";" + crlf())
          *concat(js,"{grid.object}.populateDropdownBox('G','MY_DROPDOWN',rowNum,choices,replaceExistingChoices);" + crlf())
          To return the javascript, you'll just pass it into the function name. If you're using the xbasic code in the event, then you should see something like this:
          Code:
          serverside_370caba45542432993750ccb017321f6 = "//Replace this with the javascript to be returned by the function."
          Replace the stuff after the = with js:
          Code:
          serverside_370caba45542432993750ccb017321f6 = js

          Make sure your strings are properly escaped. If you can have things like apostrophes, quotes, backslashes "\", and other special characters in your string, use js_escape so the text is properly escaped to be included in your JavaScript array. Eg:
          Code:
          *concat(choices_arr, js_escape("Hors d'oeuvre") + crlf() )
          All code above is wildly untested and probably contains errors. But you get the idea.
          ---
          Sarah
          Alpha Anywhere latest pre-release

          Comment


            #6
            Re: Assigning the Values to the dropdown list using Xbasic cde.

            Originally posted by TheSmitchell View Post
            Not all fields have all events --- but Alpha's interface lists all of them, even when they're not applicable.
            Whoa! That's kind of unsettling. Is there a way to double check if an event is actually applicable to the control, before writing code into a particular event and expecting it to run?

            I suppose good old alert boxes are the first way to test if an event actually triggers or not...

            Comment


              #7
              Re: Assigning the Values to the dropdown list using Xbasic cde.

              Originally posted by mixter View Post
              Whoa! That's kind of unsettling. Is there a way to double check if an event is actually applicable to the control, before writing code into a particular event and expecting it to run?

              I suppose good old alert boxes are the first way to test if an event actually triggers or not...
              You answered your own question. ;)

              Code:
              alert('Event!');
              Alpha Anywhere latest pre-release

              Comment


                #8
                Re: Assigning the Values to the dropdown list using Xbasic cde.

                Originally posted by mixter View Post
                Whoa! That's kind of unsettling. Is there a way to double check if an event is actually applicable to the control, before writing code into a particular event and expecting it to run?

                I suppose good old alert boxes are the first way to test if an event actually triggers or not...
                I don't really consider this that unsettling. The event in question, onSelect, is only triggered when some text is selected. It usually only applies to textareas and textboxes. Alpha's interface is consistently generic (with the exception of sliders and a few other things.) The help for the event states clearly that not all elements support the event:

                onSelecthelp.png

                And you can create your own custom events, listeners, and handlers that are called anything, really. EG, http://www.kaizou.org/2010/03/genera...script-events/

                Yarp.

                EDIT (More Thoughts):

                I think maybe another issue here is that the event names can be misunderstood to mean something they don't. onSelect is easily misunderstood to mean "selecting the control", but that event is actually onFocus. Similarly, onSelect could be construed to mean "selecting an option", but that action can be defined or handled by any number of other events, including onChange (value was changed), onClick (mouse was clicked on control), onMouseUp (mouse button released over control), onMouseDown (mouse button depressed over contorl), and possibly onBlur (focus on the control has gone away) or onDoubleClick (double-clicked the mouse on the control).

                But event names are dictated by web standards, not Alpha.
                Last edited by TheSmitchell; 05-29-2014, 04:03 PM.
                Alpha Anywhere latest pre-release

                Comment


                  #9
                  Re: Assigning the Values to the dropdown list using Xbasic cde.

                  I don't really consider this that unsettling.....The help for the event states clearly that not all elements support the event:
                  understandable when they say it out loud but.
                  say if you change a control from text box to dropdown, then the options change and new choice is added where you can declare how the dropdown will be populated.
                  same goes for radio buttons and checkbox controls. so they are programmatically changing the options available based on some selection, correct.
                  my feeling is the same as Michael's. why not list only those available for that control? instead of spending sometime to investigate if that function is available then clean the slate and start all over to write the real business function.
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment

                  Working...
                  X