I have a standard field called Product Brief Number ({!Product_Brief__c.Name}). This field is Auto Number, after saving it will generate a number. I want show this field when some after click on the save button. Otherwise my page will break.

   <apex:outputText value="{!Product_Brief__c.Name}"></apex:outputText>

   <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Print" onclick="window.print();"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>

Any one have any suggestions How to do that? Thanks


Use rendered attribute in your outputText to show and hide your field.

<apex:outputText value="{!Product_Brief__c.Name}" rendered="{!IF(Product_Brief__c != NULL && Product_Brief__c.Name != NULL,true,false)}">

Provide a id to outputText and rerender this id in your commandbutton

<apex:commandButton value="Save" action="{!save}" rerender="outputTextId"/>

Hope it helps.

  • Thanks for the help, but i don't think this is going to work. Coz I already using rerender properties in my page. If i add above part it will break my page. Thanks again
    – Suneth
    Jul 20 '15 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.