Genexus como pone fckeditor editor wysiwyg en web en un textbox

Submitted by admin on 11 March, 2008 - 21:22. ::

descargar fckeditor de su web

descomprimir

copiar el folder "fckeditor" a la carpeta "images" de nuestro web folder ha sido mi decisión

Imaginemos entonces que tenemos un atributo de tipo Long VarChar (TrnBody) y que queremos utilizar el editor en el Web Form de la transacción que utilizamos para ingresar ese dato.

Agregamos un textblock con insert textBlock que llamamos (tbFckEditor) al Web Form y le ponemos la propiedad Format = Raw HTML

En el evento Start del objeto agregamos el siguiente código:

Event Start
    &webappname = "poner el virtual_dir_name en caso de .NET o web_app_name en caso de Java"
    &BasePath = '/' + &webappname.Trim() + '/images/fckeditor/'  
    Form.JScriptSrc.Add("en mi caso es images/fckeditor/fckeditor.js")
    tbFckEditor.Caption = "<SCRIPT type=text/javascript>" + newline()
    tbFckEditor.Caption += "var oFCKeditor = new FCKeditor( '" +     TRNBODY.InternalName + "');" + newline()
    tbFckEditor.Caption += "oFCKeditor.BasePath = '" + &BasePath + "';" + newline()
    tbFckEditor.Caption += "oFCKeditor.Height = 400;" + newline()
    tbFckEditor.Caption += "oFCKeditor.Value = oFCKeditor._HTMLEncode(document.getElementById('" + TRNBODY.InternalName + "').value);" + newline()
    tbFckEditor.Caption += "oFCKeditor.ReplaceTextarea();" + newline()
    tbFckEditor.Caption += "</SCRIPT>" + newline()
EndEvent