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

Cascading Dropdown Boxes

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

    Cascading Dropdown Boxes

    Hello,

    I've gone through the forum postings to see if I can find an answer but no luck so here goes.

    I saw in one of the video tutorials (video #18) how cascading dropdown boxes could be used to filter results, BUT this example was based on a dbf.

    Can anyone point me in the direction or show me how the same could be done with a mysql db? I cannot get this to work and have been struggling with this for days now. It SHOULD be something very simple but I cannot get it to work.

    I have a state and county table (see attached pic). I have a grid that has two DDB's - one for state and one for county. I set the state DDB to pull from the state table the Sate name and store the idstate value. Then I setup the second DDB to pull county name from the county table where idstate matches the state DDB.

    When I test it out I get nothing. I've tried everything and cant figure it out. Can anyone PLEASE point me in the right direction?

    Thanks!!!!

    #2
    Re: Cascading Dropdown Boxes

    Jose,

    I got it to work by making one table with both country and state fields, that is
    Country State
    USA Kansas
    USA Oklahoma
    Canada Alberta

    and so on.

    Otherwise, how would Alpha know what state goes with what country?

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      Re: Cascading Dropdown Boxes

      Originally posted by Pat Bremkamp View Post
      Jose,

      I got it to work by making one table with both country and state fields, that is
      Country State
      USA Kansas
      USA Oklahoma
      Canada Alberta

      and so on.

      Otherwise, how would Alpha know what state goes with what country?

      Pat
      Pat,

      Thanks for responding.

      The State -> Country problem I gave was just an example of what I am trying to accomplish with cascading dropdown boxes. The problem with your solution is that your tables would not be properly normalized (you have USA, Canada, etc... showing up in more than one row).

      I can do this all day long in Access with two tables joined by a primary key-foreign key relationship. That is how Alpha should know what state belongs to what country.

      When I select, say the United States, I should only see states that belong to the United States on the second dropdown box because Alpha should filter the state table with only those records that match the country primary key.

      Does this make more sense? Again, I am NOT using the DBF database that ships with Alpha. I'm using a MYSQL database.

      Alpha 5 developers, since you guys did a video example of cascading dropdown boxes with a DBF database could PLEASE do one with MYSQL??? I think this would be of help to several other folks who are not using DBF.

      Thanks!

      Comment


        #4
        Re: Cascading Dropdown Boxes

        I am doing it using MySQL just as I described.

        If you want to use two tables instead of just one, just take your tables and create a read-only view, then base both dropdowns on that view. To Alpha, that looks like a single table with both country and state in it. It works, and as usual, Alpha takes most of the work out of it and does it behind the scenes.

        Pat
        Pat Bremkamp
        MindKicks Consulting

        Comment


          #5
          Re: Cascading Dropdown Boxes

          Thanks makes sense! I'll try that.

          Thanks Pat!

          Comment


            #6
            Re: Cascading Dropdown Boxes

            Hi Jose,

            I was able to get it working with a mysql database and two different tables.

            In my case table one has a list of customers. Table two has a list of customer properties (i.e houses, vacation homes etc.). A customer can have multiple properties. When the user has selected a customer in the first drop down box, they should only see the properties associated with that customer in the second drop down box. I also show the description but store the ID field...

            When I look at my tables setup (image attached) I think that might have something to do with why mine is working and yours is not.

            The customer_ID field is part of the primary key of the customer table (Table 1) and is also part of the primary key of the property table. Moreover, its a foreign key in the properties table back to the customer table. So I think that's how alpha is able to make the cascade work. The other thing is the Customer ID in the property table has the exact same name as in the customer table (i.e. customer_ID) Even if you setup the customer ID in the property table as a foreign key of the customer table, if they don't have the same name I don't think Alpha makes the connection!

            Looking at your tables I would suggest trying two things...

            1) In the county table, change the State_idState to be just idState so it matches what's in the state table. See if that works I think it might....

            2) If that doesn't work try putting idState as part of the key of the county table

            Good luck!

            Scott

            Comment


              #7
              Re: Cascading Dropdown Boxes

              Hello
              I have same question. I have posted same in the new developers forum. I would like to create a cascading lookup using a view not a table. Is it possible.

              Thanks.
              edit:
              I am attaching the test file.( I know this forum is for version10. My question states version 9)
              Last edited by GGandhi; 11-14-2010, 07:47 AM. Reason: attaching file
              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


                #8
                Re: Cascading Dropdown Boxes

                sorry, the attached file did not show up.. another attempt:
                looks like I can not upload in another forum one having uploaded to one forum. Any way the zipfile is in New developer forum under "Can I do something like this"

                Thanks in advance.
                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


                  #9
                  Re: Cascading Dropdown Boxes

                  How would we take this to the third level? For instance: I am using school terms.

                  TABLE
                  -------
                  SUBJECT GRADE CATEGORY
                  math, 3, adding fractions
                  math, 4, multiplying fractions
                  english, 3, reading
                  english, 4, writing
                  science, 3, earth
                  science, 4, biology



                  My user chooses a from a table: (math,english,science).
                  Then they choose a grade level: (3,4,)
                  Then a category: (fractions, reading, writing, earth, etc)

                  So my user chooses Math first. His next options should be grades: 3 or 4 so he chooses 4. One this last level I only want them to see 4th grade math categories but they see all of the 4 grade categories (in this case they would see biology, writing, and multiplying fractions.

                  I am thinking that I besides setting GRADE as the parent on the cascading options I also have to filter by the first dropdown choice.

                  Is that correct thinking?

                  In order to do that I would have to set a variable when they choose the first option. Then filter by that variable and choose the parent field for the third option.

                  ?? Any other ideas ?? Am I way off here? Over-complicating it?
                  Thanks,

                  Roderick Silva
                  [email protected]

                  About Me: rodericksilva.com
                  Twitter: rodericksilva

                  Comment


                    #10
                    Re: Cascading Dropdown Boxes

                    I thought this was the answer but it doesn't look like it: http://msgboard.alphasoftware.com/al...ading+dropdown
                    Thanks,

                    Roderick Silva
                    [email protected]

                    About Me: rodericksilva.com
                    Twitter: rodericksilva

                    Comment


                      #11
                      Re: Cascading Dropdown Boxes

                      It's in some other forum posts as well, but if you go the route of a textbox with an edit-combo lookup with dynamic filters rather than cascading dropdowns, it's pretty straightforward to do this. There may be reasons you prefer the dropdown, though...

                      Comment


                        #12
                        Re: Cascading Dropdown Boxes

                        Thanks. I'm going to play around with that this week and post some details here once I get it working.
                        Thanks,

                        Roderick Silva
                        [email protected]

                        About Me: rodericksilva.com
                        Twitter: rodericksilva

                        Comment


                          #13
                          Re: Cascading Dropdown Boxes

                          Thank you christappan, that worked.

                          To summarize other postings: it sounds like the "cascading choices" feature of DropDownBox does not work if you choose to "store a value other than the display value." So use a TextBox instead of a DropDownBox; mark the checkbox for "Lookup" then set its "Lookup Type" to "Edit-Combo List" then in "Lookup Definition" you can set up a "Dynamic Filter" that links a field in the lookup table to the field in the record that you are editing (the field that you want to control the cascade).

                          Thanks to eskimoavenue for this post which suggests watching video number 75 here:

                          http://news.alphasoftware.com/v10preview/videos.htm

                          That video describes a technique that (1) includes the lookup table itself in the query for the whole grid, (2) uses the "Fill-In fields" property within the "Lookup Definition" to go store the selected value into the correct field in the main table, and (3) sets the "Table Alias" to "*unbound" under the "Update Settings" to avoid writing to the lookup table.

                          Comment

                          Working...
                          X