Tuesday, March 2, 2010

Problem with ui:repeat and el bracket operator

You'll get a java.lang.IllegalArgumentException: null when try to access a property in an object through an el bracket operator thats inside a <ui:repeat> component. Here's an example:



There's a concurrency issue with the var in the <ui:repeat> and the foo object inside the el bracket. The el expression is trying to evaluate foo before the var in <ui:repeat> is setting it. One solution to this problem is to change <ui:repeat> to <a4j:repeat>. RichFaces's <a4j:repeat> will set the var before the el expression evaluates foo.