myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: trinidad outputFormat and f:param support
Date Tue, 04 Sep 2007 16:36:46 GMT
The problem with using EL is it has a major drawback of not supporting arrays.

For example:

a = my {0} text
b = my {0} text {1} is longer
c = my {0} text {1} needs a lot of {2} parameters

With the way EL functions are written I have to create three (or more
actually) functions to handle this (format1, format2, format3). This
is because EL functions do not yet support variable arguments. Perhaps
Sun will make it so in the future, but until that happens outputFormat
is very useful.

One work around is something like:

<tr:outputText ...style stuff...>
   <h:outputFormat value=" ... " >
     <f:param ... />
     ...
   </h:outputFormat>
</tr:outputText>

it is more typing and 1 more component, but it would give you (Paul)
the ability to have Trinidad skinning on the outer component while
using the functionality of the outputFormat that there is apparently a
resistance to provide in Trinidad.

On 9/4/07, Adam Winer <awiner@gmail.com> wrote:
> I'm again at a sorta -0.5 on this;  in JSF 1.2, I'd rather provide
> EL functions to do formatting, since that gives you format
> functionality in all components instead of just one.  (ADF Faces
> does just this in JDev 11).  That still leaves JSF 1.1 users with
> just h:outputFormat, which isn't great.
>
> -- Adam
>
>
> On 9/4/07, Andrew Robinson <andrew.rw.robinson@gmail.com> wrote:
> > What about tr:outputFormat? This would be a direct extension of the
> > core h:outputFormat with the skinning, partialTriggers and other
> > functionality that Trinidad provides added to it?
> >
> > On 9/4/07, Adam Winer <awiner@gmail.com> wrote:
> > > -0.5;  outputText performance is really critical to overall performance,
> > > and even adding a boolean attribute slows it down a bit.
> > >
> > > -- Adam
> > >
> > >
> > > On 9/4/07, Danny Robinson <dannyjrobinson@gmail.com> wrote:
> > > > Should we look at providing this variable replacement functionality into
> > > > outputText.  Although I'm against just parsing the text by default, as
this
> > > > would just add unnecessary parsing in 99% of the cases.  Should we instead
> > > > look at an extra attribute that forces parsing of the string for variable
> > > > substitution.
> > > >
> > > > Danny
> > > >
> > > > On 9/4/07, Adam Winer <awiner@gmail.com> wrote:
> > > > > BTW, for all of these examples, you should just use tr:outputText
> > > > > instead of tr:outputFormatted.
> > > > >
> > > > > outputFormatted really has nothing to do with "outputFormat".
> > > > > What tr:outputFormatted gives you is support for (a subset of)
> > > > > HTML formatting without opening the security hole of
> > > > > escape="false".
> > > > >
> > > > > -- Adam
> > > > >
> > > > >
> > > > >
> > > > > On 8/30/07, Andrew Robinson <andrew.rw.robinson@gmail.com >
wrote:
> > > > > > Well you could do:
> > > > > >
> > > > > > <tr:outputFormatted value="#{myfunc:format2(str, arg1, arg2)}"
/>
> > > > > >
> > > > > > where you could write format1, format2, etc. EL functions to
do the
> > > > work.
> > > > > >
> > > > > > You could also do:
> > > > > >
> > > > > > <t:buffer into="#{formattedString}">
> > > > > > <h:outputFormat value="#{message.key}">
> > > > > >   <f:param value="param1" />
> > > > > > </h:outputFormat>
> > > > > > </t:buffer>
> > > > > >
> > > > > > <tr:outputFormatted value="#{formattedString}" />
> > > > > >
> > > > > > On 8/30/07, Paul Mander < paul.mander@chordiant.com> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Andrew Robinson-5 wrote:
> > > > > > > >
> > > > > > > > Well, that is not localizable
> > > > > > > >
> > > > > > > > I think the use case that he means is more like:
> > > > > > > >
> > > > > > > > <tr:outputFormatted value="#{messages.str}">
> > > > > > > > <f:param value="#{myarg}" />
> > > > > > > > </tr:outputFormatted>
> > > > > > > >
> > > > > > > > messages.properties
> > > > > > > > str = Test {0} param
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > That's a better example.
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context:
> > > > http://www.nabble.com/trinidad-outputFormat-and-f%3Aparam-support-tf4347417.html#a12401317
> > > > > > > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Chordiant Software Inc.
> > > > www.chordiant.com
> > >
> >
>

Mime
View raw message