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 CedricDumoulin:
http://wiki.apache.org/shale/CreatingClayComponents

The comment on the change is:
Format and typo

------------------------------------------------------------------------------
  
  Here we have defined our reusable components as elements (respecting the 
rendered) and defined actual values to substitute the symbols with.
  
- The last thing we need to do is to as another entry in our menustructure 
awhich is defined in defaultLeftNav.html (in folder pages):
+ The last thing we need to do is to add another entry in our menu structure 
which is defined in defaultLeftNav.html (in folder pages):
  {{{
+ <li>
- <li><a jsfid="commandLink" action="personreg" allowBody="true" 
immediate="true"><span jsfid="outputText" value="#{messages['menu.personreg']}" 
allowBody="false">Personreg</span></a></li>
+   <a jsfid="commandLink" action="personreg" allowBody="true" 
immediate="true"><span jsfid="outputText" value="#{messages['menu.personreg']}" 
allowBody="false">Personreg</span></a>
+ </li>
  }}}
  
- Package, deploy and start the application. The choose Personreg from the 
menu. You should now be presented with this:
+ Package, deploy and start the application. Then choose Personreg from the 
menu. You should now be presented with this:
  
  
  attachment:ShaleClay10.png
  
  
- Enter some values for the different fields and push "Save". Choose one of the 
other pages, and the Personreg again. The data are still there because we 
declared our Poerson bean to have session scope.
+ Enter some values for the different fields and push "Save". Choose one of the 
other pages, and the Personreg again. The data are still there because we 
declared our Person bean to have session scope.
  
  To refine this you can substitute the zipcode field with a combobox that gets 
its values from the Post beans getZipcodes method (This is shown in the 
downloadable finished application). The HTML definition for it is:
  
@@ -292, +294 @@

  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] '''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() {
-         zipcodeliste=new Select``Item[zipcodes.length];
+         zipcodeliste=new SelectItem[zipcodes.length];
-         Select``Item selectItem;
+         SelectItem selectItem;
          for(int i=0; i < zipcodes.length; i++)
          {
-             selectItem=new Select``Item();
+             selectItem=new SelectItem();
              selectItem.setLabel(zipcodes[i].toString());
              selectItem.setValue(zipcodes[i]);
              zipcodesliste[i]=selectItem;
          }
          
      }
- {{{
+ }}}
  
  And add a default constructor to it:
  

Reply via email to