New topic: Loading html from a edit field into HTMLviewer (again)
<http://forums.realsoftware.com/viewtopic.php?t=24929> Page 1 of 1 [ 7 posts ] Previous topic | Next topic Author Message brianheibert.com Post subject: Loading html from a edit field into HTMLviewer (again)Posted: Thu Oct 23, 2008 11:07 am Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA Hi, I have used this code before to load html code from a edit field into a HTMLviewer, and in this program my HTMLviewer is called HelpViewer Code: dim s as string s =xdoc.helpeditor.text xdoc.HelpViewer.LoadPage(s) But when I modified it for my Xdoc application I get this... This method requires more parameters than were passed. and if I do this... Code: dim s as string s = xdoc.helpeditor.text xdoc.HelpViewer.LoadPage(s,"") I get this... Parameters were not compatible with this function. What is wrong with that code? Also I originally had a pagepanel with the editor edit field and another panel with the htmlviewer but that didn't work very well So now I got the edit field set to not visible when htmlviewer is visible and htmlviewer set to not visible when edit field is visible And I have two buttons that switch this. Brian Top mrebar Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Thu Oct 23, 2008 12:31 pm Joined: Wed Feb 15, 2006 1:30 pm Posts: 2229 Location: U.S.A (often) Spokane, Eugene, Pago Pago According to the LR... Code:xdoc.HelpViewer.LoadPage(s) s must be a FolderItem; you're attempting to pass a string. Code:xdoc.HelpViewer.LoadPage(s,"") With two parameters, .LoadPage requires a string and a FolderItem -- again you're attempting to pass an empty string. Michael Top brianheibert.com Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Thu Oct 23, 2008 12:47 pm Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA OK so what if I just want to view the code that is in the edit field as a webpage in the htmlviewer Do I need to save the code somehow? and load it?? _________________ Brian Heibert http://www.brianheibert.net [EMAIL PROTECTED] Top mrebar Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Thu Oct 23, 2008 1:31 pm Joined: Wed Feb 15, 2006 1:30 pm Posts: 2229 Location: U.S.A (often) Spokane, Eugene, Pago Pago Quote:OK so what if I just want to view the code that is in the edit field as a webpage in the htmlviewer Use the two parameter version. Pass it a string and a FolderItem. Michael Top wademaxfield Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Fri Oct 24, 2008 9:43 am Joined: Wed Feb 21, 2007 6:28 pm Posts: 213 Note the folderitem must be a file, not a folder. The documentation is ambiguous. I've created a text file in a temporary directory before, and passed that as the folderitem and it worked. Top mrebar Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Fri Oct 24, 2008 9:46 am Joined: Wed Feb 15, 2006 1:30 pm Posts: 2229 Location: U.S.A (often) Spokane, Eugene, Pago Pago Quote: I've created a text file in a temporary directory before, and passed that as the folderitem and it worked. In brief testing, it appears one can pass a FolderItem that does not exist (and is nil). Michael Top wademaxfield Post subject: Re: Loading html from a edit field into HTMLviewer (again)Posted: Fri Oct 24, 2008 3:14 pm Joined: Wed Feb 21, 2007 6:28 pm Posts: 213 That is not necessarily true. In the Mac, I've found GetFolderItem("") will work, unless the directory returned is not writeable. I've found SpecialFolder.CurrentWorkingDirectory will cause an exception. Putting a file in that directory and pointing the folderitem to it works. In Windows, I've found passing a folder as the FolderItem works. In Linux, I've found that a folder works as a FolderItem. On Windows and Mac, a file is created when the LoadPage() is executed, and it appears to be up to the user to delete the file. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 7 posts ] -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
