define( function() { "use strict"; function C_HtmlSelect() { }; C_HtmlSelect.prototype.draw = function( oControlHost ) { var oParameter = oControlHost.getParameter( "pl" ); var sParameterValue = ( oParameter && ( oParameter.values.length > 0 ) ) ? oParameter.values[0].use : ""; var sHtml = ''; var el = oControlHost.container; el.innerHTML = sHtml; this.m_sel = el.querySelector( "*" ); if ( !sParameterValue ) { this.m_sel.selectedIndex = 0; } this.f_onChange( oControlHost ); this.m_sel.onchange = this.f_onChange.bind( this, oControlHost, true ); }; C_HtmlSelect.prototype.f_onChange = function( oControlHost, bAutoSubmit ) { oControlHost.valueChanged(); if ( bAutoSubmit ) { oControlHost.next(); } }; C_HtmlSelect.prototype.setData = function( oControlHost, oDataStore ) { this.m_oDataStore = oDataStore; }; C_HtmlSelect.prototype.getParameters = function() { if ( this.m_sel.selectedIndex < 1 ) { return null; } var sValue = this.m_sel.options[this.m_sel.selectedIndex].value; return [{ "parameter": "pl", "values": [{ "use" : sValue }] }]; }; C_HtmlSelect.prototype.isInValidState = function() { return ( this.m_sel.selectedIndex > 0 ); }; return C_HtmlSelect; });