Reference Manual for Gracelets - 2.0.0.SP2SourceForge.net Logo
2.6 - Tutorial : Using Closures instead of EL
In Gracelets, instead of using EL (Expression Language, which is just fine if you prefer to use it), you can use Closures. You can use them anywhere, including everywhere a normal EL expression can be used, like with most JSF Component attributes and the like.

The obvious advantages of using closures is that 1) you can write the code inside the view script (which can be useful for prototyping, or could just be your preference), 2) that you can do more complex things than regular EL, and 3) you can decide the line between what really belongs in your user interface view code and what belongs in a controller, if you are using some type of controller.

In the following sections of this tutorial, you will see how to use closures specifically in the different areas you would normally use EL.

  • Value Expressions
  • Value Bindings
  • Value Change Listeners
  • Actions
  • Converters