You need to sign in to do that
Don't have an account?
klab
actionSupport with <apex:detail> tab with inlineEdit set to true
Has anyone ever used actionSupport with the <apex:detail> tag when inlineEdit is set to true? I'm having trouble running the method in the action attribute. It doesn't seem to ever want to run. Code sample below. I've used both "onsubmit" and "onchange" with no results. If any rerender attribute is in there, it just calls the getter and I don't see any debug "testing" line.
Thank you,
Klab
<apex:page standardController="Opportunity" extensions="conExt" tabStyle="Opportunity" title="Opportunity: {!opportunity.name}"> <apex:pageMessages /> <chatter:feedWithFollowers entityId="{!opportunity.id}"/> <apex:form > <apex:pageBlock mode="mainDetail" id="theBlock"> <apex:pageBlockSection showHeader="true" columns="2" collapsible="true"> <apex:outputField value="{!theObject.text__c}"/> </apex:pageBlockSection> </apex:pageBlock> <apex:detail subject="{!opportunity.id}" relatedList="true" title="true" inlineEdit="true"> <apex:actionSupport event="onsubmit" action="{!sampleMethod}" /> </apex:detail> </apex:form> </apex:page>
public class conExt{ //VARIABLES public sObject theObject; public Id objectId {get;set;} //CONSTRUCTOR public conExt(ApexPages.StandardController stdCon){ //default values this.objectId = stdCon.getId(); this.theObject = stdCon.getRecord(); } public sObject getTheObject(){ sObject testObj = [Select Id, text__c from Opportunity where Id = : objectId]; return testObj; } public void sampleMethod(){ system.debug('*****testing'); } }
Thank you,
Klab
You could attach some javascript to your Visualforce save button that locates the inline edit save button and if that exists, clicks it. You'd need to be able to detect that the save has completed and then complete your own save though, which I can only see happening by periodically checking for the inline edit save button disappearing. Also, if you were carrying out a save on the same record with other changes from your visualforce page, you'd need to retrieve the record anew from the database and merge your changes in. Add the fact that if the way that inline editing works were to change then your solution would suddenly stop working, and it doesn't look like a robust solution.
The actionsupport allows you to execute server side actions in response to JavaScript events, such as onclick, mouseover etc, rather than interact with the inline editing capability.