OW2 Consortium telosys

Rev

Blame | Last modification | View Log | RSS feed

//----------------------------------------------------------------------------------------------------
function fwkComboDisplayList(id) 
{
        if ( id != null ) 
        {
                //alert("fwkComboDisplayList(" + id + ")");
                var comboDiv = document.getElementById(id+"_main");
                var comboInput = document.getElementById(id);
                var comboPicto = document.getElementById(id+"_picto");
                var comboSelect = document.getElementById(id+"_select");
                if(comboDiv != null && comboSelect!=null) 
                {
                        //alert("fwkComboDisplayList(" + id + ") Step 2 ");
                        //var pos = fwkGetXY(comboDiv);
                        var pos = fwkGetRelativeXY(comboDiv);
                        if ( pos != null )
                        {
                                //alert("fwkComboDisplayList(" + id + ") Step 3 ");
                                comboSelect.style.left = pos[0] ; // X
                                comboSelect.style.top = pos[1] + comboDiv.offsetHeight + 1 ; // Y
                                comboSelect.style.width = comboInput.offsetWidth + comboPicto.offsetWidth;
                                comboSelect.style.display="block";
                                comboSelect.focus();
                        }
                }
        }
        else
        {
                fwkError("fwkComboDisplayList : ID argument is null !");        
        }
}

//----------------------------------------------------------------------------------------------------
function fwkComboHideList(id) 
{
        if ( id != null ) 
        {
                var comboSelect = document.getElementById(id+"_select");
                if(comboSelect != null) 
                {
                        comboSelect.selectedIndex=-1;
                        comboSelect.style.display="none";
                }
                else
                {
                        fwkError("fwkComboHideList : No element for id '" + id + "' "); 
                }
        }
        else
        {
                fwkError("fwkComboHideList : ID argument is null !");   
        }
}

//----------------------------------------------------------------------------------------------------
function fwkComboSelectBlur(id) 
{
        fwkComboHideList(id) 
}

//----------------------------------------------------------------------------------------------------
function fwkComboSelectChange(select,id)
{
        if ( id != null ) 
        {
                var comboInput = document.getElementById(id);
                if(comboInput != null) 
                {
                        comboInput.value = select.options[select.selectedIndex].text;
                        comboInput.focus();
                }
                else
                {
                        fwkError("fwkComboSelectChange : No element for id '" + id + "' ");     
                }
        }
        else
        {
                fwkError("fwkComboSelectChange : ID argument is null !");       
        }
}