I am using a js tab to look at some values of a device. I am using Ajax.Request within the js to fetch the relevant data. Works ok when I connect to UI4 within my home network. However, when I look at the tab remotely via mios it fails. Anyone an idea how to get this working (if ever possible).
I’ve just tested this again here. If you are just using the JS file that is referenced in the Device.json file for the tab configuration, it works fine for me remotely. The JS loads correctly and content works fine.
I’m using the latest public beta release on my Vera.
In 1.1.1245 the remote loading problem is fixed, so it should work. However, Chris is correct: only the files present in the static Json are loaded.
Actually no custom content is loaded (not even locally), only the files referenced in the static Json or the XML files. The possibility to have custom JS files is a hack, and was added because it was necessary for the Echolabs’ ERGY plugin. There is no support for them in the back-end and everything is done in the UI, that’s why it has issues (actually just one issue and that is the need to click on a tab twice to be rendered).
Edit:@utz: Do you use a browser with FireBug? If that’s the case, can you tell me the HTTP request it makes and if there are any errors in the console?
For me, the AJAX call works fine - it’s the loading of additional files (JS, PNG etc) that doesn’t work. I’m unclear what the path is relative to since the JS file that has the tab code is loaded by some Vera/UI ‘magic’, which is why I chose absolute paths. It might be something worth playing around with though…
I suspect that the MCV model for serving up data remotely is to try and serve from the MiOS server where possible, rather than having to load from the Vera. This does make some sense - MCV probably have a high bandwidth pipe running into their server, and it’s better to serve up content from there rather than having to download it over your ADSL link. The main thing that draws me to that conclusion is for my dataMine plugin I have a new icon which I’ve put into the same place on my Vera as the other icons. This works fine at home, but remotely, I get the X to show the image can’t be found (since it’s being served remotely?).
Thanks. I guess this would also work for JS files, although hosting JS files is slightly more difficult than images…
You’re right - I’ve also used a DOM include hack to include the extra JS files. It would be nice if UI5 had support for UI extensions - additional java libraries, images etc. Maybe adding some includes into the json file might allow them to be downloaded remotely as the ‘main’ JS file is currently?
Well, I think it does not get to this point. I do not see a request/response for the js tab in the console. (I have not used firebug before, so there is the slight probability I am looking at the wrong windows here …). I get request/response for when I go on the device and look at the first non js panel but nothing happens when going on the js panel then.