Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EL Variable Support"

m
 
(Background)
 
Line 11: Line 11:
 
The fragment shows a c:forEach creating a variable called "book" whose value is the ''expression'' <nowiki>"#{BooksBean.books}"</nowiki>.  When h:inputText evaluates "book" in its value attribute, the correct instance is evaluated based on the instance of BooksBean.books that was selected for that collection on a particular iteration of the forEach.
 
The fragment shows a c:forEach creating a variable called "book" whose value is the ''expression'' <nowiki>"#{BooksBean.books}"</nowiki>.  When h:inputText evaluates "book" in its value attribute, the correct instance is evaluated based on the instance of BooksBean.books that was selected for that collection on a particular iteration of the forEach.
  
In order to support symbols like ''book'' at design-time we need to create a new type of symbol called ''IExpressionInstanceSymbol'':
+
In order to support symbols like ''book'' at design-time we need to create a new type of symbol called ''IExpressionVariableInstanceSymbol''.
 +
 
 +
== Expression Instance Symbol ==
 +
 
 +
Here is the class hierarchy for the new Expression Instance Symbol:
 +
 
 +
[[Image:ExpressionVariableInstanceSymbol.png]]
 +
 
 +
 
 +
Notice that this defines ''IExpressionVariableInstanceSymbol'' as a specialization of an IInstanceSymbol, meaning that it is a kind of instance symbol like a managed bean or resource bundle.

Latest revision as of 18:33, 3 October 2006

Background

Here is an example of the use of an EL variable:

   <c:forEach var="book" items="\#\{BooksBean.books\}">
	<h:inputText id="quantity" value="\#\{book.quantity\}" ... />
   </c:forEach>

The fragment shows a c:forEach creating a variable called "book" whose value is the expression "#{BooksBean.books}". When h:inputText evaluates "book" in its value attribute, the correct instance is evaluated based on the instance of BooksBean.books that was selected for that collection on a particular iteration of the forEach.

In order to support symbols like book at design-time we need to create a new type of symbol called IExpressionVariableInstanceSymbol.

Expression Instance Symbol

Here is the class hierarchy for the new Expression Instance Symbol:

ExpressionVariableInstanceSymbol.png


Notice that this defines IExpressionVariableInstanceSymbol as a specialization of an IInstanceSymbol, meaning that it is a kind of instance symbol like a managed bean or resource bundle.

Back to the top