May try 

replaceing SelectItem select=new SelectItem(null,"Horror");
with SelectItem select=new SelectItem("","Horror");

Apparently Selectitem doesn't like null.
Tim Pyle

On Thu, 2005-03-10 at 13:47, Kostas Karadamoglou wrote:
> Can anyone solve my problem? It is not so difficult! may be I 
> misconceive a basic rule.
> 
> Can you run the following code correctly?
> 
> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
> <%@ taglib uri="http://myfaces.apache.org/extensions"; prefix="x"%>
> 
> <f:view>
> 
>   <h:form id="form">
>       <x:inputCalendar id="date" value="#{eventHandler.selectedDate}" 
> renderAsPopup="true"
>                   popupTodayString="Today String" popupWeekString="Week 
> String" />
>                <h:selectOneMenu id="category" 
> value="#{eventHandler.selectedCategory}">
>          <f:selectItems id="items" value="#{eventHandler.categories}" />
>       </h:selectOneMenu>
>             <h:commandButton id="submit" title="Submit" action="succes"/>
>   </h:form>
> </f:view>
> //-----------------------------------------------------------------------------------------------------------------
>  
> 
> The method:
> 
>   public List getCategories(){
>       ArrayList retValue=new ArrayList();
>       SelectItem select=new SelectItem(null,"Horror");
>       retValue.add(select);
>       select=new SelectItem(new Boolean(true),"Comedy");
>       retValue.add(select);
>       select=new SelectItem(new Boolean(true),"Drama");
>       retValue.add(select);
>       select=new SelectItem(new Boolean(true),"Opera");
>       retValue.add(select);              return retValue;
>   }
> 
> Thank you in advance, Kostas

Reply via email to