Skip to main content 3 月 5 日~ 6 日にサンフランシスコで開催される TDX (Salesforce+ でも配信) で「Developer Conference for the AI Agent Era (AI エージェント時代に向けた開発者向けカンファレンス)」にぜひご参加ください。お申し込みはこちら
How can a default value be set in a VF page in a long text feild? Currently the default value set in the object feild for comments__c does not populate when the record is entered from the VF page.

 </apex:tab>

                <apex:tab label="Comments" name="CommentsTab" id="tabComments">

                    <apex:pageBlockSection columns="1" id="CommentsPageBlock">

                        <apex:outputField value="{!Inspection__c.Comments__c}" id="Comments" />

                    </apex:pageBlockSection>

                </apex:tab>

 
11 件の回答
  1. 2015年11月17日 13:55
    In the code you have above, you are using inputTextArea.  You should be using inputField if you want the default value to be presented.  For example

     

    <apex:tab label="Comments" name="CommentsTab" id="tabcomments">

    <apex:pageBlockSection columns="1" id="CommentsPageBlock">

    <apex:inputField value="{!Inspection__c.Comments__c}" id="Comments"/>

    </apex:pageBlockSection>

    </apex:tab>

    If you need to use inputTextArea then you will need to pre-populate the value of Comments__c in your controller with the default value.  You can pull this using the describe methods.
読み込んでいます
0/9000