src/Easy/Element/DropDownList.php
public function render()
    {
    	if($this->formPrefix){
    		$formNameStr = str_replace(".","_", $this->getFormObj()->objectName)."_";
    	}        
    	if($this->value!=null){
    		$value = $this->value;
    	}else{
    		$value = $this->getText();
    	}        
    	if($value==null){
    		$value = $this->getDefaultValue();
    	}
    	if(preg_match('/\{.*?@.*?\}/si',$value)){
    		$formObj = $this->getFormObj();
    		$value = Expression::evaluateExpression($value, $formObj);
    	}
        $disabledStr = ($this->getEnabled() == "N") ? "READONLY=\"true\"" : "";
        $style = $this->getStyle();
        $func = $this->getFunction();
        $optionList= $this->renderList();
        
        $htmlClass = Expression::evaluateExpression($this->cssClass, $formobj);
        $htmlClass = "CLASS='$htmlClass'";
        
        $sHTML .= "<div class=\"div_".$this->cssClass."\">";    	                
        if($this->readOnly=='Y')
        {
	        $display_input = "style=\"display:none;\"";
	        $display_span = "style=\"position:;\"";
        }
        else
        {
	        $display_span = "style=\"display:none;\"";
	        $display_input = "style=\"position:;\"";
        }
        $list = $this->getList();
        if ($this->blankOption) // ADD a blank option
        {
            $entry = explode(",",$this->blankOption);
            $text = $entry[0];
            $blkvalue = ($entry[1]!= "") ? $entry[1] : null;
            $display_value = $text;
            $entryList = array(array("val" => $blkvalue, "txt" => $text ));
            $list = array_merge($entryList, $list);
        }        
        
        $display_value=$this->getDisplayValue($value);
    	if(!$list){$list=array();}
        foreach ($list as $item){
        	if($item['val']==$value){
        		if(!preg_match("/\</si",$item['txt'])){
        			$display_value = $item['txt'];
        		}else{
        			$display_value = $item['val'];
        		}
        		break;
        	}
        }
        
        if($value==''){
            $defaultOpt = array_shift($list);
            if($display_value==''){
            	$value = $defaultOpt['val'];
        		$display_value = $defaultOpt['txt'];
            }
        	array_unshift($list,$defaultOpt);        	 
        }
                
        $this->setValue($value);
        $display_value = strip_tags($display_value);
		
		$elem_id = $formNameStr.$this->objectName;
		$elem_scroll_id = $formNameStr.$this->objectName."_scroll";
		$elem_list_id = $formNameStr.$this->objectName."_list";
		$elem_hidden_id = $formNameStr.$this->objectName."_hidden";
        
		$onchange_func = $this->getOnChangeFunction();
		$sHTML .= $optionList;
		$sHTML .= "\n<div $display_span>";
		// jquery $j('a.maxmin').click(function() {...});
		// jquery $j('a.maxmin').hover(function() {...}, function() {...});
		if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
			$sHTML .= "\n<span ID=\"span_$elem_id\"  $this->htmlAttr $style>$display_value</span>\n";
		}
		else {
	        $sHTML .= "<span ID=\"span_$elem_id\"  $this->htmlAttr $style
						onclick=\"if($('$elem_list_id').visible()){\$('$elem_list_id').hide();\$('$elem_scroll_id').hide();$('$elem_id').className='".$this->cssClass."'}else{\$('$elem_list_id').show();\$('$elem_scroll_id').show();$('$elem_id').className='".$this->cssFocusClass."'}\"
						onmouseover=\"$('span_$elem_id').className='".$this->cssHoverClass."'\"
						onmouseout=\"$('span_$elem_id').className='".$this->cssClass."'\"
						>$display_value</span>";
		}
		$sHTML .= "</div>";
		$sHTML .= "<div $display_input>";
		if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
			$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_id\" VALUE=\"" . $display_value . "\" $disabledStr $this->htmlAttr $style />\n";
		}
		else {
			$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_id\" VALUE=\"" . $display_value . "\" $disabledStr $this->htmlAttr $style 
						onclick=\"if($('$elem_list_id').visible()){\$('$elem_list_id').hide();\$('$elem_scroll_id').hide();$('$elem_id').className='".$this->cssClass."'}else{\$('$elem_list_id').show();\$('$elem_scroll_id').show();$('$elem_id').className='".$this->cssFocusClass."'}\"
							onmouseover=\"$('span_$elem_id').className='".$this->cssHoverClass."'\"
							onmouseout=\"$('span_$elem_id').className='".$this->cssClass."'\"
						/>";
		}
		$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_hidden_id\" VALUE=\"" . $value . "\" type=\"hidden\" $func />";	        
		$sHTML .= "</div>";	        
        	
        $sHTML .= "</div>";
        
