Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Empty XML element interpreted as null in JavaScript
leecop
Does anyone run into this problem upgrading from 2.1 to 2.2?
In 2.1, <key></key> was interpreted as empty string, but in 2.2 <key></key> is interpreted as null.
This only happens in JavaScript but not in the table display. For example, JavaScript in Dynamic Text element.
Is there a flag somewhere I can change to make convert null to empty string globally?
Thanks in advance!
Find more posts tagged with
Comments
Virgil Dodson
Hi leecop,
Have you tried using a computed column like below?
if (row["key"] == null) { "" } else { row["key"] }
You can create a new field that replaces the nulls with spaces again or any other value
leecop
Virgil,<br />
<br />
Thanks for the reply!<br />
That's what we did to get around this issue, problem is we have gazillion lines of code need to be updated.<br />
<br />
Do you think this is a correct behavior?<br />
I think this is a bug because it is interpreted as empty string if expression is:<br />
row["key"]<br />
<br />
And interpreted as "null" if expression is:<br />
"" + row["key"]<br />
<br />
It is not consistent.<br />
<br />
<blockquote class='ipsBlockquote' data-author="vdodson"><p>Hi leecop,<br />
<br />
Have you tried using a computed column like below?<br />
<br />
if (row["key"] == null) { "" } else { row["key"] }<br />
<br />
You can create a new field that replaces the nulls with spaces again or any other value</p></blockquote>
leecop
I've reported this bug:<br />
<a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=238856'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=238856</a><br
/>
<br />
<blockquote class='ipsBlockquote' data-author="vdodson"><p>Hi leecop,<br />
<br />
Have you tried using a computed column like below?<br />
<br />
if (row["key"] == null) { "" } else { row["key"] }<br />
<br />
You can create a new field that replaces the nulls with spaces again or any other value</p></blockquote>