Search

24.3. Evaluating EL Expressions

download PDF
Seam Remoting also supports EL expression evaluation, which is another convenient method of retrieving data from the server. The Seam.Remoting.eval() function lets the EL expression be remotely evaluated on the server, and returns the resulting value to a client-side callback method. This function accepts two parameters: the EL expression to evaluate, and the callback method to invoke with the expression value. For example:
function customersCallback(customers) {
    for (var i = 0; i < customers.length; i++) {
        alert("Got customer: " + customers[i].getName());
    }    
}
    
Seam.Remoting.eval("#{customers}", customersCallback); 
Here, Seam evaluates the #{customers} expression, and the value of the expression (in this case, a list of Customer objects) is returned to the customersCallback() method. Remember, objects returned this way must have their types imported with s:remote for you to work with them in JavaScript. To work with a list of customer objects, you must be able to import the customer type:
<s:remote include="customer"/>
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.