[jboss-cvs] JBossAS SVN: r105535 - projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 1 23:15:25 EDT 2010


Author: misty at redhat.com
Date: 2010-06-01 23:15:24 -0400 (Tue, 01 Jun 2010)
New Revision: 105535

Modified:
   projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Elenhancements.xml
Log:
JBPAPP-4387

Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Elenhancements.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Elenhancements.xml	2010-06-02 03:10:17 UTC (rev 105534)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Elenhancements.xml	2010-06-02 03:15:24 UTC (rev 105535)
@@ -13,11 +13,11 @@
 			Standard EL does not allow methods to be used with user-defined parameters, but JBoss EL removoes this restriction. For example:
 		</para>
 		 
-<programlisting role="XHTML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel)}" 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel)}" 
                  value="Book Hotel"/>]]>
 </programlisting>
 		 
-<programlisting role="JAVA"><![CDATA[@Name("hotelBooking") 
+<programlisting language="Java" role="JAVA"><![CDATA[@Name("hotelBooking") 
 public class HotelBooking { 
   public String bookHotel(Hotel hotel) { 
     // Book the hotel 
@@ -30,7 +30,7 @@
 				As in method calls from Java, parameters are surrounded by parentheses, and separated by commas:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel, user)}" 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel, user)}" 
                  value="Book Hotel"/>]]>
 </programlisting>
 			 <para>
@@ -40,7 +40,7 @@
 				Any value expression can be used as a parameter:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel.id, 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton action="#{hotelBooking.bookHotel(hotel.id, 
                            user.username)}" 
                  value="Book Hotel"/>]]>
 </programlisting>
@@ -54,7 +54,7 @@
 				You can also pass literal strings using single quotes:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="#{printer.println('Hello world!')}" 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="#{printer.println('Hello world!')}" 
                value="Hello"/>]]>
 </programlisting>
 			 <para>
@@ -64,14 +64,14 @@
 				JBoss EL removes this restriction by allowing values to be retrieved using the method syntax. For example:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:outputText value="#{person.name}" 
+<programlisting language="XML" role="XML"><![CDATA[<h:outputText value="#{person.name}" 
               rendered="#{person.name.length() > 5}" />]]>
 </programlisting>
 			 <para>
 				You can access the size of a collection in a similar manner:
 			</para>
 			 
-<programlisting>
+<programlisting language="Java" role="JAVA">
 #{searchResults.size()}
 </programlisting>
 			 <para>
@@ -81,7 +81,7 @@
 				Parameters are also allowed. The following example calls the <literal>productsByColorMethod</literal> with a literal string argument:
 			</para>
 			 
-<programlisting>#{controller.productsByColor(&#39;blue&#39;)}
+<programlisting language="Java" role="JAVA">#{controller.productsByColor(&#39;blue&#39;)}
 </programlisting>
 		</section>
 		
@@ -101,13 +101,13 @@
 						<emphasis>Use inside iterative components</emphasis> —Components like <literal><![CDATA[<c:forEach />]]></literal> and <literal><![CDATA[<ui:repeat />]]></literal> iterate over a list or array, exposing each item in the list to nested components. This is effective if you are selecting a row with a <literal><![CDATA[<h:commandButton />]]></literal> or <literal><![CDATA[<h:commandLink />]]></literal> like so:
 					</para>
 					 
-<programlisting role="JAVA"><![CDATA[@Factory("items") 
+<programlisting language="Java" role="JAVA"><![CDATA[@Factory("items") 
 public List<Item> getItems() { 
   return entityManager.createQuery("select ...").getResultList(); 
 }]]>
 </programlisting>
 					 
-<programlisting role="XHTML"><![CDATA[<h:dataTable value="#{items}" var="item"> 
+<programlisting language="XML" role="XML"><![CDATA[<h:dataTable value="#{items}" var="item"> 
   <h:column> 
     <h:commandLink value="Select #{item.name}" 
        action="#{itemSelector.select(item})" /> 
@@ -149,13 +149,13 @@
 			JBoss EL supports a limited projection syntax. A projection expression maps a sub-expression across a multi-valued (list, set, etc...) expression. For instance, the expression:
 		</para>
 		 
-<programlisting>#{company.departments}
+<programlisting language="Java" role="JAVA">#{company.departments}
 </programlisting>
 		 <para>
 			might return a list of departments. If you only need a list of department names, you must iterate over the list to retrieve the values. JBoss EL allows this with a projection expression:
 		</para>
 		 
-<programlisting>#{company.departments.{d|d.name}}
+<programlisting language="Java" role="JAVA">#{company.departments.{d|d.name}}
 </programlisting>
 		 <para>
 			The sub-expression is enclosed in braces. In this example, the expression <literal>d.name</literal> is evaluated for each department, using <literal>d</literal> as an alias to the department object. The result of this expression will be a list of String values.
@@ -164,25 +164,25 @@
 			Any valid expression can be used in an expression, so —assuming you would use department names of all lengths in a company —it would also be valid to write the following:
 		</para>
 		 
-<programlisting>#{company.departments.{d|d.size()}}
+<programlisting language="Java" role="JAVA">#{company.departments.{d|d.size()}}
 </programlisting>
 		 <para>
 			Projections can be nested. The following expression returns the last names of every employee in every department:
 		</para>
 		 
-<programlisting>#{company.departments.{d|d.employees.{emp|emp.lastName}}}
+		<programlisting language="Java" role="JAVA">#{company.departments.{d|d.employees.{emp|emp.lastName}}}
 </programlisting>
 		 <para>
 			Nested projections can be slightly tricky, however. The following expression appears to return a list of all employees in all departments:
 		</para>
 		 
-<programlisting>#{company.departments.{d|d.employees}}
+		<programlisting language="Java" role="JAVA">#{company.departments.{d|d.employees}}
 </programlisting>
 		 <para>
 			However, it actually returns a list containing a list of the employees for each individual department. To combine the values, it is necessary to use a slightly longer expression:
 		</para>
 		 
-<programlisting>#{company.departments.{d|d.employees.{e|e}}}
+		<programlisting language="Java" role="JAVA">#{company.departments.{d|d.employees.{e|e}}}
 </programlisting>
 		 <para>
 			This syntax cannot be parsed by either Facelets or JSP, so it cannot be used in XHTML or JSP files. Future versions of JBoss EL may accommodate the projection syntax more easily.




More information about the jboss-cvs-commits mailing list