[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1733) A limitation in the expression language enhancements is not documented

Gavin King (JIRA) jira-events at lists.jboss.org
Fri Jul 27 13:04:47 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1733?page=comments#action_12370285 ] 
            
Gavin King commented on JBSEAM-1733:
------------------------------------

For example, the following works:


@Name("foo") 
@Scope(CONVERSATION) 
public class Foo() { ... }

@Name("bar") 
public class Bar() {
    public void bar(Foo foo);
}


<s:link action="#{bar.bar(foo)}"/>


And even this works:


@Name("foos") 
@Scope(CONVERSATION) 
public class Foos() implements DataModel { ... }

@Name("bar") 
public class Bar() {
    public void bar(Foo foo);
}

<ui:repeat value="#{foos}" var="foo">
    <s:link action="#{bar.bar(foo)}"/>
</ui:repeat>

The only "limitation" is that you can't pass an object that only exists in one context into a totally different context. It should be clear that this is a perfectly reasonable restriction.


> A limitation in the expression language enhancements is not documented
> ----------------------------------------------------------------------
>
>                 Key: JBSEAM-1733
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1733
>             Project: JBoss Seam
>          Issue Type: Task
>          Components: JSF, Documentation, EL
>            Reporter: Wise Guy
>            Priority: Minor
>
> There is a limitation in the expression language enhancements that is not documented. It would look like this:
> ---
> http://docs.jboss.com/seam/2.0.0.B1/reference/en/html/elenhancements.html
> Chapter 29. Expression language enhancements
> 29.1.2. Limitations
> 29.1.2.3. Cannot pass a variable to a MethodBinding
> You may not pass a variable to a MethodBinding, hence the following syntax is not valid:
> <ui:repeat var="curLocale" value="#{localeSelector.supportedLocales}">
>   <s:link value="#{curLocale.label}" action="#{localeSelector.selectLanguage(curLocale.value)}"/>
> </ui:repeat>
> Seam cannot evaluate "curLocale.value" in the rendering phase because it is a part of a MethodBinding. If you need to do implement the same functionality  then use the f:param tag:
> <s:link value="#{curLocale.label}" action="#{localeProvider.updateLocale()}">
>     <f:param name="l" value="#{curLocale.value}"/>
> </s:link>
> Then, having the field variable "l" injected as a @RequestParameter, you would do this:
> public void updateLocale() {
>         if (l != null && l.length() > 0) {
>             localeSelector.selectLanguage(l);
>         }
> }	
> --
> May I also point out that you should merge "29.1. Parameterized Method Bindings"  and "29.2. Parameterized Value Bindings". (2.0.0.B1/reference)
> Thank you for the attention

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list