The following ActionScript example details how to compare
two numbers using client-side expression evaluation. To perform
the evaluation, pass a JSP-EL compliant expression and the target
variables to an IExpressionManager instance. Configure the client-side
with a variable resolver via the IVariableResolver instance. The
returned value is an IComputedExpression instance.
var em: IExpressionManager = new ExpressionManagerImpl();
var vr: IVariableResolver = new SimpleVariableResolver();
em.variableResolver = vr;
vr.setValue("number1", 5);
vr.setValue("number2", 3);
var ce: IComputedExpression = em.manage("${number2 > number1}");
// Can read the value immediately since the expression does not contain any asynchronous remote calls
trace(ce.value);
|
|
|