• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting validation error in jsf1.2 for h:selectManyListbox

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
when i try to select multilist box and click on submit ,displaying an error sourceId=assignRoleForm:list2[severity=(ERROR 2), summary=(assignRoleForm:list2: Validation Error: Value is not valid), detail=(assignRoleForm:list2: Validation Error: Value is not valid)]

my .xhtml code as follows

<td>

<h:selectManyListbox style="width: 210px;" id="list2" size="10"
value ="#{userRoleMappingManager.selAssgnedRoleList}">
<f:selectItems value="#{userRoleMappingManager.assignedRoleList}" />
</h:selectManyListbox>
</td>


</tr>
<tr>
<td> <a4j:commandButton
styleClass="cmdButton ui-button ui-widget ui-state-default ui-corner-all"
id="assignRoleMngerBtn2" value="Assign"
action="#{userRoleMappingManager.assignUserToRole}"
onclick="showBusyMask('Searching Role ...');"
oncomplete="jQuery('#tabs-2 :button').button();hideBusyMask();"
reRender="resultMsg,assignRoleForm ">
</a4j:commandButton>
</td>
</tr>


And my java class

public class UserRoleMappingManager {

private static final Logger LOG = Logger.getLogger(UserRoleMappingManager.class);

private RoleMappingDao roleMappingDao;
private List<SelectItem> availableRoleList = new ArrayList<SelectItem>();
private List<SelectItem> assignedRoleList = new ArrayList<SelectItem> (); // with setters and getters
private List<String> selectedRoleList ;
private List<String> selAssgnedRoleList;

i passing and retreving the string as key for mulilist box but still i face the error,Can any provide help
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Garlapati!

There is a "Code" button in our message editor. You can use it to make your Java code and XML samples easier to read.

The usual cause of a validation error in a JSF selection control is that the value isn't being found in the selection list. One common cause for that is if you use Request Scope for the JSF backing bean that contains the selection list model data.

Request scope is almost totally useless in JSF.
reply
    Bookmark Topic Watch Topic
  • New Topic