2

We stumbled upon a strange behaviour in IE11 -

In one of our Notes applications we store an array as a viewScope variable and in the onClick event of a button we parese it onto a variable (SSJS) via

var myList = new Array(viewScope.get("existingDates"));

in all browsers except IE (Safari, Chrome, Firefox) it works like a charm. in IE we get no array, but rather a string.

I checked this by using

viewScope.get("existingDates").getClass().getName().

It returns java.util.Vector in all the other browsers, java.lang.String in the IE.

A 'split' or comparable workarounds can only be seen as last resort solution due to variable variable content in our application and I also would like to refrain from using delimiters so as to avoid having to add and subtract them for all the other browsers in every run.

Does anybody have an idea how to avoid that kind of behaviour or on how to best deal with it?

Also - though this might be a novice question - I do not get why SSJS can have different outcome in different browsers in the first place? What did I not get there?

  • The outcome of SSJS is always the same, it is the interpretation that is different. Being I am in an IE shop, curious to see the answer here. – Steve Zavocki Jul 31 '14 at 13:30
  • If you split the functionality, beware that the isIE() method doesn't always with IE11. – Steve Zavocki Jul 31 '14 at 13:33
  • 3
    How do you construct the value of `viewScope.get("existingDates")`? SSJS is not affected by the browser. It must be related to something else. – Serdar Basegmez Jul 31 '14 at 13:39
  • Link to support previous comment: http://mattwhite.me/blog/2014/2/19/xpages-and-ie11 – Steve Zavocki Jul 31 '14 at 13:41
  • 2
    `viewScope.existingDates = [111,222,333]; viewScope.get("existingDates").getClass().getName()` shows in all browsers `java.util.Vector` also in IE11. In your environment too? Should be so as SSJS runs on server and doesn't depend on browser. – Knut Herrmann Jul 31 '14 at 13:41
  • 2
    Is your viewScope variable connected to an input field that allows multiple values by setting the property "multipleSeparator" to a certain string? If yes, then the problem might be that (on the client-side) IE11 modifies the string in the input field in a way that the separator is no longer recognized when submitting the field value to the server. If the separator is not found in the submitted string, the split function probably returns the original string instead of a vector with 1 element. This is also true if the user only inserts a single value in the input field... – xpages-noob Jul 31 '14 at 19:02
  • 1
    I just tested it: If you set the "multipleSeparator" property for an input field, it returns a **java.util.Vector** only when the separator string is contained in the total string. Otherwise, a **java.lang.String** is returned. It might just be a coincidence that the problem only occurs in IE11 (maybe different underlying data). – xpages-noob Jul 31 '14 at 19:13
  • Thanks, @xpages-noob. You brought us on the right track. We had a List Text Box with a multipleSeparator: ` ` Since we removed the `@NewLine()`, i.e. deleted the whole multipleSeparator parameter, the application works in IE just as well. – Stefan Hausmann Aug 01 '14 at 07:35
  • @StefanHausmann: You're welcome. I think you should write a short answer so that people that come across this page directly see that the problem you reported is not caused by IE but by the multipleSeparator property. – xpages-noob Aug 01 '14 at 08:34
  • @xpages-noob I was in the progress of doing that, when I got distracted by the next problem. Seems the dojoListTextBox has a built in invisible delimiter (comma). But that's another bug for another time - I'll finish the answer ASAP – Stefan Hausmann Aug 01 '14 at 08:47

1 Answers1

1

As @xpages-noob suggested, the erroneous behaviour occurred because we had a multiple Separator in the ListTextBox. After we removed that parameter, the code ran correctly in all browsers, including IE.

code before:

<xe:djextListTextBox 
  id="djListe"
  value="#{viewScope.existingDates}" readOnly="false"
  multipleTrim="true"
  multipleSeparator="#{javascript:@NewLine();}">
</xe:djextListTextBox>

code after:

<xe:djextListTextBox 
  id="djListe"
  value="#{viewScope.existingDates}" readOnly="false"
  multipleTrim="true">
</xe:djextListTextBox>