if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
	$sHTML .= "<script>$('#$elem_list_id').hide();
	$('#span_$elem_id, #$elem_id').click(
		function() {
			$('#$elem_list_id, #$elem_scroll_id').toggle();
		}
	);
	$('#span_$elem_id, #$elem_id').hover(
		function () {
			$(this).attr('class','$this->cssHoverClass');
		},
		function () {
			$(this).attr('class','$this->cssClass');
		}
	);
	$('#$elem_list_id li').click(
		function(){
			$('#$elem_list_id, #$elem_scroll_id').hide();
			$('#$elem_id').val($(this).attr('disp_value'));
			$('#$elem_hidden_id').val($(this).attr('real_value'));
			$('#span_$elem_id').html($(this).html());
			$('#$elem_id').attr('class','$this->cssClass');
			$onchange_func;
		}
	);
	</script>";
}
else {
	$sHTML .= "<script>$('$elem_list_id').hide();</script>";
}
        return $sHTML;
    }
public function render()
    {
    	if($this->formPrefix){
    		$formNameStr = str_replace(".","_", $this->getFormObj()->objectName)."_";
    	}        
    	if($this->value!=null){
    		$value = $this->value;
    	}else{
    		$value = $this->getText();
    	}        
    	if($value==null){
    		$value = $this->getDefaultValue();
    	}
    	if(preg_match('/\{.*?@.*?\}/si',$value)){
    		$formObj = $this->getFormObj();
    		$value = Expression::evaluateExpression($value, $formObj);
    	}
        $disabledStr = ($this->getEnabled() == "N") ? "READONLY=\"true\"" : "";
        $style = $this->getStyle();
        $func = $this->getFunction();
        $optionList= $this->renderList();
        
        $htmlClass = Expression::evaluateExpression($this->cssClass, $formobj);
        $htmlClass = "CLASS='$htmlClass'";
        
        $sHTML .= "<div class=\"div_".$this->cssClass."\">";    	                
        if($this->readOnly=='Y')
        {
	        $display_input = "style=\"display:none;\"";
	        $display_span = "style=\"position:;\"";
        }
        else
        {
	        $display_span = "style=\"display:none;\"";
	        $display_input = "style=\"position:;\"";
        }
        $list = $this->getList();
        if ($this->blankOption) // ADD a blank option
        {
            $entry = explode(",",$this->blankOption);
            $text = $entry[0];
            $blkvalue = ($entry[1]!= "") ? $entry[1] : null;
            $display_value = $text;
            $entryList = array(array("val" => $blkvalue, "txt" => $text ));
            $list = array_merge($entryList, $list);
        }        
        
        $display_value=$this->getDisplayValue($value);
    	if(!$list){$list=array();}
        foreach ($list as $item){
        	if($item['val']==$value){
        		if(!preg_match("/\</si",$item['txt'])){
        			$display_value = $item['txt'];
        		}else{
        			$display_value = $item['val'];
        		}
        		break;
        	}
        }
        
        if($value==''){
            $defaultOpt = array_shift($list);
            if($display_value==''){
            	$value = $defaultOpt['val'];
        		$display_value = $defaultOpt['txt'];
            }
        	array_unshift($list,$defaultOpt);        	 
        }
                
        $this->setValue($value);
        $display_value = strip_tags($display_value);
		
		$elem_id = $formNameStr.$this->objectName;
		$elem_scroll_id = $formNameStr.$this->objectName."_scroll";
		$elem_list_id = $formNameStr.$this->objectName."_list";
		$elem_hidden_id = $formNameStr.$this->objectName."_hidden";
        
		$onchange_func = $this->getOnChangeFunction();
		$sHTML .= $optionList;
		$sHTML .= "\n<div $display_span>";
		// jquery $j('a.maxmin').click(function() {...});
		// jquery $j('a.maxmin').hover(function() {...}, function() {...});
		if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
			$sHTML .= "\n<span ID=\"span_$elem_id\"  $this->htmlAttr $style>$display_value</span>\n";
		}
		else {
	        $sHTML .= "<span ID=\"span_$elem_id\"  $this->htmlAttr $style
						onclick=\"if($('$elem_list_id').visible()){\$('$elem_list_id').hide();\$('$elem_scroll_id').hide();$('$elem_id').className='".$this->cssClass."'}else{\$('$elem_list_id').show();\$('$elem_scroll_id').show();$('$elem_id').className='".$this->cssFocusClass."'}\"
						onmouseover=\"$('span_$elem_id').className='".$this->cssHoverClass."'\"
						onmouseout=\"$('span_$elem_id').className='".$this->cssClass."'\"
						>$display_value</span>";
		}
		$sHTML .= "</div>";
		$sHTML .= "<div $display_input>";
		if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
			$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_id\" VALUE=\"" . $display_value . "\" $disabledStr $this->htmlAttr $style />\n";
		}
		else {
			$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_id\" VALUE=\"" . $display_value . "\" $disabledStr $this->htmlAttr $style 
						onclick=\"if($('$elem_list_id').visible()){\$('$elem_list_id').hide();\$('$elem_scroll_id').hide();$('$elem_id').className='".$this->cssClass."'}else{\$('$elem_list_id').show();\$('$elem_scroll_id').show();$('$elem_id').className='".$this->cssFocusClass."'}\"
							onmouseover=\"$('span_$elem_id').className='".$this->cssHoverClass."'\"
							onmouseout=\"$('span_$elem_id').className='".$this->cssClass."'\"
						/>";
		}
		$sHTML .= "<INPUT NAME=\"$elem_id\" ID=\"$elem_hidden_id\" VALUE=\"" . $value . "\" type=\"hidden\" $func />";	        
		$sHTML .= "</div>";	        
        	
        $sHTML .= "</div>";
        
if (defined('OPENBIZ_JSLIB_BASE') && OPENBIZ_JSLIB_BASE == 'JQUERY') {
	$sHTML .= "<script>$('#$elem_list_id').hide();
	$('#span_$elem_id, #$elem_id').click(
		function() {
			$('#$elem_list_id, #$elem_scroll_id').toggle();
		}
	);
	$('#span_$elem_id, #$elem_id').hover(
		function () {
			$(this).attr('class','$this->cssHoverClass');
		},
		function () {
			$(this).attr('class','$this->cssClass');
		}
	);
	$('#$elem_list_id li').click(
		function(){
			$('#$elem_list_id, #$elem_scroll_id').hide();
			$('#$elem_id').val($(this).attr('disp_value'));
			$('#$elem_hidden_id').val($(this).attr('real_value'));
			$('#span_$elem_id').html($(this).html());
			$('#$elem_id').attr('class','$this->cssClass');
			$onchange_func;
		}
	);
	</script>";
}
else {
	$sHTML .= "<script>$('$elem_list_id').hide();</script>";
}
        return $sHTML;
    }
Render, draw the control according to the mode

@return string HTML text