Anthem Library and FCKEditor -- How to update?

by Necat Bolpaça 8. October 2008 20:13

I writing a patch for recently finished admin panel, a product entry form.

I used Anthem in its front face and admin panel for user attraction. But FCKEditor's update status being a problem. I decided using Anthem_PreCallBack and Anthem_PostCallBack events in js so update the textarea (asp:TextBox) value with js do i can use at server-side this value. Sounds good, eh?

First, I use this way:

http://www.fckeditor.net/forums/viewtopic.php?f=6&t=4222

 But Firebug alerts, hmm this way doesnt work, i cannot understand why. How strange. How sad.

Then, I use more standard way: API there:

http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API

Example:

-----------------------------------------------------------------------------

function Anthem_PreCallBack()
{ //document.getElementById('<%=textboxSample.ClientID%>').value = //frames[0].objContent.DOM.body.innerHTML; var oEditor = FCKeditorAPI.GetInstance('<%=textboxSample.ClientID%>'); document.getElementById('<%=textboxSample.ClientID%>').value = oEditor.GetHTML(true); } function Anthem_PostCallBack() { //alert(document.getElementById('<%=textboxSample.ClientID%>').value); //frames[0].objContent.DOM.body.innerHTML = //document.getElementById('<%=textboxSample.ClientID%>').value; var oEditor = FCKeditorAPI.GetInstance('<%=textboxSample.ClientID%>'); if(document.getElementById('<%=textboxSampleIsEditing.ClientID%>').value.length>0) { oEditor.SetHTML(document.getElementById('<%=textboxSample.ClientID%>').value); } else { oEditor.SetHTML(""); } }

-----------------------------------------------------------------------------

 

textboxSample is our primary textbox. Other (textboxSampleIsEditing) is for we are in editing status. For example, if we are editing a row in database we dont want Anthem_PostCallBack reset the fields value. I setting this textboxSampleIsEditing value for different from empty string than js dont reset other textbox, get it? Yes its sucks but i cannot run other ways.

Hope this helps. 

Tags: ,

asp.net | English

Comments are closed

Month List

Visitors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

--

Bu sitede yazılı olanlar kendi kişisel görüşlerimdir işverenlerimi ve benimle birlikte çalışanları temsil etmemektedir.