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)
Known "Visibility" limitations?
TheShadraq
Is anyone aware of limitations within the "Visibility" functionality? (It's also well within reason that my function is wrong).<br />
<br />
I have a field that I want to "Hide for All Elements" based on a function. If I just use the part in <strong class='bbc'>BOLD </strong>it acts just fine. However if I add the part in ITALICS along with it, it ceases to work. <br />
<br />
<em class='bbc'>row["approval6"] !=null + row["approval5"] !=null + row["approval4"] !=null + row["approval3"] !=null + row["approval2"] !=null + row["approval1"] !=null + </em><strong class='bbc'>row["env"] != 0 + row["qual"] != 0 + row["ind"] != 0 + row["fpe"] != 0 + row["wp"] != 0 + row["fws"] != 0 + row["da"] != 0 + row["rad"] != 0 + row["fac"] != 0 + row["usq"] != 0</strong><br />
<br />
Do I just have too many parameters or am I treating "null" incorrectly?<br />
<br />
Thanks,<br />
Shadraq<br />
<br />
Version: 3.4.2<br />
Build id: M20090211-1700
Find more posts tagged with
Comments
thuston
Try using different condition syntax:
&& <-- AND
|| <-- OR
mcremer
<blockquote class='ipsBlockquote' data-author="'TheShadraq'" data-cid="80775" data-time="1311893624" data-date="28 July 2011 - 03:53 PM"><p>
Is anyone aware of limitations within the "Visibility" functionality? (It's also well within reason that my function is wrong).<br />
<br />
I have a field that I want to "Hide for All Elements" based on a function. If I just use the part in <strong class='bbc'>BOLD </strong>it acts just fine. However if I add the part in ITALICS along with it, it ceases to work. <br />
<br />
<em class='bbc'>row["approval6"] !=null + row["approval5"] !=null + row["approval4"] !=null + row["approval3"] !=null + row["approval2"] !=null + row["approval1"] !=null + </em><strong class='bbc'>row["env"] != 0 + row["qual"] != 0 + row["ind"] != 0 + row["fpe"] != 0 + row["wp"] != 0 + row["fws"] != 0 + row["da"] != 0 + row["rad"] != 0 + row["fac"] != 0 + row["usq"] != 0</strong><br />
<br />
Do I just have too many parameters or am I treating "null" incorrectly?<br />
<br />
Thanks,<br />
Shadraq<br />
<br />
Version: 3.4.2<br />
Build id: M20090211-1700<br /></p></blockquote>
<br />
As Thuston said try difrent conditon syntax its jaa script afther all:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (row["approval6"] !=null && row["approval5"] !=null && row["approval4"] !=null
&& row["approval3"] !=null && row["approval2"] !=null && row["approval1"] !=null
&& row["env"] != 0 && row["qual"] != 0 && row["ind"] != 0 && row["fpe"] != 0
&& row["wp"] != 0 && row["fws"] != 0 && row["da"] != 0 && row["rad"] != 0 && row["fac"] != 0 + row["usq"] != 0){
true;
}else {
false;
}
</pre>
But becouse you have so mutch variables. I would split it up my self to make the code cleaner and also more understandable for other devs.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var hiden = false;
// Check code for null value's
if (row["approval6"] !=null && row["approval5"] !=null && row["approval4"] !=null
&& row["approval3"] !=null && row["approval2"] !=null && row["approval1"] !=null ){
hiden =true;
}
if (row["env"] != 0 && row["qual"] != 0 && row["ind"] != 0 && row["fpe"] != 0
&& row["wp"] != 0 && row["fws"] != 0 && row["da"] != 0 && row["rad"] != 0 && row["fac"] != 0 + row["usq"] != 0){
hiden = true;
}
hiden;
</pre>
TheShadraq
Thanks for the replies guys. <br />
<br />
The reason I used + in this case instead of && was that it won't hide with && in this case. Unsure why, but with the same parameters and a swap of the symbol...one hides one doesn't.<br />
<br />
The part where I am hiding if == 0...no issues. that part is great<br />
<br />
The part where I am trying to hide something null...not so great. Here is what I have found.<br />
<br />
<strong class='bbc'>IF </strong>I use code <em class='bbc'>&& != null</em> <strong class='bbc'>THEN</strong> the piece to be hidden always shows. Always.<br />
<br />
<strong class='bbc'>IF </strong>I use code <em class='bbc'>+ != null</em> <strong class='bbc'>THEN</strong> the piece to be hidden never shows. Never.<br />
<br />
I have also ran checks against my DB to ensure that the fields are infact pulling <em class='bbc'>NULL</em>...they are.<br />
<br />
Thanks again to you both. I appreciate your help very much.<br />
<br />
- Shadraq
thuston
I think you need to explain what you want from this expression.<br />
<br />
<br />
I did some tests<br />
true && true == true<br />
true && false == false<br />
false && false == false<br />
<br />
true + true == 2 == true<br />
true + false == 1 == true<br />
false + false == 0 == false<br />
<br />
So '+' is effectively an OR operator, not an AND.<br />
<br />
<blockquote class='ipsBlockquote' ><p>IF I use code && != null THEN the piece to be hidden always shows. Always.<br />
IF I use code + != null THEN the piece to be hidden never shows. Never.</p></blockquote>
This would make sense if any single value IS EQUAL to null.<br />
true && true && false && true == false<br />
true + true + false + true == true || true || false || true == true<br />
<br />
<br />
Try again with a smaller expression and build it up to confirm which is breaking your test.
TheShadraq
SOLVED (sorta):
Thanks for sticking with me on this. I appreciate your time and help. I went through my expression as you suggested and no matter what I did I couldn't get it to stick. Maybe it is as simply as me just not seeing past my code and what my brain auto-filled and maybe it was something else that I just don't have enough experience to see through.
Whatever the case, after some heavy testing this is what I came up with. It works so I won't mess with it anymore. Here it is
var hidden = false;
if(row["approval1"] != null) { hidden = true;}
if(row["approval2"] != null) { hidden = true;}
if(row["approval3"] != null) { hidden = true;}
if(row["approval4"] != null) { hidden = true;}
if(row["approval5"] != null) { hidden = true;}
if(row["approval6"] != null) { hidden = true;}
if(row["env"] != 0) { hidden = true;}
if(row["qual"] != 0) { hidden = true;}
if(row["ind"] != 0) { hidden = true;}
if(row["fpe"] != 0) { hidden = true;}
if(row["wp"] != 0) { hidden = true;}
if(row["fws"] != 0) { hidden = true;}
if(row["da"] != 0) { hidden = true;}
if(row["rad"] != 0) { hidden = true;}
if(row["fac"] != 0) { hidden = true;}
if(row["usq"] != 0) { hidden = true;}
hidden;
- Shadraq
PS - as an afterthought, if anyone has a website listing this or can fill in the blanks for me on the actual meanings of these operators that would be a huge benefit for me in the future.
Again, thanks for all who worked with me.