Attribute Inspector Validation

845
1
Jump to solution
08-21-2012 12:06 PM
BethManghi
New Contributor III
Does anyone have a good method for validating the Attribute Inspector beyond just the default field validation?  For example, I'm trying to figure out a way to prevent the Attribute Inspector from closing if there are values missing.
0 Kudos
1 Solution

Accepted Solutions
BethManghi
New Contributor III
Well, I've been able to figure out at least one work around.  I added my own close button to the Attribute Inspector and then looped through the feature layer's selected features using dojo.every.  But I am very open to other suggestions!

dojo.connect(closeButton,"onClick", function (){
    var graphics = window.providerPointLayer.getSelectedFeatures();
    dojo.every(graphics, function (graphic) {
        if(graphic.attributes.PROVIDER_SETTING_TYPE == null || graphic.attributes.PROVIDER_SETTING_TYPE == "") {
        alert("Please enter a Provider Setting Type.");
        return false;
    }
    else {
        dijit.byId("dialogOne").hide();
        window.providerPointLayer.refresh();
        populateGrid();
    }
});

View solution in original post

0 Kudos
1 Reply
BethManghi
New Contributor III
Well, I've been able to figure out at least one work around.  I added my own close button to the Attribute Inspector and then looped through the feature layer's selected features using dojo.every.  But I am very open to other suggestions!

dojo.connect(closeButton,"onClick", function (){
    var graphics = window.providerPointLayer.getSelectedFeatures();
    dojo.every(graphics, function (graphic) {
        if(graphic.attributes.PROVIDER_SETTING_TYPE == null || graphic.attributes.PROVIDER_SETTING_TYPE == "") {
        alert("Please enter a Provider Setting Type.");
        return false;
    }
    else {
        dijit.byId("dialogOne").hide();
        window.providerPointLayer.refresh();
        populateGrid();
    }
});
0 Kudos