UPDATE. Unable to upsert!!
I modified the code in the previous post. Here's the original one....
public class dataTableCon { public List fb;
public List<Feedback__c> getAccounts() {
fb= [SELECT Name,
Description__c,
Importance__c,
Resolution__c,
Status__c,
Owner.name,LastModifiedDate,
(SELECT Comment__c,LastModifiedDate
FROM Feedback_Comments__r)
FROM Feedback__c];
return fb;
}
public PageReference save()
{
upsert fb;
return null;
}
public PageReference del()
{
return null;
}
}
Here's the VF
<apex:page controller="dataTableCon" id="thePage" showHeader="false" standardStylesheets="false" sidebar="false" applyBodyTag="false">
<apex:stylesheet value="{!$Resource.style}"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />
<apex:form >
<apex:dataTable value="{!Accounts}" var="account" id="theTable" bgcolor="lightblue" border="5">
<apex:column >
<apex:repeat value="{!account.Feedback_Comments__r}" var="account">
<apex:inputtext value="{!account.Comment__c}" title="Save after editing comments" size="70" />
</apex:repeat>
</apex:column>
<apex:column>
<apex:pageBlock >
<apex:commandButton action="{!save}" value="Update" style="background-image:url('{!URLFOR($Resource.button)}')" />
<apex:commandButton action="{!del}" value="Delete" style="background-image:url('{!URLFOR($Resource.button)}')"/>
<apex:pageBlockButtons / >
</apex:pageBlock>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>
btnSave
id between theinputtext
andcommandButton
which leads to unexpected results.account.child__r
refers in controller? what you have put invalue
attribute of yourdatatable
?)