AnsweredAssumed Answered

Query Task : How to look for NULL?

Question asked by LucieBoucher on Feb 27, 2012
Latest reply on Mar 12, 2012 by LucieBoucher
I feel this question is really stupid, but I'm stuck...

I have adapted the sample "Find Results in Dojo Chart" fom the Sample page :

Instead of having a text box and a search button, I have three buttons (Positive, Negative, Empty) that display different results in my datagrid.  Basically, what I want is three very simple functions : display the elements where fieldA = "Positive", where fieldA = "Negative" or where fieldA contains nothing.

I have managed the first two easily.  But now I face a very stupid situation : how do I query for empty elements?  I have no idea how to write the findParams.searchText in order to return the empty elements.  I have tried with "", with NULL, and I always have an error.

Within my function init(), I have the following code :
[HTML]        //Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["FIELDA"];
findParams.outSpatialReference = map.spatialReference; [/HTML]

Then I have the three functions :
function doFindPositives() {
  findParams.searchText = "Positive";

function doFindNegatives() {
  findParams.searchText = "Negative";

function doFindEmpty() {
  findParams.searchText = "";

And later, in the <body>:
<button data-dojo-type="dijit.form.Button"  data-dojo-props='onClick:function(){ doFindPositives();}, value:"Search"'>
<button data-dojo-type="dijit.form.Button"  data-dojo-props='onClick:function(){ doFindNegatives();}, value:"Search"'>
<button data-dojo-type="dijit.form.Button"  data-dojo-props='onClick:function(){ doFindEmpty();}, value:"Search"'>

Thank you very much for your help!