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 ------------------------------------------------------------------------------ As you can see we have tied the values of the attributes to symbols (identified by @). This means that we do not have to worry about the actual values of these now, but handle that when we use the component. - Lets now try to define the first panel, which is the name panel. As we said earlier there are a lot of ready-made component libraries for us to choose from. We are now going to use one of these. It is know as [http://myfaces.apache.org/tomahawk/index.html/ Tomahawk and comes from the [http://myfaces.apache.org/ MyFaces project. The component that we are going to use is the [http://myfaces.apache.org/tomahawk/htmlTag.html/ htmlTag. This is a component that will render any HTML tag that you specify as a value. To be able to use this, you need to download it and install it into you project. How you do this depends on whether you are using the Maven2 plugin, Maven2 by it self or not at all. The important thing is that you get the tomahawk jar file in the WEB-INF/LIB when you deploy your application(if itâs a standalone WAR). We base our application on the latest version which is currently 1.5-SNAPSHOT. Next is to make Clay aware of the components. You do that by adding the a ttachment:tomahawk-1.1.5-SNAPSHOT-config.xml Clay configuration file to your WEB-INF folder. Then change the following section in the web.xml file: + Lets now try to define the first panel, which is the name panel. As we said earlier there are a lot of ready-made component libraries for us to choose from. We are now going to use one of these. It is know as [http://myfaces.apache.org/tomahawk/index.html/ Tomahawk] and comes from the [http://myfaces.apache.org/ MyFaces project]. The component that we are going to use is the [http://myfaces.apache.org/tomahawk/htmlTag.html/ htmlTag]. This is a component that will render any HTML tag that you specify as a value. To be able to use this, you need to download it and install it into you project. How you do this depends on whether you are using the Maven2 plugin, Maven2 by it self or not at all. The important thing is that you get the tomahawk jar file in the WEB-INF/LIB when you deploy your application(if itâs a standalone WAR). We base our application on the latest version which is currently 1.5-SNAPSHOT. Next is to make Clay aware of the components. You do that by adding th e attachment:tomahawk-1.1.5-SNAPSHOT-config.xml Clay configuration file to your WEB-INF folder. Then change the following section in the web.xml file: <!-- Clay Common Configuration Resources -->[[BR]] <context-param>[[BR]] @@ -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/ Select``Item Select``Item``[``], Collection or Map. We use Select``Item, 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/ SelectItem] '''SelectItem[]''', Collection or Map. We use Select``Item, so you need to add the following method to the Post bean: private void initZipcodesList() {[[BR]] zipcodeliste=new Select``Item[zipcodes.length];[[BR]]
