incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <renzo.tomase...@tecnotp.it>
Subject Re: [Trinidad] How to right-align numbers in tr:column
Date Tue, 20 Feb 2007 09:07:37 GMT
Adam Winer wrote:
> On 2/19/07, Renzo Tomaselli <renzo.tomaselli@tecnotp.it> wrote:
>>
>> Thanks all, now I noticed the "align" attribute. Should the "Formatting"
>> paragraph be canceled from tag doc ?
>
>
> Yep, thanks for pointing this out...  that's obsolete.  I'll fix this.
>
> Also I tried to follow the column renderer sources by a debugger: I just
>> noticed that there is some automatic style selection based on actual
>> child type: text, number and icon. But I miss what should lead to number
>> detection, since we have no "outputNumber" component.
>> An icon is properly recognized if I provide it through tr:icon. The same
>> for a string through ouputText.
>> But if my bean returns an Integer to feed an outputText value, then it
>> is assigned an af_column_cell-text selector (thus left-aligned), while I
>> expected a af_column_cell-number, which is right-aligned.
>> So the point is how to trigger this detection mechanism by data 
>> contents.
>
>
> This code is rather a mess, and needs to be cleaned up - we used
> to support a "formatType" property on column, but figured that people
> just got confused.  They want to right-align some content, but good
> luck figuring out that formatType="number" is the way to do that!
> The changeover to "align" was kind of a quick hack (and looking at
> it, I think there's some bugs in the handling of start and end in
> right-to-left languages).
>
> I'm having no luck finding the code that detects tr:icon...  where did 
> you
> see
> this?

Adam, the entire game is driven in ColumnData.java, where data format is 
decided upon alignement (center for icon).
Alignement in turn is taken from attributes, in getFormatType(bean) in 
ColumnRenderer.java, then set for ColumnData.
But I was wrong with tr:icon: the icon detection I could see was 
referring to the selection box column (a special column), which is 
centered (in SelectionColumnRenderer.java).
An ordinary tr:icon is left-aligned by default.

-- Renzo


Mime
View raw message