You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "David Gadbois (JIRA)" <in...@incubator.apache.org> on 2005/03/21 16:40:24 UTC

[jira] Created: (MYFACES-140) HtmlPanelGrid should coerce column value to Number

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