2012-01-31 13 views
0

テーブル内のレコードを返す検索クエリを作成しました。私は返されたレコードでコマンドを使用していますので、それらを編集してテーブルに保存することができます。しかし、テーブルのレコードを変更してSAVEボタンをクリックした後、テーブルのレコードを更新することができません。更新されたデータを表示するにはどうすればよいですか?あなたのコードの一部を投稿Salesforce-インライン編集のページブロックテーブルで変更後のレコードを更新できません

<!-- Page --> 
<apex:pageBlock id="pb1"> 
    <apex:outputPanel id="pan"> 
    <apex:pageBlockTable value="{!l1}" var="k" rendered="{!flag}" id="pb"> 
     <apex:column value="{!k.First_Name__c}"/> 
     <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> 
     <apex:column value="{!k.Last_Name__c}"/> 
     <apex:inlineEditSupport event="ondblclick" showOnEdit="save"/> 
     <apex:column value="{!k.E_mail__c}"/> 
     <apex:inlineEditSupport event="ondblclick" showOnEdit="save"/> 
     <apex:column value="{!k.Employee_ID__c}"/> 
     <apex:commandButton action="{!save}" id="saveButton" value="Save" /> 
    </apex:pageBlockTable> 
    </apex:outputPanel> 

    <apex:commandButton action="{!edit}" id="editButton" value="Edit"/> 
    <apex:commandButton action="{!save}" id="saveButton" value="Save"/> 
    <apex:actionSupport event="onclick" rerender="pan" status="refreshstatus"/> 
    <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/> 
    <apex:actionStatus id="refreshstatus" startstyle="color:green;" startText="Saving...."> 
    </apex:actionStatus> 
</apex:pageBlock> 

// controller action 
public pagereference save(){update l1;return null;}} 

答えて

1

ここで長い道を行くだろうが、長いとそれの短いはこれです::私が使用しているページコードとコントローラのアクションは以下の通りです

<!-- put your table in a panel with an ID --> 
<apex:outputPanel id="thePanel:> 
    <!-- put your table here --> 
</apex:outputPanel> 

<!-- specify the panel's ID as the rerender target for the action --> 
<apex:commandButton value="Save" action="{!TheSaveAction}" rerender="thePanel"/> 

それでもページコード(またはrに入れ、これを実行した後に苦労している場合は

public Pagereference TheSaveAction() 
{ 
    // save 
    return null; 
} 

:そして、あなたのコントローラがnullの値でPagereferenceを返すことを確認してください私は何が起こっているか見ることができます。

+0

私はこれを試しましたが、編集中のレコードは更新されていません。 – aset01

関連する問題