re-evaluation of expresssions on p:ajax attributes

UI Components for JSF
Post Reply
tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

11 Oct 2011, 18:06

Hi,

today i faced a problem when i bind an expression for example to onstart on p:ajax.
On the first request, the expression is evaluated without problems but if updates the component, which includes the p:ajax, the expression is not evaluated again. (I also checked the response and if my setter is getting called)

Is this an known limitation?

Best regards
Thomas
Last edited by tandraschko on 12 Oct 2011, 10:09, edited 1 time in total.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

12 Oct 2011, 10:02

I think somebody has already reported this issue. Looks like a bug in PrimeFaces. PrimeFaces saves the state as String with

Code: Select all

getStateHelper().put(PropertyKeys.onstart, _onstart);
and Mojarra e.g. saves it for f:ajax as ValueExpression by calling eval method

Code: Select all

    private Object eval(String propertyName, Object value) {

        if (value != null) {
            return value;
        }

        ValueExpression expression = getValueExpression(propertyName);

        if (expression != null) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            return expression.getValue(ctx.getELContext());
        }

        return null;
    }
The first evaluation is always ok because EL gets evaluated during first rendering. After that the evaluated value is stored as String.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests