Genexus como pone fckeditor editor wysiwyg en web en un textbox
Submitted by admin on 11 March, 2008 - 21:22. :: Public
1º descargar fckeditor de su web
2º descomprimir
3º copiar el folder "fckeditor" a la carpeta "images" de nuestro web folder ha sido mi decisión
4º 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.
5º Agregamos un textblock con insert textBlock que llamamos (tbFckEditor) al Web Form y le ponemos la propiedad Format = Raw HTML
6º 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
