On 7/21/06, Marcus Schmidke <[EMAIL PROTECTED]> wrote:
did you mean "only work with JSP" (so not at all with Facelets) or did you
mean "only work with JSP EL Syntax"?
Dennis is confused. He didn't realize that Facelets supports JSF EL
functions. [MyFaces can also support these, but it's tricky to get
them installed (subclass ValueBindingImpl).]
You definitely want to be using #{}.
It's been awhile since I've used myfaces and facelets user-defined EL
functions, but they should work fine. (I primarily needed a
jstl:length function, which is automatically available in facelets).
Is your function static? That's a requirement. Did you include
your taglib file in facelets.libraries in the web.xml file?
I'd recommend asking your question on the facelets mailing list --
there's nothing specific to MyFaces on using facelets user-defined EL
functions.
I had used #{}. Now I tried ${}, which doesn't work either.
The xhtml file:
<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:le="http://www.prosystemsit.de/le"
>
<h:outputText value="${le:wert('test')}" />
</ui:component>
The Taglib file:
<!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>
<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>
Marcus.
"Dennis Byrne"
<[EMAIL PROTECTED] An: "MyFaces Discussion"
<[email protected]>
t> Kopie:
Thema: Re: User defined LE
functions
21.07.2006 08:54
Bitte antworten
an "MyFaces
Discussion"
Are you using ${} or #{} ? User defined functions only work for JSP EL.
Sorry.
Dennis Byrne
>-----Original Message-----
>From: Marcus Schmidke [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 21, 2006 02:16 AM
>To: [email protected]
>Subject: User defined LE functions
>
>
>Hello all,
>
>with Facelets and myFaces 1.1.3, I've got a problem writing a user defined
>EL function. I am certain I did everything as documented, but it doesn't
>work.
>
>Is there any general problem with user defined EL functions in myFaces
>(wrong version or something like that), or must I search deeper for the
>error I made?
>
>Regards,
>
>Marcus.