0

I have a colum

<apex:column value="{!b.name}" rendered="{!IF(b.account.name = a.account.name,true,false)}"/>

on which i want to do inline editing but I get the error:

must be the direct parent of

When i place th button directly under pageblock I get:

Unknown method accSearchController.save()

Here is my code:

<apex:page Controller="accSearchController" sidebar="false" showHeader="false"> 
<apex:form > 

<apex:pageBlock title="Openlucht Museum ledenbestand"> 

     <apex:pageBlockButtons location="top"> 
         <apex:inputText value="{!searchstring}" label="Input"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <apex:commandButton value="Zoek op naam" action="{!search}"/>&nbsp;&nbsp;
               <apex:commandButton value="Ververs" action="{!clear}"/> 

         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <apex:inputText value="{!searchstringmem}" label="Input"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <apex:commandButton value="Zoek op lidmaatschapnummer" action="{!searchmem}"/>&nbsp;&nbsp;
               <apex:commandButton value="Ververs" action="{!clearmem}"/> 
            </apex:pageBlockButtons> 

<apex:pageblockTable value="{!cont}" var="a"> 
<apex:column value="{!a.account.name}"/> 


    <apex:column >
 <apex:pageblockTable value="{!cont}" var="b"> 
    <apex:column value="{!b.name}" rendered="{!IF(b.account.name = a.account.name,true,false)}"/>
        <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> 

        </apex:pageBlockTable>  

    </apex:column>
        </apex:pageBlockTable>

<apex:pageblockTable value="{!contmem}" var="a"> 
<apex:column value="{!a.account.name}"/> 
<apex:column value="{!a.id}"/> 


</apex:pageBlockTable> 

   <apex:pageBlockButtons > 
                <apex:commandButton value="Edit" action="{!save}" id="editButton" />
                <apex:commandButton value="Save" action="{!save}" id="saveButton" />
                <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
            </apex:pageBlockButtons>  


</apex:pageBlock> 
</apex:form> 

</apex:page>
1
  • As far as I know, for inline support you must use StandardController. Better define your controller as an extension and bind your page with standardController Aug 31, 2017 at 9:10

1 Answer 1

1
<apex:page Controller="accSearchController" sidebar="false" showHeader="false"> 
    <apex:form > 
        <apex:inlineEditSupport event="ondblClick" 
                                showOnEdit="saveButton,cancelButton" 
                                hideOnEdit="editButton" /> 

        <apex:pageBlock title="Openlucht Museum ledenbestand"> 

            <apex:pageBlockButtons location="top"> 
             <apex:inputText value="{!searchstring}" label="Input" style="margin: 0px 6px 0px 8px" /> 
                <apex:commandButton value="Zoek op naam" action="{!search}" style="margin: 0px 2px"/>&nbsp;&nbsp;
                <apex:commandButton value="Ververs" action="{!clear}"/> 

                <apex:inputText value="{!searchstringmem}" label="Input" style="margin: 0px 6px 0px 8px" /> 
                    <apex:commandButton value="Zoek op lidmaatschapnummer" action="{!searchmem}" style="margin: 0px 2px"/>
                    <apex:commandButton value="Ververs" action="{!clearmem}"/> 
                </apex:pageBlockButtons> 

            <apex:pageblockTable value="{!cont}" var="a"> 
                <apex:column value="{!a.account.name}"/> 


                <apex:column >
                    <apex:pageblockTable value="{!cont}" var="b"> 
                        <apex:column value="{!b.name}" rendered="{!IF(b.account.name = a.account.name,true,false)}" >
                            <apex:inlineEditSupport disabled="false" />
                        </apex:column>
                    </apex:pageBlockTable>  

                </apex:column>
            </apex:pageBlockTable>

            <apex:pageblockTable value="{!contmem}" var="a"> 
                <apex:column value="{!a.account.name}">
                    <apex:inlineEditSupport disabled="true" />
                </apex:column>
                <apex:column value="{!a.id}">
                    <apex:inlineEditSupport disabled="true" />
                </apex:column> 
            </apex:pageBlockTable> 

            <apex:pageBlockButtons > 
                <apex:commandButton value="Edit" action="{!save}" id="editButton" />
                <apex:commandButton value="Save" action="{!save}" id="saveButton" />
                <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
            </apex:pageBlockButtons>  


        </apex:pageBlock> 
    </apex:form> 

</apex:page>

Updated your code: I put the inline edit support as a child of the form and not the column. You can turn off inline edit support for columns in columns where you don't want it on. You don't want to put it as a child of the column as it tries to declare it with every iteration - that is not good. you can also use a formula to turn on or off inline edit support for different rows with different values. just set the rendered for the

<apex:inlineEditSupport disabled="false" rendered="{!formula here}" />

OR

<apex:inlineEditSupport disabled="{!formula here}" /> 
  • needs to evaluate to false to be able to edit inline here - can wrap a TRUE formula in NOT() operator for that -->

that should work for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .