tags:

views:

12

answers:

0

Greetings,
I have 2 filteringSelects. I would like to default the 1st one to a value and have the 2nd filteringSelect use values from the selectedItem in the 1st select.

My 1st filteringselect (SeasonSelect) loads fine and is set to the default as I would like. However, the second filtering select (SeqNoSelect) is not getting the values from the 1st select as need. Apparently, the 1st object's value is not set until after the 2nd filteringselect itemfilereadstore is already loaded. This results in a blank value being sent in my url.

I can get this to work fine if I use onChange events; however, we want to default the initial value of the 1st select as opposed to the user having to select it. NOTE: This code is encapsulated in a dojo.addOnLoad();

    var defVal = dojo.byId("SelectedSeason").value;
    var filteringSelect = new dijit.form.FilteringSelect(
        {
            id: "SeasonSelect",
            name: "Name",
            value: defVal,
            style: "width: 75px; font-size: 8pt;",
            searchAttr: "Name",
            store: new dojo.data.ItemFileReadStore({
                url: SEASON_URL,
                clearOnClose: true,
                urlPreventCache: true
            })
        },
        "SeasonSelect"
    );

    var filteringSelect = new dijit.form.FilteringSelect(
        {
            id: "SeqNoSelect",
            name: "Name",
            value: "-1",
            style: "width: 75px; font-size: 8pt;",
            searchAttr: "Name",
            //seasonkey, userdefine1, deptNo
            store: new dojo.data.ItemFileReadStore({
                url: SEQNO_URL
                    + "/" + dijit.byId('SeasonSelect').attr('value')
                    + "/" + dijit.byId('SeasonSelect').attr('displayedValue')
                    + "/" + document.forms[0].elements['DeptNoText'].value,
                clearOnClose: true,
                urlPreventCache: true
            })
        },
        "SeqNoSelect"
    );

Thanks.