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
MiddhaMiddha 

Inline Editing gets disabled after overriding New/Edit buttons

Hi,

I have enabled inline editing feature in my SFDC instance which works fine for all the objects. I tried overriding New/Edit button on Opportunity  which calls an  S-Control and takes back to the Opportuinty Layout after  processing. Once the S-Control moves back to the Opportunity, Inline Editing feature gets disabled for that opportunity and it doesnt works.

Should we pass on some hidden parameter to the opportunity page while transfering control to the opportunity which keeps that inline editing feture enabled?

Please suggest..

Thanks in advance.


Message Edited by GreatG on 12-20-2007 03:03 AM
Best Answer chosen by Admin (Salesforce Developers) 
grigri9grigri9

Has anyone found a way to enable inline editing when overriding an objects edit button?

 

--Greg

All Answers

cairlinncairlinn
I am having the same issue.
Is this a expected behavior (that should be changed), are we missing something in our code or is this an actual bug?


samdsamd
I am also experiencing this issue.  Does anyone know whether there are any workarounds available?

Sam
grigri9grigri9

Has anyone found a way to enable inline editing when overriding an objects edit button?

 

--Greg

This was selected as the best answer
Adrian-EAdrian-E
I've come very close. I found a javascript which allows doubleclick inline editing functionality. I added this to the Visualforce page and it worked (sort of).
My only problem was that when you doubleclicked and the field became 'editable' you saw the HTML <span> and class attributes in the actual value of the field... I never found a way to overcome this.
Let me know if you're up to the challenge and I'll drop the code in this thread. 
grigri9grigri9

I am a bit swamped right now but I would love to take a look at this. Can you drop the code in and if I make any progress I'll post it back into this thread.

 

--Greg

Adrian-EAdrian-E

Here is the code I found on www.yvoschaap.com

 

 

<script>//script by http://www.yvoschaap.com//XMLHttpRequest class functionfunction datosServidor() {};datosServidor.prototype.iniciar = function() { try { // Mozilla / Safari this._xh = new XMLHttpRequest(); } catch (e) { // Explorer var _ieModelos = new Array( 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP' ); var success = false; for (var i=0;i < _ieModelos.length && !success; i++) { try { this._xh = new ActiveXObject(_ieModelos[i]); success = true; } catch (e) { } } if ( !success ) { return false; } return true; }}datosServidor.prototype.ocupado = function() { estadoActual = this._xh.readyState; return (estadoActual && (estadoActual < 4));}datosServidor.prototype.procesa = function() { if (this._xh.readyState == 4 && this._xh.status == 200) { this.procesado = true; }}datosServidor.prototype.enviar = function(urlget,datos) { if (!this._xh) { this.iniciar(); } if (!this.ocupado()) { this._xh.open("GET",urlget,false); this._xh.send(datos); if (this._xh.readyState == 4 && this._xh.status == 200) { return this._xh.responseText; } } return false;}var urlBase = "update.php";var formVars = "";var changing = false;function fieldEnter(campo,evt,idfld) { evt = (evt) ? evt : window.event; if (evt.keyCode == 13 && campo.value!="") { elem = document.getElementById( idfld ); remotos = new datosServidor; nt = remotos.enviar(urlBase + "?fieldname=" +encodeURI(elem.id)+ "&content="+encodeURI(campo.value)+"&"+formVars,""); //remove glow noLight(elem); elem.innerHTML = nt; changing = false; return false; } else { return true; }}function fieldBlur(campo,idfld) { if (campo.value!="") { elem = document.getElementById( idfld ); remotos = new datosServidor; nt = remotos.enviar(urlBase + "?fieldname=" +escape(elem.id)+ "&content="+escape(campo.value)+"&"+formVars,""); elem.innerHTML = nt; changing = false; return false; }}//edit field createdfunction editBox(actual) { //alert(actual.nodeName+' '+changing); if(!changing){ width = widthEl(actual.id) + 20; height =heightEl(actual.id) + 2; if(height < 40){ if(width < 100) width = 150; actual.innerHTML = "<input id=\""+ actual.id +"_field\" style=\"width: "+width+"px; height: "+height+"px;\" maxlength=\"254\" type=\"text\" value=\"" + actual.innerHTML + "\" onkeypress=\"return fieldEnter(this,event,'" + actual.id + "')\" onfocus=\"highLight(this);\" onblur=\"noLight(this); return fieldBlur(this,'" + actual.id + "');\" />"; }else{ if(width < 70) width = 90; if(height < 50) height = 50; actual.innerHTML = "<textarea name=\"textarea\" id=\""+ actual.id +"_field\" style=\"width: "+width+"px; height: "+height+"px;\" onfocus=\"highLight(this);\" onblur=\"noLight(this); return fieldBlur(this,'" + actual.id + "');\">" + actual.innerHTML + "</textarea>"; } changing = true; } actual.firstChild.focus();}//find all span tags with class editText and id as fieldname parsed to update script. add ondblclick functionfunction editbox_init(){ if (!document.getElementsByTagName){ return; } var spans = document.getElementsByTagName("span"); // loop through all span tags for (var i=0; i<spans.length; i++){ var spn = spans[i]; if (((' '+spn.className+' ').indexOf("editText") != -1) && (spn.id)) { spn.ondblclick = function () { editBox(this); } spn.style.cursor = "pointer"; spn.title = "Click to edit!"; } }}//crossbrowser load functionfunction addEvent(elm, evType, fn, useCapture){ if (elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent){ var r = elm.attachEvent("on"+evType, fn); return r; } else { alert("Please upgrade your browser to use full functionality on this page"); }}//get width of text elementfunction widthEl(span){ if (document.layers){ w=document.layers[span].clip.width; } else if (document.all && !document.getElementById){ w=document.all[span].offsetWidth; } else if(document.getElementById){ w=document.getElementById(span).offsetWidth; }return w;}//get height of text elementfunction heightEl(span){ if (document.layers){ h=document.layers[span].clip.height; } else if (document.all && !document.getElementById){ h=document.all[span].offsetHeight; } else if(document.getElementById){ h=document.getElementById(span).offsetHeight; }return h;}function highLight(span){ //span.parentNode.style.border = "2px solid #D1FDCD"; //span.parentNode.style.padding = "0"; span.style.border = "1px solid #54CE43"; }function noLight(span){ //span.parentNode.style.border = "0px"; //span.parentNode.style.padding = "2px"; span.style.border = "0px"; }//sets post/get vars for updatefunction setVarsForm(vars){ formVars = vars;}addEvent(window, "load", editbox_init);--></script>

 

 The editable fields are then entered as follows

 

