Skip to main content

I am trying to load an html file stored relative to the runime folder into the HTML widget using $widgetoperation("loadURL")

I've tried the plain filepath, ./filepath, &filepath, &./filepath, &file://filepath, 

nothing appears to be working. 

Does someone know how to load a relative path into the widget. 

NOTE - I have the thing working at the moment by loading it as a full on URL from the tomcat web-server, and I suppose I could manage this, but I'd prefer a 'local' load. 


I am trying to load an html file stored relative to the runime folder into the HTML widget using $widgetoperation("loadURL")

I've tried the plain filepath, ./filepath, &filepath, &./filepath, &file://filepath, 

nothing appears to be working. 

Does someone know how to load a relative path into the widget. 

NOTE - I have the thing working at the moment by loading it as a full on URL from the tomcat web-server, and I suppose I could manage this, but I'd prefer a 'local' load. 


Hi Iain,

you can read the workdir at runtime with $setting("usys", "[paths]workdir", "USYSDATA").

So you can use

$fieldhandle(HTML.TAB)->$widgetoperation("loadURL","file:%%$setting("usys", "[paths]workdir", "USYSDATA")%%%..\\..\\Programme\\HTML\\%%$componentname%%%.html")

to load your Page.

Regards

Norbert


I am trying to load an html file stored relative to the runime folder into the HTML widget using $widgetoperation("loadURL")

I've tried the plain filepath, ./filepath, &filepath, &./filepath, &file://filepath, 

nothing appears to be working. 

Does someone know how to load a relative path into the widget. 

NOTE - I have the thing working at the moment by loading it as a full on URL from the tomcat web-server, and I suppose I could manage this, but I'd prefer a 'local' load. 


Perhaps :

$fieldhandle(htmlwid)->$widgetoperation("loadURL",$concat("file://",$fileproperties("filepath","FULLPATH")))

Gianni


Perhaps :

$fieldhandle(htmlwid)->$widgetoperation("loadURL",$concat("file://",$fileproperties("filepath","FULLPATH")))

Gianni

This requires a $item("FULLPATH",$fileproperties("filepath","FULLPATH")) but does appear to work. 

As it happens, I then hit an error trying to access stuff on that (complex) web-page. (I'm trying to implement the mozilla PDF.js code, as the default PDF viewer in the HTML5 widget is pants...) So I've reverted to using the web-server on the application server.