|
List Info
Thread: Rendered propety valid expressions?
|
|
| Rendered propety valid expressions? |

|
2006-07-28 20:08:52 |
I have just started with JSF and have been playing around
with el
expressions in the rendered property of components. Is
there someplace
that explains what is valid/invalid as an expression for
this property?
Specifically is it possible to:
1. Use an and condition like
rendered="#{mb.propertyBoolean1 &&
mb.propertyBoolean2}"
2. Is it possible to compare to an enum value
rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
3. Use a complex call like
rendered="#{mb.someFunction(mb2.value1)}"
Thanks,
- JC
|
|
| Rendered propety valid expressions? |

|
2006-07-28 21:33:53 |
On 7/28/06, John Conner <conner.john gmail.com> wrote:
> I have just started with JSF and have been playing
around with el
> expressions in the rendered property of components. Is
there someplace
> that explains what is valid/invalid as an expression
for this property?
The JSF 1.1 spec (JSR-127) under 5.1.2 "Value Binding
Expression
Syntax", which starts off by saying
"The syntax of a value binding expression is identical
to the syntax
of an expression
language expression defined in the JavaServer Pages
Specification (version 2.0),
sections 2.3 through 2.9, with the following
exceptions..."
> Specifically is it possible to:
> 1. Use an and condition like
> rendered="#{mb.propertyBoolean1 &&
mb.propertyBoolean2}"
Yes, although I'd recommend using "and" instead
of "&&" (I don't
remember if it's & or && in any case, but this
avoids that issue as
well as escaping issues).
> 2. Is it possible to compare to an enum value
> rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
I don't think so since variables must be managed beans or
one of the
other predefined values. However, you could write your own
resolver
that also checked for enumeration classes.
> 3. Use a complex call like
>
rendered="#{mb.someFunction(mb2.value1)}"
Only if you're using Facelets or another viewhandler that
lets you
define functions.
For JSF 1.2, everything is the JSP 2.0 unified EL. I think
this is
also what Facelets uses underneath as an espression language
(I have
el-api.jar and el-ri.jar files from glassfish to make it
work).
In any case, everything about the expression language is
configurable.
A long while back, someone posted a replacement EL that
was
javascript.
|
|
| Rendered propety valid expressions? |

|
2006-07-28 22:25:35 |
John,
maybe this gif (JSF 1.1) is helpful too
http://autoren.w3l.de/w3lmedia/W3L/Medium036198/au
sdruecke.gif
On 7/28/06, Mike Kienenberger <mkienenb gmail.com> wrote:
> On 7/28/06, John Conner <conner.john gmail.com> wrote:
> > I have just started with JSF and have been playing
around with el
> > expressions in the rendered property of
components. Is there someplace
> > that explains what is valid/invalid as an
expression for this property?
>
> The JSF 1.1 spec (JSR-127) under 5.1.2 "Value
Binding Expression
> Syntax", which starts off by saying
>
> "The syntax of a value binding expression is
identical to the syntax
> of an expression
> language expression defined in the JavaServer Pages
Specification (version 2.0),
> sections 2.3 through 2.9, with the following
exceptions..."
>
>
> > Specifically is it possible to:
> > 1. Use an and condition like
> > rendered="#{mb.propertyBoolean1
&& mb.propertyBoolean2}"
>
> Yes, although I'd recommend using "and"
instead of "&&" (I don't
> remember if it's & or && in any case, but
this avoids that issue as
> well as escaping issues).
>
>
> > 2. Is it possible to compare to an enum value
> > rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
>
> I don't think so since variables must be managed beans
or one of the
> other predefined values. However, you could write
your own resolver
> that also checked for enumeration classes.
>
> > 3. Use a complex call like
> >
rendered="#{mb.someFunction(mb2.value1)}"
>
> Only if you're using Facelets or another viewhandler
that lets you
> define functions.
>
> For JSF 1.2, everything is the JSP 2.0 unified EL. I
think this is
> also what Facelets uses underneath as an espression
language (I have
> el-api.jar and el-ri.jar files from glassfish to make
it work).
>
> In any case, everything about the expression language
is configurable.
> A long while back, someone posted a replacement EL
that was
> javascript.
>
--
Matthias Wessendorf
further stuff:
blog: http://jroller.co
m/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com
|
|
| Rendered propety valid expressions? |

