Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Friday, December 05, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
Samples and other shared info.

Subject: Dependant Drop Down Boxes

You are not authorized to post a reply.   
Author Messages
pauldes
Immortal
Posts:1392

03/01/2008 9:58 AM Alert 
This sample uses SUBQUERY and select drop downs to create a dynamic dependent drop down based on the selection made in the first drop down. It works with the DNN users and roles information in your system. The lxFetch onchange event in the first select is what triggers a refresh in the module to display the filtered list in the second select.

Note: the queries in the subquery tag use aliases for the field names so that a potential conflict in field name duplication with the main listx query is avoided. You can also accomplish this with escaping, which I hate!

To use, copy, paste and load the text in the XML file attached into the XML section of your ListX View Options and LOAD.

Attachment: dependentdropdown.xml


ListX....makes you look brilliant, even though you're not.
cblake
Featherweight
Posts:10

03/01/2008 1:49 PM Alert 
Pauldes,

I've got another example here for dependent dropdowns. I'm hoping you can take a peek at it. I render the second subquery in an action variable based upon the selection in the first subquery. It seems like it is going to work for me, but for some reason the lxComboSelect does not seem to work for the subquery that gets rendered in the action variable. When the page is refreshed, I'd like to retain the values that have been selected in the dropdowns so I've assigned their respective values into session variables and use the session variable values for the lxComboSelect function.

Any help you can offer is appreciated.

Thanks, Chris

Attachment: config.xml

pauldes
Immortal
Posts:1392

03/01/2008 4:55 PM Alert 
I don't use lxComboSelect, but if you want to retain values and have them as defaults for combo boxes in selected items, use COALESCE...
selecteditems="[COALESCE,MySVar,Session,MyFVar,Form,[myfieldvalue],,MyText,Text]"
This will display the first of the items in the statement that has a value.

ListX....makes you look brilliant, even though you're not.
cblake
Featherweight
Posts:10

03/01/2008 5:06 PM Alert 
Thanks man,

I have not played with coalesce yet, but it looks like I am going to! Very much appreciate the pointer.

Regards, Chris
robert_chumley
Please Wait...
Posts:595

03/03/2008 8:37 AM Alert 
Please let us know if this solves the problem.
Thanks,

Robert Chumley
r2integrated (formally bi4ce)
penra
Posts:15

05/20/2008 5:37 PM Alert 
This works great. In my case my initial table has multiples (the table is the state the customer resides in). The dropdown shows all of the multiples, how can I filter that?
pauldes
Immortal
Posts:1392

05/20/2008 7:38 PM Alert 
are you saying you want the drop down list to only display certain values or that you want the drop down list to have a default value based on the user. What exactly does each drop down list show?

ListX....makes you look brilliant, even though you're not.
penra
Posts:15

05/21/2008 10:10 AM Alert 
Sorry I was not clear.
The first dropdown box is the state, I have multiple rows for many states and all of the rows are showing in the dropdown list.
I want to filter so each state only shows once.
thank you!
penra
Posts:15

05/21/2008 10:12 AM Alert 
For example;
AK
AK
AK
AL
AL
AL
AL ....ETC
svedire
Cruiserweight
Posts:107

05/21/2008 10:17 AM Alert 
Hi,

Try doing a SELECT DISTINCT in your SUBQUERY. This will return all the distinct values.

Thanks,
Sindura
R2integrated
penra
Posts:15

05/21/2008 2:13 PM Alert 
Thanks that did it!
You are not authorized to post a reply.



ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation