Wednesday, 6 August 2008

Multiple Cascading Select Lists (again)

This is an issue for many developers. I see a lot of questions and receive a lot of mails on this topic. I thought that demonstrating how to do that with two items would be enough to guess how to do it with more than that, since the approach is the same. However, there is nothing better than a step by step guide to get it working.

You will find the extended example here:

My advice, from what I have seen so far debuging the other people examples, is to:

1. be carefull with copy-paste and before you do it, think of replacing the given item , table and procedure names with your own,

2. test your on-demand processes in the SQL workshop first, to see if they run,

3. avoid multiplying your code through copy-paste. This makes it much easier to debug and

4. if you have no experience with a similar solution, try to reduce your scope and do it on a simple example first. Try using emp, dept tables like I do it in my Demo Application.



Unknown said...

Great post! Thanks for the tips regarding setting up and implementing this!

Unknown said...

Quick follow-up. How do you apply this to checkboxes? I went through the example (which worked perfectly by the way), and tried to change up some stuff to get it to work with a checkbox item, but it's only updating the selectlists and not the checkbox item.

Anonymous said...

hi i cannot do it for mine. Itdoes not populate the 2nd list

Denes Kubicek said...

In this blog, I also mention the tipps on how to debug the processes. I can't do anything if you just give me "it doesn't work".


archimede said...

Thanks for this post, very useful!

Works a treat in Firefox, but I have problems with IE7 (and 8 too, I think - the error I get is "Object needed" or something like that): does it work for you or should the Javascript code be tweaked somehow? I'm really not an expert in this kind of things...


Denes Kubicek said...

I just tested it and it works in IE8 as expected. Do you have problems with my example or with your own?

Denes Kubicek

archimede said...

Hi and thanks for your reply.

I had problems with my code (it's not easy for me to test IE because I'm on Linux ;) ).

Anyway, I think I found the culprit: it turned out that IE7/8 throws that error if the Application Processes return a blank option (had to add some additional spaces otherwise my html code wouldn't be accepted, sorry):

< option value=" " > < /option >

Replacing that with

< option value="-" >- < /option >

seems to fix the issue. Whew!

Thanks for your support.