myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Gadbois (JIRA)" <incubator-...@incubator.apache.org>
Subject [jira] Created: (MYFACES-140) HtmlPanelGrid should coerce column value to Number
Date Mon, 21 Mar 2005 15:40:24 GMT
HtmlPanelGrid should coerce column value to Number
--------------------------------------------------

         Key: MYFACES-140
         URL: http://issues.apache.org/jira/browse/MYFACES-140
     Project: MyFaces
        Type: Bug
    Versions: 1.0.8 beta    
 Environment: Tomcat 5.0.28.  JDK 1.5.0.  Windows XP SP2 x86.
    Reporter: David Gadbois
    Priority: Minor


In javax.faces.component.html.HtmlPanelGrid, we have:

    public int getColumns()
    {
        if (_columns != null) return _columns.intValue();
        ValueBinding vb = getValueBinding("columns");
        Integer v = vb != null ? (Integer)vb.getValue(getFacesContext()) : null;
        return v != null ? v.intValue() : DEFAULT_COLUMNS;
    }

Per JSP 2.0 section 2.3.5.1 and 2.9, EL expressions can return a variety of of numeric types.
 In particular, the expression #{2 + 2} will return a Long.  The code should be

    public int getColumns()
    {
        if (_columns != null) return _columns.intValue();
        ValueBinding vb = getValueBinding("columns");
        Number v = vb != null ? (Number)vb.getValue(getFacesContext()) : null;
        return v != null ? v.intValue() : DEFAULT_COLUMNS;
    }



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message