Select to view content in your preferred language

Robert's eSearch Widget: where is "The value entered in not valid" defined.

847
5
Jump to solution
09-23-2019 04:53 PM
BingJing
Regular Contributor

Hi All

I am trying to modify the eSearch Widget for our needs.

Please see attached screen photo. I want to allow address or APN that are not in the drop down list so that I can show a redirect message to link to google map.. Where is the string "The value entered in not valid"  defined?

Thank you in advance. 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Bing,

   That is an internal dojo dijit validation error string from the dojo library.

It appears when I call this.stringCodedValuesFS.validate().

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Bing,

   That is an internal dojo dijit validation error string from the dojo library.

It appears when I call this.stringCodedValuesFS.validate().

0 Kudos
BingJing
Regular Contributor

Hi Robert, Thank you again for the hint.

I am trying to figure out how to allow people entering an address that is not on the auto-complete drop-down. Currently, when a wrong address is entered, the code stops at this function and did not go anywhere.

buildWhereClause: function (layerIndex, expressIndex, /* optional */theValue)

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Bing,

   So in the SingleParameter.js find this code block and change it to do something else.

if (!this.stringCodedValuesFS.validate()) {
    //this._showValidationErrorTip(this.stringCodedValuesFS);
    //return null;
    //add your own code here to handle an invalid entry.
}
BingJing
Regular Contributor

It took me a lot of debugging. 

I commented out the whole section as you put above. Also I commented out this function. 

_showValidationErrorTip: function (_dijit) { 

/*
if (!_dijit.validate() && _dijit.domNode) {

if (_dijit.focusNode) {
_dijit.focusNode.focus();
_dijit.focusNode.blur();
}
} */
},

One last question here, how to get the value of the "wrong address" that user entered here?

This may be against the nature of your design. I am trying to let the user only enter a valid address, but in case they enter a non-existing address, we want to redirect them to a geocoding service to find the area. 

Thank you Robert. 

 

 

0 Kudos
BingJing
Regular Contributor

I think I got it. The below call works.

this.stringCodedValuesFS.attr('displayedValue')

0 Kudos