myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: t:dataTable with dynamic newspaperColumns
Date Wed, 29 Nov 2006 02:53:10 GMT
The implementation of get/setNewspaperColumns needs to be patched.
It looks like this:

    public int getNewspaperColumns() {
        return _newspaperColumns;
    }
    public void setNewspaperColumns(int newspaperColumns) {
        this._newspaperColumns = newspaperColumns;
    }

It needs to be rewritten to work like get/setRows so that it first
checks a ValueBinding instead of only working with an int.

    public int getRows()
    {
        if (_rows != null)
            return _rows.intValue();
        ValueBinding vb = getValueBinding("rows");
        Number v = vb != null ? (Number) vb.getValue(getFacesContext()) : null;
        return v != null ? v.intValue() : DEFAULT_ROWS;
    }

    public void setRows(int rows)
    {
        _rows = new Integer(rows);
        if (rows < 0)
            throw new IllegalArgumentException("rows: " + rows);
    }

Please open a JIRA issue and attach a patch.  Thanks.



On 11/28/06, Yaron Spektor <yaron.spektor@b6systems.com> wrote:
> Hi,
> I was wondering if anyone knows why the t:dataTable does not accept a
> backing bean value for the newspaperColumns value-binding?
>
> Where this example works (4 columns):
> <t:dataTable newspaperColumns="4" newspaperOrientation="horizontal"
> value="#{bean.valueList}" var="index" >
>             <h:column>
>                  <h:outputText value="#{index}" />
>         </h:column>
> </t:dataTable>
>
> But this does not:
>
> <t:dataTable newspaperColumns="#{bean.numberOfColumns}"
> newspaperOrientation="horizontal" value="#{bean.valueList}" var="index"
> >
>             <h:column>
>                  <h:outputText value="#{index}" />
>         </h:column>
> </t:dataTable>
>
> Any work around to that? I can not use the t:columns.
>
> Thanks,
>

Mime
View raw message