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

dynamic picklist
im trying to write a visualforce page where you can create a new custom object project. the field status in object Project is a picklist. i want to be able to make a new picklist value when selecting "--other--" in a drop down. when "--Other--" is selected an inputText should be rendered and you are able to enter the new picklist value from the inputText. My code doesnt seem to work. if u select Other from the dropdown. the inputText does not appear.
<apex:page standardController="Proj__c" tabStyle="Proj__c"> <apex:sectionHeader title="Create Project"/> <apex:form id="Header"> <apex:pageBlock title="General Information" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="2"> <apex:inputField required="true" value="{!Proj__c.Name}"/> <apex:inputField required="true" value="{!Proj__c.Expense_Budget__c}"/> <apex:inputField required="true" value="{!Proj__c.Billable_hours__c}"/> <apex:inputField required="true" value="{!Proj__c.Location__c}"/> <apex:inputField value="{!Proj__c.Status__c}" id="values"> <apex:actionSupport event="onchange" reRender="newvalue" /> </apex:inputField> <apex:outputpanel id="newvalue" > <apex:outputpanel rendered="{!Proj__c.Status__c == '--Other--'}"> <div style="position:relative;left:75px;"> <apex:outputlabel value="new value" for="newval1"/> <apex:inputText value="{!Proj__c.Status__c}" id="newval1"/> </div> </apex:outputpanel> </apex:outputpanel> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Hello,
Please use the below code. I have put <apex:actionregion > tag.
All Answers
Hello,
Please use the below code. I have put <apex:actionregion > tag.
Thanks alot. that worked, but i was wondering why we had to add the actionRegion tag.