Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Shale Wiki" for change 
notification.

The following page has been changed by Hermod Opstvedt:
http://wiki.apache.org/shale/CreatingClayComponents

------------------------------------------------------------------------------
  = Creating Clay components =
  
- There are numerous ready-made components within the JavaServer Faces world. 
These are available in Clay too (There is a tool that maps the tag library 
description;tld into its Clay component counterpart call Tld2ClayCfg), so there 
is normally not a big need for creating own components (from scratch). But in 
many cases you may not be satisfied with what the standard components have to 
offer or you simply want to adapt them to your own special needs or not to 
forget add basic components together to form a new reusable component.
+ There are numerous ready-made components within the Java``Server Faces world. 
These are available in Clay too (There is a tool that maps the tag library 
description;tld into its Clay component counterpart call Tld2``Clay``Cfg), so 
there is normally not a big need for creating own components (from scratch). 
But in many cases you may not be satisfied with what the standard components 
have to offer or you simply want to adapt them to your own special needs or not 
to forget add basic components together to form a new reusable component.
  
  In this tutorial we look at some components that we want to create fro out 
site (we will be making some sub-components too) , amongst others: a person 
registration form,  a news component and a table/list.
  
@@ -42, +42 @@

          <managed-bean-scope>session</managed-bean-scope>[[BR]]
      </managed-bean>[[BR]]
  
- Now we almost have the receiver for the data in place. What we lack is a 
viewcontroller (controller in MVC) for the person registration form. Create a 
bean PersonVC that extends AbstractViewController and has on attribute of type 
Person with respective getter/setter.
+ Now we almost have the receiver for the data in place. What we lack is a 
viewcontroller (controller in MVC) for the person registration form. Create a 
bean PersonVC that extends Abstract``View``Controller and has on attribute of 
type Person with respective getter/setter.
  
  Define it the following in faces-config.xml file
  Definer denne i faces-config.xml
@@ -274, +274 @@

  In addition we also have to declare what the symbol "zipcodesList" is to be 
replaced with when we use it on our page.
  
  The values for such a list must be one of the following types:
- 
[http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/model/SelectItem.html/
  SelectItem, SelectItem[], Collection or Map. W use SelectItem, so you need to 
add the following method to the Post bean:
+ 
[http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/model/SelectItem.html/
  Select"Item Select"Item"["], Collection or Map. W use SelectItem, so you need 
to add the following method to the Post bean:
  
      private void initZipcodesList() {[[BR]]
          zipcodeliste=new !SelectItem[zipcodes.length];[[BR]]

Reply via email to