Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Request - Sample SQL for cascading dropdown (dependent combo box)
Last Post 08-20-2013 07:46 AM by Ryan Bakerink. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
robax robaxUser is Offline
river guide
river guide
Posts:101
Avatar

--
10-21-2012 07:28 PM

    Hi there

    I've been busy trying to set up an example of a cascading dropdown (dependent combo box), but I'm no SQL expert and am struggling converting form Demo 11 into something that actually works.

    The problem with Demo 11 is that the tables that are referenced are not visible so I can't see what's really going on.

    What I want is just get the working SQL queries using the default DNN Country and Region lists as an example. i.e. Select USA off the country dropdown and have it populate the second dropdown with the regions (states)

    I can make the first box work using the following:

    Select '' as QuestionOption, '-1' as QuestionOptionValue
    Union All
    SELECT Text As QuestionOption, Text As QuestionOptionValue
    FROM Lists where ListName= 'Country'
    ORDER BY QuestionOption ASC
    Select '

    robax robaxUser is Offline
    river guide
    river guide
    Posts:101
    Avatar

    --
    10-21-2012 07:33 PM
    ok the forum messed up the post above.

    The post contains a revision of the sample code from Demo 11 that gives me the Countries as the first dropdown. Then I say thanks for any assistance etc.
    Regards
    Rob
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    10-22-2012 07:07 AM
    Hello Rob,

    The most important part to consider when configuring dependent combo boxes in Dynamic Forms is:

    * Do you have a Postback occurring after selecting a value from a dependent combo box? If you don't, then the SQL Query that you have setup won't be able to render the Dependent query correctly.

    Let's say that you have 2 combo boxes:

    * Software
    * Products

    Software is a pulling from a table named "Software", query may look like this:

    Select SoftwareName As QuestionOption, SoftwareID As QuestionOptionValue from Software order by Name

    Obviously we can tell that Software Combo box is the parent(or top level dependent combo box).



    Products is a pulling from a table named "SoftwareProducts", query may look like this:

    Select ProductName As QuestionOption, ProductID As QuestionOptionValue from SoftwareProducts where SoftwareID = '$(Software)'

    Now you can see that the Product combo box is dependent on the Software Combo box Selection. The following "where SoftwareID = '$(Software)'" is what creates the SQL Dependency. $(Software) is referencing the Selected value from the Software combo box. $(Software) is a token tied to the Software combo box selected value, keep in mind that we're stating that Software is the Shortfield name of the Software Combo Box.

    You need to Create a Question event that executes anytime a selection is made from the Software combo box. You don't need to check certain fields that the Question Event affects. The idea is to use the Question Event to access a Postback.

    You'll then see, after the PostBack processes, the Product combo box will pull in the correct Dynamic information based on the Software you selected.

    Please let me know if you have any questions.

    Thanks,

    Ryan



    NickUser is Offline
    new to the springs
    new to the springs
    Posts:2
    Avatar

    --
    07-16-2013 10:22 AM
    Ryan - reading over this string - how do you "Create a Question" event - I am running into the same exact problem. I work in a hospital system with several locations - each location has a different set of units. SO in the form, I want them to select the hospital, and then based on their selection, have a list of units for their hospital selection pop up. Help!
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    07-19-2013 07:05 AM
    Hello Nick,

    I would recommend looking into Demonstration 11 on our site to learn how to configure Dependent Drop Down Lists:
    www.datasprings.com/formdemos

    Please let me know if you have any questions on this process after thoroughly revising this demonstration.

    Thanks,

    Ryan
    NickUser is Offline
    new to the springs
    new to the springs
    Posts:2
    Avatar

    --
    08-20-2013 03:37 AM
    Ryan - more specifically the problem I am having is that when they select the hospital, no matter what the selection, it populates a field named Hospital_Name in the SQL database, and this is the field name in the DNN form as well. For the units in each hospital, it needs to populate a field named Hospital_Unit_Name. However, as I have created dynamic dropdowns for each hospital's set of units, I am unable to give them all the same field name (Hospital_Unit_Name). It does not let me duplicate the field name for each instance. Is there a solution where I can just create two questions that work dynamically, as opposed to creating the initial Hospital question selection, and then a separate question for each hospital's units (using field rules to initiate which list of unit's populates)? Make sense? Thanks - Nick
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-20-2013 07:46 AM
    Hello Nick,

    Unfortunately, this doesn't make sense to me.

    So you have 2 Combo Boxes?

    1.) Hospital Names
    2.) Hospital Unit Names

    Are Hospital Unit Names dependent on the selection of the Hospital Name Combo box? How many fields are involved?

    If this is the case our Demonstration 11 covers how to piece this logic together, also above in this forum thread I have provided intricate details on how to configure a combo box that's dependent on another combo box.


    Can you please elaborate on this:

    "It does not let me duplicate the field name for each instance"

    Are you referring to a ShortFieldName for your Dynamic Form Question? Are you referring to Question Event conditional field for execution?

    Please let me know.

    Thanks,

    Ryan
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
     
     
       
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi