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

 

Yoganand GadekarYoganand Gadekar

Hi,

 

You should use rendered with a boolean variable and not any text value,

 

<apex:pageBlock rendered="{!selectedList == 'All Contacts'}">  your statement uses picklist value which isnt a boolaean(true false)

 

Try something like this,

IF(selectedList == 'All contacrt'), true,false

 

Thanks,

Avidev9Avidev9
I will have to try this code. Couldnt find any issue here.
Well to add using rendered="{!selectedList == 'All Contacts'}" is perfectly ok. It will return boolean only

Try adding mode="inlineEdit " in your pageBlock. Check if this helps
jvelazquezjvelazquez

Hi,

 

I tried adding inline edit to the page block even that is not working. I have no problem with page block rendering, but the save button not displaying in Inline edit mode.

 

If i remove style="display: none;"  button display even when a field is not edited.  

 

Thanks 

Lavanya

Avidev9Avidev9
Have a look at this link http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inlineEditSupport.htm

I think style="display:none" is not requireds
jvelazquezjvelazquez

Hi,

 

Thanks for your reply, I copy pasted the code which is in the URL link, even that code displays SAVE and Cancel button before inline-editing. 

I could able to hide the save and cancel buttons (when I dint implement page rendering om my page). I donno where I am missing