Allright, I was working with dojo in the past few months ago and looking back to the source code I think I should at least blog something about it just to remind me about what I have done for the previous project. Today, I am going to blog about how to retrieve data from the database and display in the "Dojo Filtering Select." and this is how it works. For me, I am using JSP, JAVA,DWR and javascripts as my development framework. First of all you may need to understand how to install the "Dojo Toolkit" and DWR in your machine. I am not going for detail on this and you may want to refer to the link for details: http://tinyurl.com/ndenr2 and http://tinyurl.com/6ouod9.
The following is the example of jsp page that show the filtering select in the page:

The piece of code is placed at a jsp file called "menu.jsp" and as you can see from the above code, there is a parameter called "id" and that is what it is gonna use to assign all your data that will retrieve from the database. Don't forget to import the javascript to the main jsp file. For example, I will call my javascripts as the filteringSelectLoad.js and this is how I import to the main jsp page:

The following is the javascripts that did the job or passing and getting data from the back end.

Well, as you can see from the code for MenuManager.getMenu(menu, populateMenu), the MenuManager is where you got to declare @ the dwr.xml. Once you got retrieve the data with dwr and pass back to the front end. Basically, that is all did the job of retrieving and display data in the filtering select. If you wish to know how to retrive data with dwr, you may want to check out :http://tinyurl.com/n9ezrb
Hope this help!
-Kay Nny-
I found a function which able to check all checkbox with DOJO Checkbox. Here is the following:
function checkAll(a,b){
var bChecked = false;
eval("dml = document.frTAMain");
var len = dml.elements.length;
for(var i=0 ; i<;i++){
if (dml.elements[i].type == "checkbox") {
for ( m=0; m <a.length;m++){
var id = (m+1);
if ((dml.elements[i].name == "selectAll") && (dml.elements[i].checked==true)) {
dijit.byId("comp"+id).setValue(true);
bChecked.setValue = true;
}
if ((dml.elements[i].name == "selectAll") && (dml.elements[i].checked==false)) {
dijit.byId("comp"+id).setValue(false);
bChecked.setValue = false;
}
}
}
}
}
At first I thought of putting in the function of click() which is the DOM function, however after the further studies on DOJO, dijit has their own method to check all which is dijit.byId().setValue (true/false).
Last weekend, I finally being able to pass value to DWR and DWR to Spring to the database and passing back to DWR to the javascripts. And now, it's time to learn how to display the value in the dijit.form.FilteringSelect with dwr values.
Wish me luck!
-Kay Nny