Use of <s:selectItems> in JBoss Seam

In JSF (JavaServer Faces), the use of a SelectList or SelectMenu is combined with the use of a List<SelectItem> in a backing bean. Most of the times you already have a list wih the items to choose from, and have to rewrite that list to selectItems. And then add a way in your backing bean to set the selected item when the form is send. With JBoss Seam it’s completely coverered in the framework:


   
          

With only this in your JSF page, combined with a standard entity manager bean (extension of EntityHome class, part of the Seam apllication framework):

public class EHome extends EntityHome {
}

The <s:convertEntity /> automagically converts a standard list into a SelectItem list, and the does all the plumbing of setting the selected object in instance.var, according to the selected item from the SelectItem list.

C# versus Java

Ik ben bezig in het kader van een opdracht om een hoop informatie over de verschillen en overeenkomsten tussen Java (5) en C# op te zoeken. En heb daar een hele berg aan informatie gevonden:

  • http://www.suite101.com/article.cfm/c_sharp/92073
  • http://www1.cs.columbia.edu/~eaddy/publications/csharpvsjava-eaddy-ddj-feb01.pdf
  • http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=76
  • http://tweakers.net/nieuws/20163/Java-uitvinder:-Microsofts-C-slaat-de-plank-mis.html
  • http://searchvb.techtarget.com/tip/0,289483,sid8_gci880182,00.html

Binnenkort zal het artikel hier te lezen zijn… nun nog niet.