We've expanded our news coverage and improved our search! Visit
oreilly.com for the latest or search for all things across O'Reilly!
Article:
 |
|
Build a Dashboard Widget
|
| Subject: |
|
It doesn't work |
| Date: |
|
2007-03-23 20:01:10 |
| From: |
|
jeffclough
|
Response to: It doesn't work
|
|
Some trial and error shows that the output control can only hold up to 366 lines of text. This seems like an odd number, so maybe it's different from system to system (or version to version or whatever). I just used the head command to truncate the output:
if (document.getElementById('programName').value != null) {
var commandLine =
'groff -mandoc -Tascii -P-b -P-c `/usr/bin/man -w "'
+ document.getElementById('programName').value+'"`'
+ ' | head -366 | /bin/cat';
var output = widget.system(commandLine, null);
document.getElementById('outputArea').value = output.outputString;
}
|