You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Renzo Tomaselli <re...@tecnotp.it> on 2007/02/19 12:06:15 UTC
[Trinidad] How to right-align numbers in tr:column
Hi, Trinidad tag documentation states that the column component should
have a formatType attribute.
I tried to right-align a numeric cell as <tr:column formatType="right">,
but I got the warning "Property 'formatType' is not on type
org.apache.myfaces.trinidad.component.core.data.CoreColumn"
How can I do align numeric columns ?
Re: [Trinidad] How to right-align numbers in tr:column
Posted by Renzo Tomaselli <re...@tecnotp.it>.
Adam Winer wrote:
> On 2/19/07, Renzo Tomaselli <re...@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
Re: [Trinidad] How to right-align numbers in tr:column
Posted by Adam Winer <aw...@gmail.com>.
On 2/19/07, Renzo Tomaselli <re...@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
-- Renzo
>
> Felix Gonschorek wrote:
> > Hello,
> >
> > i do this with <t:column align="end" />
> >
> > regards
> > felix gonschorek
> >
> > Simon Lessard schrieb:
> >> Helllo Renzo,
> >>
> >> I neer played with that property yet, but I think the formatType
> >> should be
> >> "number" and not "right". I believe there's also either an align or
> >> halign
> >> property to do that.
> >>
> >>
> >> Regards,
> >>
> >> ~ Simon
> >>
> >> On 2/19/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
> >>>
> >>> Hi, Trinidad tag documentation states that the column component should
> >>> have a formatType attribute.
> >>> I tried to right-align a numeric cell as <tr:column
> >>> formatType="right">,
> >>> but I got the warning "Property 'formatType' is not on type
> >>> org.apache.myfaces.trinidad.component.core.data.CoreColumn"
> >>> How can I do align numeric columns ?
> >>>
> >>>
> >>
> >
>
Re: [Trinidad] How to right-align numbers in tr:column
Posted by Renzo Tomaselli <re...@tecnotp.it>.
Thanks all, now I noticed the "align" attribute. Should the "Formatting"
paragraph be canceled from tag doc ?
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.
-- Renzo
Felix Gonschorek wrote:
> Hello,
>
> i do this with <t:column align="end" />
>
> regards
> felix gonschorek
>
> Simon Lessard schrieb:
>> Helllo Renzo,
>>
>> I neer played with that property yet, but I think the formatType
>> should be
>> "number" and not "right". I believe there's also either an align or
>> halign
>> property to do that.
>>
>>
>> Regards,
>>
>> ~ Simon
>>
>> On 2/19/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
>>>
>>> Hi, Trinidad tag documentation states that the column component should
>>> have a formatType attribute.
>>> I tried to right-align a numeric cell as <tr:column
>>> formatType="right">,
>>> but I got the warning "Property 'formatType' is not on type
>>> org.apache.myfaces.trinidad.component.core.data.CoreColumn"
>>> How can I do align numeric columns ?
>>>
>>>
>>
>
Re: [Trinidad] How to right-align numbers in tr:column
Posted by Felix Gonschorek <fe...@gg-media.biz>.
Hello,
i do this with <t:column align="end" />
regards
felix gonschorek
Simon Lessard schrieb:
> Helllo Renzo,
>
> I neer played with that property yet, but I think the formatType should be
> "number" and not "right". I believe there's also either an align or halign
> property to do that.
>
>
> Regards,
>
> ~ Simon
>
> On 2/19/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
>>
>> Hi, Trinidad tag documentation states that the column component should
>> have a formatType attribute.
>> I tried to right-align a numeric cell as <tr:column formatType="right">,
>> but I got the warning "Property 'formatType' is not on type
>> org.apache.myfaces.trinidad.component.core.data.CoreColumn"
>> How can I do align numeric columns ?
>>
>>
>
--
Felix Gonschorek
GG-Media
Rombachweg 6a
69118 Heidelberg
Tel: +49 6221 890 168-0
Fax: +49 6221 890 168-1
Mobil: +49 176 2234 1338
felix@gg-media.biz
http://www.gg-media.biz
Vertretungsberechtigte Gesellschafter:
Felix Gonschorek & Jochen Greiner
Umsatzsteuer-Identifikationsnummer
gemäß § 27a Umsatzsteuergesetz:
DE232906440
Re: [Trinidad] How to right-align numbers in tr:column
Posted by Simon Lessard <si...@gmail.com>.
Helllo Renzo,
I neer played with that property yet, but I think the formatType should be
"number" and not "right". I believe there's also either an align or halign
property to do that.
Regards,
~ Simon
On 2/19/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
>
> Hi, Trinidad tag documentation states that the column component should
> have a formatType attribute.
> I tried to right-align a numeric cell as <tr:column formatType="right">,
> but I got the warning "Property 'formatType' is not on type
> org.apache.myfaces.trinidad.component.core.data.CoreColumn"
> How can I do align numeric columns ?
>
>