You need to sign in to do that
Don't have an account?

"Validation Error: Value is not valid" Error??? URGENT
I have a client who is experiencing the following error on a custom controller and we can't find any solutions.
It's just a selectList with a value tied to a String.
"j_id0:theForm:j_id2:j_id13:j_id14:j_id16:mySolutionOption: Validation Error: Value is not valid"
Any ideas?
Thanks,
Jon
I was able to find a workaround for this issue.
In my case I am using 3 tabs and 2 picklists are used for each tab. So for 3 tabs there are total of 6 picklists.
The issue was values for each pair of picklists were different for each tab. And due to values mismatch it was giving error on tab switch.
So the workaround that I found for this issue is :
I wrote small javascript code that is being called on tab change. Following is the javascript code I used. This refers the picklist and sets its value to empty string :
document.getElementById ('page: myform1:block2:Info1: firstTable: 0:select1').value = '';
document.getElementById ('page: myform2:block2:Info2: secondTable: 1:select2').value = '';
This code just sets the value for each picklist to ' '(Empty String) temporarily. This is the default value for each picklist. So, when the page get loads completely original values overrides this default value and you get the value expected.
This way it does not give any validation error as default value is present in each picklist for each tab.
All Answers
Hi Jon,
Did you find a solution to it. I am facing a similar issue.
Regards
Mukul
No, we never found the solution and the error seems to be sporadic. I'm going to log a case now and see if they can track down the issue.
--Jon
Is this issue has any connection with the "switchType" attribute that we use ??
Currently I am using switchType= "client"
What if I use switchType = "ajax" ??
I was able to find a workaround for this issue.
In my case I am using 3 tabs and 2 picklists are used for each tab. So for 3 tabs there are total of 6 picklists.
The issue was values for each pair of picklists were different for each tab. And due to values mismatch it was giving error on tab switch.
So the workaround that I found for this issue is :
I wrote small javascript code that is being called on tab change. Following is the javascript code I used. This refers the picklist and sets its value to empty string :
document.getElementById ('page: myform1:block2:Info1: firstTable: 0:select1').value = '';
document.getElementById ('page: myform2:block2:Info2: secondTable: 1:select2').value = '';
This code just sets the value for each picklist to ' '(Empty String) temporarily. This is the default value for each picklist. So, when the page get loads completely original values overrides this default value and you get the value expected.
This way it does not give any validation error as default value is present in each picklist for each tab.
We tried the same by using inspect element and given the elementId. Still Im vacing the issue. Could you please guide us if there is any other solution.
Thanks
function MessageRender(Body) {
var MessageBodyHidden2 = Body.options[Body.selectedIndex].value;
var MessageBody = document.getElementById('j_id0:j_id79:j_id80:ComponentForm:j_id90:j_id91:myEmailModal:j_id97:myPanel1:j_id100:MessageBody');
MessageBody.value = MessageBodyHidden2;
Body.options[Body.selectedIndex].value = '';
//updateState();
}
<apex:selectList multiselect="false" id="TemplateList" size="1" value="{!Template2}" onchange="javascript:MessageRender(this)" title="Type" styleClass="form-control">