Skip to Content
Former Member
Jun 28, 2007 at 03:00 PM

DropdownListBox getSelection returns null


Hi all,

I've come up against the following issue.

I'm implementing an AbstractPortalComponent and when the ON_CHANGE event is triggered, I need to get the selected value and pass it on to a search statement....

With this regard, I coded the following:


DropdownListBox ddlb = (DropdownListBox) pageContext.getComponentForId("id");

String selection = ddlb.getSelection();

When the event is triggered, if I code the following Javascript:

function disableDDLB(){
var funcName = htmlb_formid+'_getHtmlbElementId';
func = window[funcName];
var dlb = eval(func('id'));
var comp = document.getElementById(; 

in order to disable further selections, then the line 2)

String selection = ddlb.getSelection();

returns null.

<u>However, if I don't disable my dropdownlistbox (i.e. I remove the javascript code mentioned above) everything works as expected.</u>

<u>What I'm trying to achieve</u>: I need to let the user select an entry from the dropdown and then prevent them from choosing another option. The dropdown will be enabled again when the server gets back with a response to the original request.

Any help is appreciated.