R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Dependant Drop Down Boxes
Last Post 01 Jan 1900 05:00 AM by . 10 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
01 Mar 2008 02:58 PM  
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.
cblakeUser is Offline
New Member
New Member
Posts:10

--
01 Mar 2008 06:49 PM  
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

pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
01 Mar 2008 09:55 PM  
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.
cblakeUser is Offline
New Member
New Member
Posts:10

--
01 Mar 2008 10:06 PM  
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_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
03 Mar 2008 01:37 PM  
Please let us know if this solves the problem.
Thanks,


Robert Chumley<br>r2integrated (formally bi4ce)
penraUser is Offline
New Member
New Member
Posts:15

--
20 May 2008 10:37 PM  
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?


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
21 May 2008 12:38 AM  
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.
penraUser is Offline
New Member
New Member
Posts:15

--
21 May 2008 03:10 PM  
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!


penraUser is Offline
New Member
New Member
Posts:15

--
21 May 2008 03:12 PM  
For example;
AK
AK
AK
AL
AL
AL
AL ....ETC


svedireUser is Offline
Basic Member
Basic Member
Posts:128

--
21 May 2008 03:17 PM  
Hi,

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

Thanks,
Sindura
R2integrated


penraUser is Offline
New Member
New Member
Posts:15

--
21 May 2008 07:13 PM  
Thanks that did it!


You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share