Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSF and the fly likes <h:selectManyListbox giving problem while submitting. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "<h:selectManyListbox giving problem while submitting." Watch "<h:selectManyListbox giving problem while submitting." New topic

<h:selectManyListbox giving problem while submitting.


Joined: Apr 21, 2008
Posts: 18

I am using <h:selectManyListbox control. I have list of names. On click on a button i am passing the selected contacts to another selectmanylistbox using javascript.

when I submit i am getting below error.

sourceId=emailTemplate_1:emailTemplateForm:toList[severity=(ERROR 2), summary=(emailTemplate_1:emailTemplateForm:toList: Validation Error: Value is not valid), detail=(emailTemplate_1:emailTemplateForm:toList: Validation Error: Value is not valid)]

here is the code snippet:

<h:selectManyListbox id="contactRoleList" size="10" value="#{emailTemplateBean.rolesList1}" style="width:200px">
<f:selectItems value="#{emailTemplateBean.list11}" /> - > getting data from backing bean.

<button type="button" name="addTO" value="Add to Send List" onclick="javascript:processChange(this)">Add to Send List</button>

<h:selectManyListbox id="toList" size="6" value="#{emailTemplateBean.rolesList2}" style="width:200px">
<f:selectItems value="#{emailTemplateBean.list22}" /> - > list22 initialized at backing bean. - this will be having the data from first list box.

on submit i am getting above mentioned error.

can you please help me in this.. i struckup here...

here is the javascript code.

if($("#emailTemplate_1\\:emailTemplateForm\\:contactRoleList option:selected").length>0)
$("#emailTemplate_1\\:emailTemplateForm\\:contactRoleList option:selected").appendTo('#emailTemplate_1\\:emailTemplateForm\\:toList');

I agree. Here's the link:
subject: <h:selectManyListbox giving problem while submitting.
It's not a secret anymore!