PDA

View Full Version : Help with triggerEvent html



mikeit
April 19th, 2015, 10:05 AM
I am trying to follow the example in the manual with the default triggerEvent html file included in the Girder 6 install. However, nothing shows in the Logger when the button is clicked. Is there perhaps a prerequisite I am missing. Any help or at least pointing in the right direction would be greatly appreciated. Thanks!

Ron
April 20th, 2015, 08:48 AM
If you are using firefox press f12, check the javascript console for errors... also check the network tab to see if you are getting any calls to Girder.

jprovan
May 7th, 2015, 03:39 PM
In /opt/girder/httpd/gir modify triggerEvent.lhtml:

find:

if ( typeof payloads === "object" ) {

the line after it should be:
for ( var i=0; i < payloads.length;i++ ) {

there was a problem with an error in syntax in the javascript.

jprovan
May 7th, 2015, 03:41 PM
Actually, the entire if should be:

if ( typeof payloads === "object" ) {
for ( var i=0; i < payloads.length;i++ ) {

var pldName = 'pld' + (i+1).toString();
var value = encodeURIComponent( payloads[i] );
url += "&" + pldName + "=" + value;
}
}

The payloads were not getting passed properly either.

Ron
May 7th, 2015, 03:57 PM
Thanks for the fix! I've corrected the code here.

mikeit
May 31st, 2015, 09:06 AM
Thanks for the feedback on this. I've been out of town a lot lately, so it's taken me a bit to get back.

As it turned out, the difficulty I was having was a bit different. I had mistakenly opened girder local while girder was running as a service resulting in two instances running at the same time. The HTTP server was running under the service and when the girder local started the HTTP server failed due to the port 80 conflict. The configuration changes I was making existed in the girder local instance that was running. The HTTP triggered events were being recognized by the girder instance running as a service which was unaware of the configuration I had done. I restarted and was able to get it sorted out. Now I'm able to make custom HTML5 remotes that I can access on all my devices.