Workflow error exists in HTML5 but not Silverlight viewer
I'm getting an error when I run one of my workflows in the HTML5 viewer. I run the same workflow in the Silverlight viewer and get no errors. Is anyone else having this issue?
We're using Geocortex 4.3; Silverlight & HTML5 2.4 viewers.
/customer/servlet/servlet.FileDownload?file=00P6000000eltkMEAQ
I also have another workflow with the same issue but a different error. It runs in SL but not HTML5. It's error is "There was a workflow error running activity: Cannot read property 'supportsDynamicLayers' of null".
Any ideas would be appreciated!
Best,
JD
-
JD,
Were you able to figure this out, I'm getting the exact error. It works fine in SL viewer and in the simulator but I get the error in HTML5.
Thanks
Pablo
0 -
Unfortunately, no.
0 -
Hi Folks,
I think this error is due to a behavioral difference between the Silverlight and HTML5 viewers.
The return type for a multiple-selection list box is a "List of objects". Silverlight and WPF (the simulator) represent this as a generic List of Objects. HTML5 represents it as an array of Objects.
So, if you built your workflow with the Silverlight viewer, you would have been able to cast the return type from a form to a List<Object>.
There should be a way to handle either viewer without a problem. Both structures are enumerable so you should be able to either add their contents to a new array of known type, or convert them to a common type. Off the top of my head, I don't know exactly how to do that, but we'll see if we can find someone to provide some answers.
Regards,
-Malcolm
0 -
You can use the Cast<T> activity to cast to either:
-
System.Collections.Generic.IList<System.Object>
-
System.Collections.Generic.IEnumerable<System.Object>
The help documentation does indicate this on the Form Items page, but it isn't very obvious.
--Ryan
0 -
-
Thanks Ryan/Malcolm. I apprecaite the help!
0 -
I get that you can cast to either but the issue is using the same workflow for either SL or HTML5.
My solution at the moment is to use an If statement to check the type, if the result is System.Object[] then it's coming from HTML5.
IF String.Format("{0}", selected.GetType).Equals("System.Object[]") Then CType(selected, Object()) Else CType(selected, List(Of Object))
Not the most elegant solution but works pretty well.
Pablo
0 -
Hi Pablo,
List<Object> is both an IList<Object> and an IEnumerable<Object>.
Object[] is also both an IList<Object> and an IEnumerable<Object>.
This means you can cast to either IList<Object> or IEnumerable<Object> and it will work in both Silverlight and HTML5.
--Ryan
0 -
Got it, just tried it and it works on both.
Thanks!
0
Please sign in to leave a comment.
Comments
8 comments