function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunil PalSunil Pal 

onclick of save button i am getting the following error:

Here is my page.

onclick of save button i am getting the following error
Error: j_id0:j_id4:PbId:init_items: Validation Error: Value is not valid

 Why it is coming i am not getting, please help.

 

=============================================================

<apex:page extensions="SL_createAListController" standardController="Company_List__c">
<apex:sectionHeader title="Create New Conatct List." subtitle="List"/>
<apex:includeScript value="{!URLFOR($Resource.jquery_js)}"/>
<script type="text/javascript">

$(document).ready(function(){

recheckSelectedList();

$('#add_sl_button').click(function() {
add_selected();
});

$('select.select1').dblclick(function() {
add_selected();
});

$('#remove_sl_button').click(function() {
remove_selected();
});

$('select.select2').dblclick(function() {
remove_selected();
});

});

function add_selected()
{
$('select.select1 option:selected').each(function(sIdx, el) {

if($('select.select2 option').length==1 && el.value!='0')
$("select.select2 option[value='0']").remove();

if(el.value!='0' && $('input[type="hidden"][name$="someHiddenKeys"]').val().indexOf(el.value)<0)
$(this).appendTo('select.select2');

if($('select.select1 option').length==0)
$("select.select1").append( $('<option value="0">--None--</option>'));
});

recheckSelectedList();
}

function remove_selected()
{
$('select.select2 option:selected').each(function(sIdx, el) {
if($('select.select1 option').length==1 && el.value!='0')
$("select.select1 option[value='0']").remove();

if(el.value !='0')
$(this).appendTo('select.select1');
if($('select.select2 option').length==0)
$("select.select2").append( $('<option value="0">--None--</option>'));
});

recheckSelectedList();
}

function recheckSelectedList()
{
var sTemp = '';
$('select.select2 option').each(function(sIdx, el) {
if(el.value != '0')
sTemp += (sTemp != '' ? ';' : '') + el.value;
});
$('input[type="hidden"][name$="someHiddenKeys"]').val(sTemp);
}


var isLeftAsc = 1;
function doLeftSort()
{
if(isLeftAsc == 1) {
doSortSelect('select1');
isLeftAsc = 0;
} else {
doSortDescSelect('select1');
isLeftAsc = 1;
}
}

var isRightAsc = 1;
function doRightSort()
{
if(isRightAsc == 1) {
doSortSelect('select2');
isRightAsc = 0;
} else {
doSortDescSelect('select2');
isRightAsc = 1;
}

recheckSelectedList();
}

function doSortSelect ( select_class )
{
var sortedVals = $.makeArray($('select.'+select_class+' option')).sort(function(a,b){
return $(a).text() > $(b).text() ? 1 : $(a).text() < $(b).text() ? -1 : 0 ;
});
$('select.'+select_class).empty().html(sortedVals);
}

function doSortDescSelect ( select_class )
{
var sortedVals = $.makeArray($('select.'+select_class+' option')).sort(function(a,b){
return $(a).text() > $(b).text() ? -1 : $(a).text() < $(b).text() ? 1 : 0 ;
});
$('select.'+select_class).empty().html(sortedVals);
}

function doMoveUp( select_class )
{

var i = 0;
$('select.'+select_class+' option').each(function(sIdx, el) {
val = el.value;
txt = el.text;

if(el.selected){
if(sIdx > 0) {
var oElem =$(this).prev();
//alert(oElem.selected);
//oElem.is(':selected')
//alert(oElem.is(':selected'));
if(oElem!=null && !oElem.is(':selected'))
$(this).remove().insertBefore(oElem);
}
}

i+=1;
});

recheckSelectedList();
}

function doMoveDown( select_class )
{

var i = 0;
$('select.'+select_class+' option').each(function(sIdx, el) {
val = el.value;
txt = el.text;

if(el.selected){
if(sIdx < $('select.'+select_class+' option').size()-1) {
var oElem =$(this).next();
if(oElem!=null && !oElem.is(':selected'))
$(this).remove().insertAfter(oElem);
}
}

i+=1;
});

recheckSelectedList();
}

</script>
<apex:form >
<apex:pageblock Id="PbId">
<apex:actionfunction name="funChangeUserOrGroup" action="{!fetchUserOrTGroupPicklistValues}" rerender="idLeftPicklist, idRightPicklist"/>
<apex:pageMessages id="ErrorMessageId"/>
<table align="center" border="" width="100%">
<tr>
<td align="left" width="20%">
<b>List Name:</b>
</td>
<td align="left" width="20%">
<apex:inputfield value="{!objList.Name}" />
</td>

<td width="20%" align="right">
<b>Share My List With:</b>
</td>
<td width="20%">
<apex:selectList id="idUserOrGroup" value="{!strUserOrGroup}" size="1" onchange="funChangeUserOrGroup();">
<apex:selectOption itemValue="None" itemLabel="--None--"/>
<apex:selectOption itemValue="Group" itemLabel="Group"/>
<apex:selectOption itemValue="User" itemLabel="User"/>
</apex:selectList>
<!-- <apex:Inputfield value="{!objList.Share_With__c}" /> -->
</td>
</tr>

<tr>
<td>
<b>Show In Quick Add:</b>
</td>
<td>
<apex:inputfield value="{!objList.Show_in_Quick_Add__c}" />
</td>
<td width="20%" align="right">
<b>Share With: </b>
</td>

<td width="20%">
<!-- <c:SL_LIB20_component_Multiselect in_list_opt="{!lstUserOrGroup_Input}" out_list_opt="{!lstUserOrGroup_Output}" out_str_ids="{!BaseParam}" /> -->
<apex:inputHidden value="{!sHiddenKeys}" id="someHiddenKeys" />

<table style="border:0">

<tr>
<td align="center">
<b>Available</b>
</td>
<td>
</td>
<td align="center">
<b>Selected</b>
</td>
<td>
</td&gt..
onclick of save button i am getting the following error
Error: j_id0:j_id4:PbId:init_items: Validation Error: Value is not valid

 Why it is coming i am not getting, please help.

Thanks

Avidev9Avidev9
Make sure that the variable "objList" is initialised.

By doing something like objList = new YourObject__c();
Sunil PalSunil Pal

Thanks for your reply.

Yes,I have initialised in controller.This error Id is same for the multiselect picklist option.

Avidev9Avidev9
Can you highlight that in the code ?