Presumably by unrequiring it and removing its default None will reappear.
My answer above did not necessarily apply to Visualforce pages -- for questions on the behavior of inputField you should post on the Visualforce development board.
If you are using visualforce pages and inputFields, a solution to this is to use Schema.DescribeFieldResult to retrieve the object field picklist values, and then set up a select list and select options collection based on the retrieved info.
If you are wandering how to do this, I have provided an example in my blog, see here:
My picklist field is a dependent picklist on checkbox. It has two values. If the checkbox is clicked it should be one of the two values. But it shows none also as an option. I am on professional edition. I have made the dependent field required on page layout and selected one of the values as default but still none appears in the picklist values.How can i solve this
All Answers
Hi
I tried what you suggested but I'm still getting the '-- none --' option.
I set the inputField tag as required, the page layout field as required and set the first option as default...
I'm using a custom page to buid this form, is that the problem??
Tnx for any help!
Best regards
PH
Paulo,
I am having exactly the same problem as you, did you ever find a solution and/or work around?
- Brandon
Presumably by unrequiring it and removing its default None will reappear.
My answer above did not necessarily apply to Visualforce pages -- for questions on the behavior of inputField you should post on the Visualforce development board.
If you are using visualforce pages and inputFields, a solution to this is to use Schema.DescribeFieldResult to retrieve the object field picklist values, and then set up a select list and select options collection based on the retrieved info.
If you are wandering how to do this, I have provided an example in my blog, see here:
http://christopheralunlewis.blogspot.com/2010/10/creating-picklist-in-visualforce-page.html
see The Christopher Alun Lewis Blog for Salesforce news, comment and development tips and tricks
Hi-
I know I'm coming late, but I got it to reappear by deleting the default value, and then adding the value back.
I'm assuming it's a meta data update issue of some kind.
add this script and call this class in the vf picklist value
<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'>
</script>
<script language="javascript">
$(function() {
$('select.RemoveNone option[value=]').remove();
});
</script>
My picklist field is a dependent picklist on checkbox. It has two values. If the checkbox is clicked it should be one of the two values. But it shows none also as an option. I am on professional edition. I have made the dependent field required on page layout and selected one of the values as default but still none appears in the picklist values.How can i solve this
add this Javascript and call as styleclass="RemoveNone"
<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'>
</script>
<script language="javascript">
$(function() {
$('select.RemoveNone option[value=]').remove();
});
</script>
<apex:inputfield value="{!somevalue}" onchange="someevent" style="width:80px" styleClass="RemoveNone" id="id"/>
Subramani
Cloudcredence technologies
But I am on professional edition in salesforce. I cannot have apex class