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
sravanthi_84sravanthi_84 

Update a list vew

Hi All,

          I have a small problem with my controller. I am trying to get values from a custom object  and trying to update the values. But it is not working fine. I have paste the visualforce code and the controller below:

 

 

<apex:page standardcontroller="Case" sidebar="false" showHeader="false" extensions="SubmitCaseController">
             
                           
       <apex:outputPanel styleClass="box1" style="border-style:none;border-widht:0px;background-color: #FFFFFF;margin-top:35px" >        
 
         <apex:outputPanel styleClass="box1" style="border:none">
    <apex:dataTable columns="2" id="firstbox1" value="{!List}" var="p" rendered="{!(List!=null)}">
        <apex:column styleClass="c1">
            <apex:outputtext value="Profile Name"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.Name}" style="width:250px"/>
        </apex:column>
        <apex:column styleClass="c1">
            <apex:outputtext value="Operating System"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.operating_system__c}" style="width:250px"/>
        </apex:column>
        <apex:column styleClass="c1">
            <apex:outputtext value="Application Development Language"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.Application_Development_Language__c}" style="width:250px"/>
        </apex:column>
        <apex:column styleClass="c1">
            <apex:outputtext value="Database"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.Database__c}" style="width:250px"/>
        </apex:column>
        <apex:column styleClass="c1">
            <apex:outputtext value="Web Server"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.Web_Server__c}" style="width:250px"/>
        </apex:column>
        <apex:column styleClass="c1">
            <apex:outputtext value="Servlet Engine"/>
        </apex:column>
        <apex:column styleClass="c2">
            <apex:inputtext value="{!p.Servlet_Engine__c}" style="width:250px"/>
        </apex:column>
         <apex:column styleClass="bbox1">
                                                     <apex:column styleClass="bbox1">
              
<apex:commandButton value="Update" action="{!Save}" />
               </apex:column>
    </apex:dataTable>               
</apex:outputPanel>    
                     </apex:outputPanel>
        </apex:form>
   </apex:outputPanel>
</apex:page>

 

My controller is as follows:

 

public abstract class SubmitCaseController {

   
    public SubmitCaseController(ApexPages.StandardController controller) {
           }
    
   public List<Customer_Profile__c> cList{get;set;}
                 
   public PageReference Save(){
             update cList;
             return null;
   }
  
    
      public List<Customer_Profile__c> getList(){     
        cList = [select Id,Name,Application_Development_Language__c,Database__c,operating_system__c,Servlet_Engine__c,Web_Server__c from Customer_Profile__c where Account__r.Name =:accName];
              return cList;
    }        
    
     }

 

 

Can anyone please help me with this issue. Thanks in advance.

ScoobieScoobie

What error messages are you getting?

sravanthi_84sravanthi_84

It is not giving any error message.

Jeremy_nJeremy_n

I don't see a setList(list<Customer_Profile__c>) method, so that may be the problem. It also seems like calling your custom method things like "save()" can be problematic. I would try those two things, and see if it helps. If not, can you describe your problem more specifically? What is it not doing?

 

Jeremy

sravanthi_84sravanthi_84

I have a custom object called Customer Profile that is associated with Account object. In the visualforce page I am trying to display the records of the custom object of a particular account. For this I am using the <apex:dataTable> and listing the values.

 

Then if a user want to change any value of the record, they can change it and click on the update button to update that particular record.

 

So the update function is not working properly for me. I am not getting any kind of error message.