Enhanced-Search-Widget-for-FlexViewer Part II

94448
552
04-19-2012 08:03 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I am pleased to announce the next release of my eSearch Widget.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Version 2.5.1.7 - 4/19/2012
* Added ability to search (flat/standalone/no geometry) tables.
* This time all Zooming uses the same scaling (popup, datagrid, widget results, zoom to all).
* Added Relates icon/button to datagrids so that you can click on it in the datagrid to
  open relates choice dialog.
* Move all skins to a skins package for cleaner organization.
* Links that are not associated with a field now work.
* Ability to disable the relates tab in the fixed widget is now configurable.
552 Replies
RhettZufelt
MVP Notable Contributor
Nice job.  However, I will still get the null value error if I click the clear button before a search.

not sure if it will affect anything else, but I modified the clear() function to this and it "fixes" it:

    if (qFeatLayer){                     // My Change
        qFeatLayer.clearSelection();
    }                                    // End My Change
    graphicsLayerBuffer.clear();
    graGraphicsLayer.clear();
    clearMessage();


Also, I see we can now search for blank/spaces with the uniquevalues option, but will not populate the list with or select any nulls.

Thanks again, this widget just gets better and better,

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Well I know I put those lines in there for checking if the qFeatLayer was null or not but I must have clicked undo at some point... As far as the blanks and nulls I will have to look into this, but really that should be handled by the data producer and should not have to be handled by the developer (i.e. there should be one of the other not both empty strings and nulls).
0 Kudos
RhettZufelt
MVP Notable Contributor
I agree that the null should be handled by the data producer.  My issue is that I update my data from a join to an oracle database on a regular basis.  Once you have rows in your feature class, you CAN NOT add a non nullable field to the feature class (so, why does it even give you the option?  just so it can give you an error I guess).  So, every time I update it, it sticks all the nulls in there.
Also, any time you add a feature, it automatically assigns a null to every field you don't populate (since I can't set to not accept nulls)

I had my script, after the updates, go in and converted all the nulls, and modified the fields to not allow them.  However, it seems that each service pack (except for 5) breaks something in the arcpy package so I have to go re-do all my scripts again.  Finally just decided to let ESRI tell me what I "want" and live with it.  So, now I have both blanks and nulls.

personally, I don't think the nulls should even exist.  Well, for that matter, they don't :).  In other words selct for item <> "non null value" does not select nulls.  Seems like if it isn't equal to "non null value" it should select it, but appearantly, it is not not equal to it either.  So far I've never came across a case where I would prefer a null over a blank.

Maybe now that version 10.1 is out and I have sp5 on my 10.0 I can re-visit this without it breaking (doubt there will be a service pack 6).

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
Thought maybe since I had both in there it was causing an issue so I tried both.

With all blanks it will populate the dropdown with a blank option.
Will nulls and no blanks or spaces, there is no null option.

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   What type of field is the nulls in? I have tested a FC with a string field with nulls and the uniquevalsfromfield works fine (Adding the null to the list).


Update: I have now tested on a String field with a mix of " ", nulls, and various strings and it works fine. I have also tested a double field with numbers and nulls and the null option is listed in the drop down. Are you sure your FC data has <null>? Are you using every row in the FC with nulls or something?...
0 Kudos
RhettZufelt
MVP Notable Contributor
Not sure what is going on here.

OSE_ID (Type: esriFieldTypeString, Alias: OSE_ID, Length: 15 ) 
testnull (Type: esriFieldTypeString, Alias: testnull, Length: 50 ) 


I have reduced it down to two fields for testing.  I have tried with only blanks, only spaces, or only nulls (and combinations) in the OSE_ID field, and it will not put the space, blank, or null in the picklist.
However, I have all three (blanks, spaces, nulls) in the testnull field and it seems to be working perfectly.  It adds a blank value (which selects both blanks and space), and a null (which selects all nulls) and the all (which selects all, including blanks and nulls).  (the OSE_ID field was existing in the featureclass, the testnull I added with ArcMap.)

Not sure what is going on with my data and the OSE_ID field, but it appears to be related to my data.

Will have to look into it more come monday.

Also, is there some way to put a dateFormat tag somewhere to make it possible to use the uniquvaluefromfield with esriFieldTypeDate?
If I try to use this option on a date field, it populates the list with the huge numbers (ms from start date/time I believe) and not the formatted date.  As such, all searches for a date will fail as it seems to submit the ms value for the query, but the data in the field is actually DD/MM/YYYY. (It works, of course, if I put my date in a text field, but it doesn't sort properly when done this way.)
As is, it will select any null values in the date field, and if you select all, it gets them all.  Just can't get individual dates that are not null.

R_

Update:  thought maybe since I didn't have any values with data in the testnull (other than blanks, spaces, and nulls), that might be why it is working.  Just added some data to some of the values, still working as designed, not sure what is up with my one field.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   A new version is now available.

Version 3.0.16 - 12/3/2012
* Fixed an issue with blanks (when using isrequired="true") and empty strings be treated
  as equal when using uniquevalsfromfield.
* uniquevalsfromfield can now use a datefield and use the dateformat and useutc attributes.
0 Kudos
RhettZufelt
MVP Notable Contributor
Nice.  Have not had a chance to really test it, but haven't broken it yet 🙂  Definatly worth another point....

I did notice the config.xml example still has this line:

 <disablebuttons>result</disablebuttons><!--possible values one or more not all four search types comma separated text,graphic,spatial,grid,datagrid -->


I see the pdf has been updated, just thought I'd point out that the "result" option is not in the xml example.

R_
0 Kudos
MattShetzer
New Contributor
Robert,
I'm using your Esearch tool (v2.5.1.7), and have noticed when I use the numberformat attribute it actually truncates the number.  I need to round the number as I want the value shortened to be consistent with the precision attribute for the popup.

I've reviewed your enhancement notes\configuration documents, and don't see it in there, therefore I didn't update my version. 

Is it possible to round values using the esearch tool.

Thank you in advance.
Matt Shetzer
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matt,

   So many fixes and enhancements have occurred since 2.5.1.7 as the last 2.x API version of this widget is at 2.9.0.1.... But you are correct there is no configurable option to have the number round. You can make a change in the code to account for this but if you are using the compiled version then there is nothing you can do. As you probably know I do not enhance old versions of my widgets.
0 Kudos