myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kurz <michi.k...@gmx.at>
Subject Re: Validation errors when using h:selectManyCheckbox
Date Tue, 25 Mar 2008 07:05:00 GMT
Pavan Shahi schrieb:
> Thanks for your reply.
> Now i have remove all my business logic and simply testing component. 
> But my bad luck continue same error. I have also attached my 
> modified java and jsp file. Please help me i am not able to find any way 
> to come out of this problem  

Ok, the files you provided won't work. You set the list of select items 
in an action method. This might work for the first view of the page (the 
select items should be visible). But as soon as you submit the page and 
don't have the bean in session scope the list of selectable items will 
be lost and an error is raised in the Process Validations Phase. Also 
explains why it works in session scope.

Try to use a getter similiar as the following:

public List<SelectItem> getSkillSetList() {
   if (skillSetList.isEmpty()) {
     skillSetList.add(new SelectItem("1","lab1"));
     skillSetList.add(new SelectItem("2","lab2"));
   }
   return skillSetList;
}

You could also set a breakpoint in your getter method to set what is 
returned when JSF reads the list of options.

regards
Michael

Mime
View raw message