Skip to main content

f:attribute usage

5 replies [Last post]
rmerico
Offline
Joined: 2010-02-17

I'm using JSF 2.0 and I try to use the tag.
The following usage works only for the attribute "title".

The "size" attribute is not applied. Can any body tell me why?
Where can I found a good online documentation on jsf 2.0?

May thanks in advance ... Raffaele

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rmerico
Offline
Joined: 2010-02-17

Perfect ... thx Ryan
PS: The solution with the faclet-taglib file requires a registration of it in the web.xml file as follows:

javax.faces.FACELETS_LIBRARIES /WEB-INF/taglib.xml

Ryan Lubke

On 3/1/10 7:09 AM, webtier@javadesktop.org wrote:
> Perfect ... thx Ryan
> PS: The solution with the faclet-taglib file requires a registration of it in the web.xml file as follows:
>
>
>
javax.faces.FACELETS_LIBRARIES >
/WEB-INF/taglib.xml >

>
Right! Thanks for catching that and following up here.
> [Message sent by forum member 'rmerico' (merico@less.ch)]
>
> http://forums.java.net/jive/thread.jspa?messageID=389391
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Ryan Lubke

On 2/25/10 3:43 AM, webtier@javadesktop.org wrote:
> I'm using JSF 2.0 and I try to use the tag.
> The following usage works only for the attribute "title".
>
>
>
>
>

>
> The "size" attribute is not applied. Can any body tell me why?
>
The EL doesn't support the invocation of static methods in this fashion.

You could define an EL function library like:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettag libary_2_0.xsd"
version="2.0">
http://acme.com/integer/functions


valueOf
java.lang.Integer
java.lang.Integer valueOf(int)

(NOTE: methods define in this manner *must* be static)

Then within the Facelet template you'd import the namespace and invoke
the EL function

...
...
xmlns:if=http://acme.com/integer/functions>

...




...

Alternatively, you could define an application-scoped managed bean that
delegates calls to the
static methods on Integer.
> Where can I found a good online documentation on jsf 2.0?
>
http://java.sun.com/javaee/javaserverfaces
> May thanks in advance ... Raffaele
> [Message sent by forum member 'rmerico' (merico@less.ch)]
>
> http://forums.java.net/jive/thread.jspa?messageID=388617
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

[att1.html]

Lincoln Baxter, III

Or you could just use the integer directly. It should be automotically
converted to a String, or the needed value.

On Thu, Feb 25, 2010 at 5:13 PM, Ryan Lubke wrote:

> On 2/25/10 3:43 AM, webtier@javadesktop.org wrote:
>
> I'm using JSF 2.0 and I try to use the tag.
> The following usage works only for the attribute "title".
>
>
>
>
>

>
> The "size" attribute is not applied. Can any body tell me why?
>
>
> The EL doesn't support the invocation of static methods in this fashion.
>
> You could define an EL function library like:
>
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-facelettag libary_2_0.xsd"
> version="2.0">
> http://acme.com/integer/functions
>
>
> valueOf
> java.lang.Integer
> java.lang.Integer valueOf(int)
>

>
>

>
> (NOTE: methods define in this manner *must* be static)
>
> Then within the Facelet template you'd import the namespace and invoke the
> EL function
>
> > ...
> ...
> xmlns:if=http://acme.com/integer/functions>

>
> ...
>
>
>
>
>

> ...
>
>
> Alternatively, you could define an application-scoped managed bean that
> delegates calls to the
> static methods on Integer.
>
> Where can I found a good online documentation on jsf 2.0?
>
>
> http://java.sun.com/javaee/javaserverfaces
>
> May thanks in advance ... Raffaele
> [Message sent by forum member 'rmerico' (merico@less.ch)]
> http://forums.java.net/jive/thread.jspa?messageID=388617
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>
>

--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
[att1.html]

rmerico
Offline
Joined: 2010-02-17

The direct usage of an integer value does not work; you will get an error message like “argument type mismatch”.