You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andrew Robinson <an...@gmail.com> on 2007/08/02 22:15:43 UTC

Seam+MyFaces+Facelets problem with EL functions

I am having a problem with the combination of Seam 1.2.1, MyFaces
(1.1.5 or 1.2.0) and Facelets 1.1.11 when it comes to EL functions. I
am trying to get help from the facelets user list and the seam forum,
but I know a lot of myfaces users use facelets, and may have a
solution.

In MyFaces 1.1.5, EL functions work fine in the facelet views since
facelets handles those. However, with
'facesContext.getApplication().createValueBinding("#{s:hasRole('test')}");'
I get an exception.

1.1.5 error:

Caused by: javax.faces.el.ReferenceSyntaxException: Functions not
supported in expressions. Function: s:hasRole

I tried MyFaces 1.2 and got a different error.

With MyFaces Core/Api 1.2.0 I get this exception:

javax.el.ELException: Expression uses functions, but no FunctionMapper
was provided

Here is the message on the seam forum:

More information here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070255#4070255

How can I get EL functions to work through the JSF Application object
as well as through the facelets view handler?

Thanks,
Andrew

Re: Seam+MyFaces+Facelets problem with EL functions

Posted by Andrew Robinson <an...@gmail.com>.
Okay, this is still not working and is acting more confusing than
before. I'm not sure if the fault is with MyFaces 1.2 or Facelets.

I have a <t:panelNavigation2>

In it I have the following:

<t:commandNavigation2
value="#{messages.MenuBean_createCalendar}"
actionListener="#{menuBean.onMainAction}"
action="mainMenu_createCalendar"
rendered="#{s:hasRole('calendar-admin')}" />

This works just fine if it is rendered at the top level (just under
the panelNavigation2). If, I have it nested under another
commandNavigation2, and I click on the parent node so that it expands,
I get an exception that s:hasRole function does not exist.

I am quite baffled at the moment of why #{s:hasRole('calendar-admin')}
resolves just fine on an initial rendering, but not after a re-render
after a POST.

I have the following in my faces-config:

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<faces-config>
  <application>
    <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
  </application>
  <lifecycle>
    <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
  </lifecycle>
</faces-config>

Any ideas?

On 8/2/07, Andrew Robinson <an...@gmail.com> wrote:
> FYI, got it working with MyFaces 1.2 and using ValueExpression instead
> of ValueBinding.
>
> I just hope that I don't hit too many problems upgrading to MyFaces JSF 1.2
>
> -Andrew
>
> On 8/2/07, Andrew Robinson <an...@gmail.com> wrote:
> > I am having a problem with the combination of Seam 1.2.1, MyFaces
> > (1.1.5 or 1.2.0) and Facelets 1.1.11 when it comes to EL functions. I
> > am trying to get help from the facelets user list and the seam forum,
> > but I know a lot of myfaces users use facelets, and may have a
> > solution.
> >
> > In MyFaces 1.1.5, EL functions work fine in the facelet views since
> > facelets handles those. However, with
> > 'facesContext.getApplication().createValueBinding("#{s:hasRole('test')}");'
> > I get an exception.
> >
> > 1.1.5 error:
> >
> > Caused by: javax.faces.el.ReferenceSyntaxException: Functions not
> > supported in expressions. Function: s:hasRole
> >
> > I tried MyFaces 1.2 and got a different error.
> >
> > With MyFaces Core/Api 1.2.0 I get this exception:
> >
> > javax.el.ELException: Expression uses functions, but no FunctionMapper
> > was provided
> >
> > Here is the message on the seam forum:
> >
> > More information here:
> > http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070255#4070255
> >
> > How can I get EL functions to work through the JSF Application object
> > as well as through the facelets view handler?
> >
> > Thanks,
> > Andrew
> >
>

Re: Seam+MyFaces+Facelets problem with EL functions

Posted by Andrew Robinson <an...@gmail.com>.
FYI, got it working with MyFaces 1.2 and using ValueExpression instead
of ValueBinding.

I just hope that I don't hit too many problems upgrading to MyFaces JSF 1.2

-Andrew

On 8/2/07, Andrew Robinson <an...@gmail.com> wrote:
> I am having a problem with the combination of Seam 1.2.1, MyFaces
> (1.1.5 or 1.2.0) and Facelets 1.1.11 when it comes to EL functions. I
> am trying to get help from the facelets user list and the seam forum,
> but I know a lot of myfaces users use facelets, and may have a
> solution.
>
> In MyFaces 1.1.5, EL functions work fine in the facelet views since
> facelets handles those. However, with
> 'facesContext.getApplication().createValueBinding("#{s:hasRole('test')}");'
> I get an exception.
>
> 1.1.5 error:
>
> Caused by: javax.faces.el.ReferenceSyntaxException: Functions not
> supported in expressions. Function: s:hasRole
>
> I tried MyFaces 1.2 and got a different error.
>
> With MyFaces Core/Api 1.2.0 I get this exception:
>
> javax.el.ELException: Expression uses functions, but no FunctionMapper
> was provided
>
> Here is the message on the seam forum:
>
> More information here:
> http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070255#4070255
>
> How can I get EL functions to work through the JSF Application object
> as well as through the facelets view handler?
>
> Thanks,
> Andrew
>