- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2014 03:25 AM
Hi,
Is there any possibility to convert a textarea in UI Page to htmlArea?If yes then please share how to achieve this.
Sami.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2014 08:17 AM
Sami,
I was able to get this to work in a demo instance. First, nicEdit needs to be saved as a "UI Script", not a "Script Include". Then, the client script portion should just be calling the bkLib function and does not need to be in a separate function. Just use: bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2014 07:11 AM
I tried using NicEdit - WYSIWYG Content Editor, Inline Rich Text Application.
Below is my UI Page code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
<html>
<head>
<title>Demo 1 : Convert All Textareas</title>
</head>
<body>
<div id="menu"></div>
<div id="intro">
By calling the nicEditors.allTextareas() function the below example replaces all 3 textareas on the page with nicEditors. NicEditors will match the size of the editor window with the size of the textarea it replaced.
</div>
<br />
<div id="sample">
<h4>First Textarea</h4>
<textarea name="area1" cols="40"></textarea>
<h4>Second Textarea</h4>
<textarea name="area2" style="width: 100%;">
Some Initial Content was in this textarea
</textarea>
</div>
</body>
</html>
</j:jelly>
I am calling nicEditors.allTextAreas() function in script include through client script but textarea are not converted to htmlarea.Below is the client script in ui page.
addLoadEvent(loadMe);
function loadMe(){
//alert('Loading');
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
Can any one please help me to trace where is the mistake?
Sami.
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2014 08:17 AM
Sami,
I was able to get this to work in a demo instance. First, nicEdit needs to be saved as a "UI Script", not a "Script Include". Then, the client script portion should just be calling the bkLib function and does not need to be in a separate function. Just use: bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2014 12:21 PM
Thanks John,It is working with UI Script but it's not showing the toolbar icons.
I attached nicEditorIcons.gif to UI Script and then updated the iconsPath : '../nicEditorIcons.gif' in the script with the sys_id of the attached gif.Also I tried uploading the image and passed the complete url https://sandbox.service-now.com/nicEditorIcons.gifx but it didn't worked.
Any further help in this regard will be highly appreciated.
Thanks,
Sami.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2014 12:29 PM