EnvironmentScenarioI've got a DCT with a text-field/browse button for selecting a file -- pretty basic stuff.
I have an onChange handler for that text-field which does a callServer() to a very simplistic CGI script that checks to see if the path/file in the text field actually exists on the server and calls back to a 'callback' function in my FormAPI code with a value of either '1' [okay] or '0' [error].
I have an existing DCR with a valid entry in that field.
I type an extra character at the end of the text entry and hit Tab - it does the callServer, the CGI calls back to the formapi code and the callback routine pops up an alert telling me that the value is invalid and highlights the field in red. At the same time an error message appears near the bottom of the Edit DCR window saying:Either required fields have not been filled out or fields contain invalid values. Please fix this before saving.
This is okay - pretty much excatly what I want.
ProblemNow - I go back to the text field and remove the extraneous character and hit Tab again - the highlighting around the field goes away - everything looks good except I still have that message at the bottom of the Edit DCR window.
The callback code looks basically like this:
function callback(val){
var subnav = IWDatacapture.getItem("/subnav");
var status = subnav.isValid();
if (val == 0){
alert("Selected sub-navigation bubble does not appear to exist." +
" Erase or replace.");
subnav.setFocus();
showInvalid(subnav);
}
else {
showValid(subnav);
if(status == false){
IWDatacapture.setHighlightMode(false);
IWDatacapture.redraw();
}
if (validateOutlineLevels() && validateDates("Event")){
if (button_status == IWDatacapture.SAVE_BUTTON ||
button_status == IWDatacapture.SAVECLOSE_BUTTON)
{
IWDatacapture.save();
}
return true;
}
}
return false;
}In the bolded section above I've tried a number of different things:
IWDatacapture.setHightlightMode(true);IWDatacapture.setHightlightMode(false);IWDatacapture.redraw();IWDatacapture.redrawLabels();
Either I managed to miss the right combination of the above calls - or I'm missing the correct call to make to get rid of that annoying message which is no longer applicable. (
Note: I have verified that it's going into that conditional code - the logic is fine - the functionality is what's not working)
Anyone else run into this?
Anyone see what I'm missing?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com