<span id="userName" class="editText">John Doe</span>

 

 If you manage to find out how to complete this in a Visualforce page, please let me know

 

Thanks! 

 

 

GauravKumarGauravKumar

Hi

 

I have an same problem. In some objects Inline editing works good but in some object inline editing does not work.

is inline editing not always work ?

or because we hve EDIT button overriden that why inline Edit is disabled

can anyone tell me ?

 

Thanks

samdsamd

If you have overridden the edit button then inline editing will be disabled.

 

Regards

Sam

GauravKumarGauravKumar

Yes I have overridden the edit button

there is no body any possible method to do this ? :(

 

Thanks

Message Edited by GauravKumar on 03-26-2009 08:24 AM
dacologydacology

Yes, this is a shame... hopefully it is just a bug that will get fixed in the next release? But there is an Idea here that need voting for...

 

http://ideas.salesforce.com/article/show/10077982/overriding_edit_does_not_disable_inline_edit 

dmchengdmcheng

I can't believe this problem still exists in March 2012, but it does.  Sigh.

champvimalchampvimal

We are overriding Account and Opportunity Edit page layouts.

 

Inline Editing is not available now on these 2 most important objects in our system. Salesforce, are you hearing? :(

 

 

Thanks,

 

Vimal

KevinSFDCKevinSFDC

Salesforce Support and R&D has determined that reported behavior is "Working As Designed".  Please refer to the following knowledge article:

https://help.salesforce.com/apex/HTViewSolution?id=000004555&language=en_US

DRahlfDRahlf

You can always override the detail page too:

 

<apex:page id="CaseDetail" StandardController="Case" Extensions="CaseDetail" tabStyle="Case" sidebar="true" action="{!Redirect}">
<apex:detail inlineEdit="true" relatedList="true"></apex:detail>

</apex:page>

 

This way you get inline edit back though the detail component, but related lists behave different than on normal page layouts.