1

I have a visualforce page with two buttons. When I navigate off the page and then return to the page, the Edit button is not visible. If I refresh the page, the Edit button becomes visible. The View button has the same attributes and does not disappear. The buttons are the same with the exception of the action they call.

Any ideas on why the edit button would not display and the view would?

Thanks!

Fred

<apex:pageBlockTable value="{!ieList}" var="ie" >
            <apex:column headerValue="Edit">
                <apex:commandButton value="Edit" action="{!Edit}" reRender="EntirePage1"  status="overlayStatus" immediate="True">
                    <apex:param name="ieId" value="{!ie.Id}" assignTo="{!ieId}"/>
                 </apex:commandButton>
            </apex:column>

            <apex:column headerValue="View">
                <apex:commandButton value="View" action="{!View}" reRender="EntirePage1"  status="overlayStatus" immediate="True">
                    <apex:param name="ieId" value="{!ie.Id}" assignTo="{!ieId}"/>
                 </apex:commandButton>
            </apex:column>

                <apex:column headerValue="Delete">
                    <apex:inputField value="{!ie.Delete__c}" />
                </apex:column>
                <apex:column headerValue="Employee" styleclass="employeename">
                  <apex:outputField value="{!ie.Employee__c}" />                    
                </apex:column>
                <apex:column headerValue="Confirm Mismatch AM"><apex:outputField value="{!ie.Confirm_Mismatch_AM__c}" /></apex:column>
                <apex:column headerValue="Covered By">
                    <apex:outputField value="{!ie.Covered_By__c}" />
                </apex:column>
                <apex:column headerValue="Employee Manager"><apex:outputField value="{!ie.Employee_Manager__c}" /></apex:column>
                <apex:column headerValue="Lock Incented Manager"><apex:outputField value="{!ie.Lock_Incented_Manager__c}" /></apex:column>
                <apex:column headerValue="Confirm Mismatch Manager"><apex:outputField value="{!ie.Confirm_Mismatch_Manager__c}" /></apex:column>
                <apex:column headerValue="Member Credit Type"><apex:inputField value="{!ie.Member_Credit_Type__c}" /></apex:column>                                        
                <apex:column headerValue="Member Lock In"><apex:inputField value="{!ie.Member_Lock_In__c}" /></apex:column>
                <apex:column headerValue="Member Credit Percentage"><apex:inputField value="{!ie.Member_Credit_Percentage__c}" /></apex:column>
                <apex:column headerValue="Current Enrollment Date"><apex:outputField value="{!ie.Current_Enrollment_Date__c}" /></apex:column>
                <apex:column headerValue="Member Credit"><apex:outputField value="{!ie.Member_Credit__c}" /></apex:column>

           </apex:pageBlockTable>  
0

You are not seeing the Edit commandButton because you are using the standard Edit actionMethod from standard controller. And Edit and Delete standard actionMethods works only when you have an ID specified in the URL. This is because, without ID it would not have which record to edit or delete. That is the reason, these buttons does not appear without ID.

So, when you are initially on the page, you would be seeing the Edit button because you must be having the ID in the URL and then when you navigate off and return back to the page, your ID from the URL must have been removed, hence Edit button disappears.

So to fix this issue, from wherever you are navigating to this visualforce page, you should make sure that you always pass the record's ID in URL.

URL when navigating to your visualforce page should be :

yourdomain.visual.force.com/apex/yourpageName?id=recordId

  • Thank you so much for our response!! I actually thought I was using a custom action on the button but using the standard edit in the button was causing me the issue. Updating the name of my custom method fixed the issue. Thank you so much for your help!!!! – Fred May 15 at 13:06
  • Glad to help you – Vijay Ganji May 15 at 13:27

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.