This is a migrated thread and some comments may be shown as answers.

Client-side findItemByValue(id) not working with in-page RadWindow?

1 Answer 134 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 21 Aug 2011, 10:09 AM
Hi there,

I have an issue with selecting an item within a RadComboBox using the client-side method findItemByValue.

The RadComboBox is contained within the ContentTemplate of a RadWindow (in a RadWindowManager), and contains a list of guid / text items, i.e. all content and controls are located in one page.

When the user clicks a "Select Page" RadButton, the window is displayed and what I am trying to get is the currently selected item for the control to be selected when the window opens.

My client-side code is as follows:

function OpenPageSelectWindow(idControl, textControl, id) {
    document.getElementById('<%= uxPageSelectorIDControl.ClientID %>').value = idControl;
    document.getElementById('<%= uxPageSelectorTextControl.ClientID %>').value = textControl;
    var rwManager = $find("<%= uxRwmAP.ClientID %>");
    var radCombo = $find('<%= uxPagesDdl.ClientID %>');
    radCombo.trackChanges();
    var item = radCombo.findItemByValue(id);
    if (item) {
        item.select();
    }
    radCombo.updateClientState();
    radCombo.commitChanges()
    rwManager.open(null, "uxPageSelector");
    return false;
}

(The document.getElementById calls are for hidden fields).

As it stands, the code above does not select the item in the RadComboBox, i.e. item is null. I know there are items in the RadComboBox as call to get_Items() returns 105 objects.

Any suggestions? I'm on a bit of tight deadline on this one :-s

Thank you,

Mike Kingscott

1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 22 Aug 2011, 01:30 PM
Nope, it was me being a dumb-ass, hate it when that happens.
Tags
ComboBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Share this question
or