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
John NeffJohn Neff 

Having trouble adding In-Line Edit Support to a controller and VF page - can anyone help?!

Hello, 

I have a controller that I use to dynamically group opportunities by a picklist field and display them on a VF page, and I would like to add the ability for my users to edit the opportunities from the page but I am having trouble getting it all to fit together. Can anyone help?

Here is my controller: 
 
public with sharing class QualOpController
{

public List <Opportunity> Opty {get;set;}
public list<String> campaigns {get;set;}

public PageReference saveOp(){
    UPDATE Opty;
    return null;
    }

 public String getName(){
        return 'QualOpController';
        }

public void load() 
{
  campaigns= new List<String>();
  Opty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; 
  
  Set<String> campaignSet = new Set<String>();
  for (Opportunity j : Opty)
      campaignSet.add(j.Vert_Med__c);
      
      for (String campaign : campaignSet) 
      {
            campaigns.add(campaign);
      }
      campaigns.sort();
    }
}

I think it has something to do with my variable being a string?

Here is the pageblock where I am displaying the data:
<apex:repeat value="{!campaigns}" var="camp">

    <apex:form >
    <apex:pageBlock title="{!camp}" mode="inlineedit">
        <table cellpadding="5" style="border-collapse: collapse;table-layout:fixed" width="1080" border="1" class="sortable" >
                
                <thead>
                <tr>
                              <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Opportunity Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Company Name</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="80">
                        <b>Contract Sent</b>
                                   
                    
                    </th>
                     <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b>Days Idle</b>
                    </th>
                                 
                    <th style="background-color: #C6D4D4; color: #040404" width="70">
                        <b>Created</b>
                    </th>
        <th style="background-color: #C6D4D4; color: #040404" width="450">
                        <b>Next Step</b>
                    </th>
                  
                    <th style="background-color: #C6D4D4; color: #040404" width="50">
                        <b><apex:commandLink reRender="button" onclick="window.open('/apex/Probability_Guide','','width=500,height=300')" id="button">Prob%</apex:commandLink></b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Owner</b>
                    </th>
                    <th style="background-color: #C6D4D4; color: #040404" width="100">
                        <b>Stage</b>
                    </th>
                
                </tr>
                </thead>
                
                 <apex:repeat value="{!Opty}" var="cs"> 
                 
                  <apex:outputPanel rendered="{!IF(camp=cs.Vert_Med__c,true,false)}" >
                  <tbody>
                      <tr>
                                  
                            <td width="100">
                                <a href="https://na2.salesforce.com/{!cs.id}">{!cs.name}</a>
                            </td>  
                              <td width="100">
                                {!cs.Company_Name__c}
                            </td> 
                                <td width="80">
                            
                               <apex:outputField value="{!cs.Contract_SENT__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                          
                           
                            <td width="50">
                                {!cs.Days_Since_Last_Modified__c}
                            </td>
                            <td width="70">
                                 {!MONTH(DATEVALUE(cs.CreatedDate))}/{!DAY(DATEVALUE(cs.CreatedDate))}/{!YEAR(DATEVALUE(cs.CreatedDate))}
                            </td>
                            
                            <td width="450">
                                <apex:outputField value="{!cs.Next_Step__c}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                
                           
                             <td width="50">
                                <apex:outputField value="{!cs.Probability}" >
                                     <apex:inlineEditSupport event="ondblclick" showOnEdit="saveButton, cancelButton" />
                                </apex:outputField>
                            </td>
                            <td width="100">
                                {!cs.Owner_Name__c}
                            </td>
                            <td width="100">
                                {!cs.StageName}
                            </td>
                          
                        </tr>
                     </tbody>
                      </apex:outputPanel>
                     </apex:repeat>
                     </table>
                     
                     <apex:commandButton action="{!saveOp}" value="Update Opptys"/>  
    </apex:pageBlock>
    </apex:form>
            <br/>
  </apex:repeat>

Is there any hope for me??

Thanks in advance!

John