|
2006-07-28 22:35:45 |
Just keep in mind that <, >, & and others are
special html characters.
You're better off using and, or, gt, ge, lt, le, eq, ne.
On 7/28/06, Matthias Wessendorf <matzew apache.org> wrote:
> John,
>
> maybe this gif (JSF 1.1) is helpful too
>
> http://autoren.w3l.de/w3lmedia/W3L/Medium036198/au
sdruecke.gif
>
> On 7/28/06, Mike Kienenberger <mkienenb gmail.com> wrote:
> > On 7/28/06, John Conner <conner.john gmail.com> wrote:
> > > I have just started with JSF and have been
playing around with el
> > > expressions in the rendered property of
components. Is there someplace
> > > that explains what is valid/invalid as an
expression for this property?
> >
> > The JSF 1.1 spec (JSR-127) under 5.1.2
"Value Binding Expression
> > Syntax", which starts off by saying
> >
> > "The syntax of a value binding expression is
identical to the syntax
> > of an expression
> > language expression defined in the JavaServer
Pages Specification (version 2.0),
> > sections 2.3 through 2.9, with the following
exceptions..."
> >
> >
> > > Specifically is it possible to:
> > > 1. Use an and condition like
> > > rendered="#{mb.propertyBoolean1
&& mb.propertyBoolean2}"
> >
> > Yes, although I'd recommend using
"and" instead of "&&" (I
don't
> > remember if it's & or && in any case,
but this avoids that issue as
> > well as escaping issues).
> >
> >
> > > 2. Is it possible to compare to an enum value
> > > rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
> >
> > I don't think so since variables must be managed
beans or one of the
> > other predefined values. However, you could
write your own resolver
> > that also checked for enumeration classes.
> >
> > > 3. Use a complex call like
> > >
rendered="#{mb.someFunction(mb2.value1)}"
> >
> > Only if you're using Facelets or another
viewhandler that lets you
> > define functions.
> >
> > For JSF 1.2, everything is the JSP 2.0 unified EL.
I think this is
> > also what Facelets uses underneath as an
espression language (I have
> > el-api.jar and el-ri.jar files from glassfish to
make it work).
> >
> > In any case, everything about the expression
language is configurable.
> > A long while back, someone posted a replacement
EL that was
> > javascript.
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.co
m/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>
|
|
| window identifier? |

|
2006-07-29 08:15:02 |
Hi everybody,
(how) can I get an identifier for the window of a client
request? We
need to support multiple windows at the same time and
therefore can't
use plain session scoped beans. Using request scoped beans
would be too
expensive, as far as I thought about it ;) . By knowing the
window
identifier one could solve this problem pretty easily. Is
that possible?
I found something about a "sequence parameter"
but I couldn't find out
how to use it properly -> I didn't find the
documentation. When trying
it out in my application the sequence parameter always was
null. Does it
only work with forms/posts?
Cheers,
Christopher
|
|
| Rendered propety valid expressions? |

|
2006-07-30 23:44:37 |
Mike,
Thanks for the info. I appreciate your help.
- JT
Mike Kienenberger wrote:
> On 7/28/06, John Conner <conner.john gmail.com> wrote:
>> I have just started with JSF and have been playing
around with el
>> expressions in the rendered property of components.
Is there someplace
>> that explains what is valid/invalid as an
expression for this property?
>
> The JSF 1.1 spec (JSR-127) under 5.1.2 "Value
Binding Expression
> Syntax", which starts off by saying
>
> "The syntax of a value binding expression is
identical to the syntax
> of an expression
> language expression defined in the JavaServer Pages
Specification
> (version 2.0),
> sections 2.3 through 2.9, with the following
exceptions..."
>
>
>> Specifically is it possible to:
>> 1. Use an and condition like
>> rendered="#{mb.propertyBoolean1
&& mb.propertyBoolean2}"
>
> Yes, although I'd recommend using "and"
instead of "&&" (I don't
> remember if it's & or && in any case, but
this avoids that issue as
> well as escaping issues).
>
>
>> 2. Is it possible to compare to an enum value
>> rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
>
> I don't think so since variables must be managed beans
or one of the
> other predefined values. However, you could write
your own resolver
> that also checked for enumeration classes.
>
>> 3. Use a complex call like
>>
rendered="#{mb.someFunction(mb2.value1)}"
>
> Only if you're using Facelets or another viewhandler
that lets you
> define functions.
>
> For JSF 1.2, everything is the JSP 2.0 unified EL. I
think this is
> also what Facelets uses underneath as an espression
language (I have
> el-api.jar and el-ri.jar files from glassfish to make
it work).
>
> In any case, everything about the expression language
is configurable.
> A long while back, someone posted a replacement EL
that was
> javascript.
>
|
|
| Rendered propety valid expressions? |

