sjivan / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

Calling getInputType() on a ComboBox results in null pointer error #450

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Basically calling getInputType() on a ComboBox returns a null pointer

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
2.0.5

Please provide any additional information below.

    private String getFieldValue(String pFieldName){
        String _value = "";
        String _fieldName = "";
        Field[] _fields = formPanel.getFields();

        for(int ix=0;ix < _fields.length;ix++) {
            _fieldName = _fields[ix].getName();

            if(_fieldName != null && 
_fieldName.equalsIgnoreCase(pFieldName.trim())) {
                if(_fields[ix].getInputType() != null && 
_fields[ix].getInputType().equals("text")) {
                    _value = _fields[ix].getValueAsString();
                }
                else {
                    _value = 
((ComboBox)_fields[ix]).getValue();
                }
                break;
            }
        }

        return (_value != null && _value.length() > 0)? _value: "";
    }

Original issue reported on code.google.com by charles....@gmail.com on 7 Nov 2008 at 12:48