You need to sign in to do that
Don't have an account?
Vandana Rattan
Set Default Values in PageBlockTable Input fields
I have a product Pageblock table. There are some input fields in the table and I need to set default values for these. How can I achieve this? Code is pasted below:-
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.ServiceDate.Label}"> <apex:inputField value="{!s.ServiceDate}" required="false"/> </apex:column> <apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Quantity.Label}"> <apex:inputField value="{!s.Quantity}" style="width:70px" required="true" </apex:column>
You can set the values for fields in constructor of your controller, if you are using a custom controller or an extension.
Another way would be to use javascript to set initial values, but that could be tricky. Controller would be simpler.
All Answers
You can set the values for fields in constructor of your controller, if you are using a custom controller or an extension.
Another way would be to use javascript to set initial values, but that could be tricky. Controller would be simpler.