|
2006-07-31 14:59:45 |
Very interesting!!
Two new questions regarding valid EL expressions:
1. How exactly will the syntax and procedure be for using a
Facelet
function as rendered condition?
2. Is it possible to obtain elements of Lists at specific
positions and
compare them with fixed values.
Ex: rendered="#{mb.myList[0] eq 'element1'}"
Regards,
JV
-----Mensaje original-----
De: Mike Kienenberger [mailto:mkienenb gmail.com]
Enviado el: viernes, 28 de julio de 2006 17:36
Para: MyFaces Discussion
Asunto: Re: Rendered propety valid expressions?
Just keep in mind that <, >, & and others are
special html characters.
You're better off using and, or, gt, ge, lt, le, eq, ne.
On 7/28/06, Matthias Wessendorf <matzew apache.org> wrote:
> John,
>
> maybe this gif (JSF 1.1) is helpful too
>
> http://autoren.w3l.de/w3lmedia/W3L/Medium036198/au
sdruecke.gif
>
> On 7/28/06, Mike Kienenberger <mkienenb gmail.com> wrote:
> > On 7/28/06, John Conner <conner.john gmail.com> wrote:
> > > I have just started with JSF and have been
playing around with el
> > > expressions in the rendered property of
components. Is there
someplace
> > > that explains what is valid/invalid as an
expression for this
property?
> >
> > The JSF 1.1 spec (JSR-127) under 5.1.2
"Value Binding Expression
> > Syntax", which starts off by saying
> >
> > "The syntax of a value binding expression is
identical to the syntax
> > of an expression
> > language expression defined in the JavaServer
Pages Specification
(version 2.0),
> > sections 2.3 through 2.9, with the following
exceptions..."
> >
> >
> > > Specifically is it possible to:
> > > 1. Use an and condition like
> > > rendered="#{mb.propertyBoolean1
&& mb.propertyBoolean2}"
> >
> > Yes, although I'd recommend using
"and" instead of "&&" (I
don't
> > remember if it's & or && in any case,
but this avoids that issue as
> > well as escaping issues).
> >
> >
> > > 2. Is it possible to compare to an enum value
> > > rendered="#{mb.enumValue ==
a.b.c.EnumClass.ENUM_VALUE}"
> >
> > I don't think so since variables must be managed
beans or one of the
> > other predefined values. However, you could
write your own resolver
> > that also checked for enumeration classes.
> >
> > > 3. Use a complex call like
> > >
rendered="#{mb.someFunction(mb2.value1)}"
> >
> > Only if you're using Facelets or another
viewhandler that lets you
> > define functions.
> >
> > For JSF 1.2, everything is the JSP 2.0 unified EL.
I think this is
> > also what Facelets uses underneath as an
espression language (I have
> > el-api.jar and el-ri.jar files from glassfish to
make it work).
> >
> > In any case, everything about the expression
language is configurable.
> > A long while back, someone posted a replacement
EL that was
> > javascript.
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.co
m/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>
|
|
| Rendered propety valid expressions? |

|
2006-07-31 15:56:29 |
On 7/31/06, Jorge Vásquez <jv 3eyegroup.com> wrote:
> Very interesting!!
> Two new questions regarding valid EL expressions:
> 1. How exactly will the syntax and procedure be for
using a Facelet
> function as rendered condition?
Here's an example that was just posted on the mailing list.
To use it, it'd be
<html xmlns="http://www.w3.org/1999/x
html"
xmlns:myFunction="http://www.prosystemsit
.de/le"
....
rendered="#{myFunction:test('value')}"
Note that this particular function doesn't return a
boolean, so this
would be an error, but it does demonstrate all of the
pieces.
---------- Forwarded message ----------
From: Marcus Schmidke <marcus.schmidke prosystemsit.de>
Date: Jul 27, 2006 7:09 AM
Subject: Antwort: Re: Re: User defined LE functions
To: MyFaces Discussion <users myfaces.apache.org>
web,xml:
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/tags/le.taglib.xml</param-val
ue>
</context-param>
le.taglib.xml:
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib
1.0//EN"
"http:/
/java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>http:
//www.prosystemsit.de/le</namespace>
<tag>
<tag-name>test</tag-name>
<source>test.xhtml</source>
</tag>
<function>
<function-name>wert</function-name>
<function-class>
de.prosystemsit.leistungserfassung.controller.Functions</
function-class>
<function-signature>java.lang.String
wertInSpalte(java.lang.String)</function-signature>
</function>
</facelet-taglib>
Functions.java:
package de.prosystemsit.leistungserfassung.controller;
public class Functions {
public static String wertInSpalte(String s) {
return "Hallo Welt"+s;
}
}
> 2. Is it possible to obtain elements of Lists at
specific positions and
> compare them with fixed values.
> Ex: rendered="#{mb.myList[0] eq
'element1'}"
Sure, if you write a myFunction:listGet(mb.myList, 0)
function.
rendered="#{myFunction:listGet(mb.myList, 0) eq
'element1'}"
|
|
[1-8]
|
|