function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jvelazquezjvelazquez 

command button not displaying in inline edit mode for page block table

Hi,

 

I have a requirement where a pageblock table is being rendered based on the picklist value. And the values in the page block table are inline edited. Now my problem is when I try to do inline edit command buttons SAVE and CANCEL are not displaying . If I remove the pageblock rendering then i can see the command buttons. Please see below code

 

Visualforce Page:

 

<apex:actionRegion > 

<apex:selectList value="{!selectedList}" size="1">
<apex:selectOptions value="{!listoptions}"/>
<apex:actionSupport event="onchange" reRender="Panel"/>
</apex:selectList> 
</apex:actionRegion>

 

<apex:outputpanel id="Panel">
<apex:pageBlock rendered="{!selectedList == 'All Contacts'}"> 
<apex:pageBlockButtons >
<apex:commandButton action="{!saveme}" id="saveButton" value="Save" style="display: none;"/> 
<apex:commandButton id="cancelButton" value="Cancel" style="display: none;"/> 
</apex:pageBlockButtons> 
<apex:pageBlockTable value="{!contact}" var="c" rows="50">

<apex:column headerValue="Job Title">
<apex:actionRegion >
<apex:outputField value="{!c.Title}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" />
</apex:outputField>
</apex:actionRegion>
</apex:column>

</apex:pageBlockTable> 
</apex:pageBlock>

</apex:outputpanel>     

 

I am not sure hwre I am missing out. I have gone through many blogs but couldnt find a case for inline editing

Please help me out with this

 

Neha LundNeha Lund

I guess possible solution would be removing the apex:action region or including the apex:action region in the command buttons tags.

Avidev9Avidev9

 Hey...so you are back with the question ?

 

I did a lil research inline edit and here is what I got. The documentation really sucks and the code doesnt actually work.

 

try this(just used the docs to crete a working example)

 

<apex:page standardController="Contact">
    <apex:form >
        <apex:pageBlock mode="inlineEdit">
                <apex:commandButton id="editButton" value="Edit"/>
                <apex:commandButton id="saveButton" value="Save" style="display: none;"/>
                 
                <apex:commandButton id="cancelButton" value="Cancel" style="display: none;"/>
            <apex:pageBlockSection >
                <apex:outputField value="{!contact.lastname}">
                        <apex:inlineEditSupport showOnEdit="saveButton,cancelButton" 
                        hideOnEdit="editButton" event="ondblclick" 
                        changedStyleClass="myBoldClass" />
                </apex:outputField>
                <apex:outputField value="{!contact.accountId}"/>
                <apex:outputField value="{!contact.phone}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Avidev9Avidev9
Tired using rerendering and seems like its not working and there is a bug
jvelazquezjvelazquez

Hi ,

 

Thanks for your help. Yeah itseems to be there is bug .. I cannot find any alternate solution to overcome this