Hi Kostas,

Are your <h:form> tags included in the jsp file? 

Bruno


On Sat, 19 Mar 2005 14:56:36 +0000, Kostas Karadamoglou
<[EMAIL PROTECTED]> wrote:
> I have also done this. String and then parse it. But it doesn't work. I
> am afraid that the problem is of MyFaces or
> of wrong configuration :-(
> 
> Slawek wrote:
> 
> > i have never tried int and Interer
> > but i have tried int and String witht the same result as You
> >
> > now im using String and String - current selection is ok
> > maybe try Integer and Integer
> > if doesnt help just use String and String + Integer.parseInt() :P
> >
> >
> > Slawek
> >
> >
> >
> >
> >
> >
> > <[EMAIL PROTECTED]> napisaÅ:
> >
> >> Hi again!
> >>
> >> I have a problem with SelectOneMenu, JSF does not set the current
> >> selection of the user.
> >> this is the jsf tags that I use:
> >>
> >> <h:selectOneMenu id="selectCategory"
> >> value="#{eventHandler.selectedCategory}">
> >>         <f:selectItems id="allCategories"
> >> value="#{eventHandler.allCategories}"/>
> >> </h:selectOneMenu>
> >>
> >> the allCategories returns a list of selectItems which contain
> >> java.lang.Integer as object. The
> >> selectedCategory is of type int.
> >>
> >> While I was debugging the application I 've noticed that JSF does not
> >> invoke the setter of
> >> selectedCategory.
> >>
> >> Do you know how canI solve this problem?
> >>
> >> Below I have the getter for each property in the above jsf tags:
> >>
> >>     public int getSelectedCategory() {
> >>         return selectedCategory;
> >>     }
> >>
> >>     public void setSelectedCategory(int selectedCategory) {
> >>         this.selectedCategory = selectedCategory;
> >>     }
> >>
> >>     public List getAllCategories(){
> >>         if(this.allCategories==null){
> >>             this.allCategories=new ArrayList();
> >>             this.allCategories.add(new
> >> SelectItem(converter.getAsInteger(new Category()),"Choose a
> >> category..."));
> >>             List categories=this.eventRegistry.getCategories();
> >>             for(Iterator iter=categories.iterator(); iter.hasNext();){
> >>                 Category category=(Category)iter.next();
> >>                 this.allCategories.add(new
> >> SelectItem(converter.getAsInteger(category), category.getTitle()));
> >>             }
> >>         }
> >>         return this.allCategories;
> >>     }
> >>
> >
> >
> >
> 
>

Reply via email to