Salesforce无法在具有内联编辑的pageblock表中更改记录后更新记录
我创建了一个搜索查询,返回表中的记录。我在返回的记录中使用了命令,以便编辑它们并仅将它们保存在表中。但在更改表中的记录并单击“保存”按钮后,我无法更新表中的记录。如何使用“rerender”显示更新的数据?我使用的页面代码和控制器操作如下:Salesforce无法在具有内联编辑的pageblock表中更改记录后更新记录,salesforce,apex-code,visualforce,rerender,Salesforce,Apex Code,Visualforce,Rerender,我创建了一个搜索查询,返回表中的记录。我在返回的记录中使用了命令,以便编辑它们并仅将它们保存在表中。但在更改表中的记录并单击“保存”按钮后,我无法更新表中的记录。如何使用“rerender”显示更新的数据?我使用的页面代码和控制器操作如下: <!-- Page --> <apex:pageBlock id="pb1"> <apex:outputPanel id="pan"> <apex:pageBlockTable value="{!l1}"
<!-- 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;}}
//控制器动作
public pagereference save(){update l1;return null;}}
在这里发布您的一些代码会有很大的帮助,但其长短不一之处在于:
<!-- 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"/>
如果执行此操作后仍有困难,请输入页面代码(或相关部分),以便我可以看到发生了什么。我尝试了此操作,但我正在编辑的记录没有更新。
public Pagereference TheSaveAction()
{
// save
return null;
}