Deleting error objects???

B

billythefisherman

Hi I'm trying to remove error objects related to a group of text boxes
in a repeating table ie I'm validating one row to see if it makes all
the cells contents valid - the scenario being there can be only one
string in the table that doesn't start with "CONV ".

I'm trying to do this by going through each XML node relating to each
row's text box and checking to see if it relates to that error object
through the error objects 'node' property. This works fine, the
problem is when I call the Xdocument.Errors.Delete function it doesn't
remove the object. Here's the code:

if( messageList )
{
for (var i=0; i<messageList.length; i++)
{
var objCurrentMessage = messageList.item(i);

var attrCurrentMessage =
objCurrentMessage.attributes.getNamedItem("message");

for(var j=0; j<XDocument.Errors.Count; j++)
{
var objError = XDocument.Errors.Item(j);

if( objError.Node == attrCurrentMessage )
{
XDocument.Errors.Delete( objError.Node, objError.ConditionName );
}
}
}
}

The XDocument.Errors.DeleteAll function works and so I'm left facing
the prospect of adding all the error objects into my own list and
calling DeleteAll and then adding the error objects I still want back
in - this sounds like a big hack...

On a side note how do I create something in JScript of a certain type
ie:

var errorCollection : Collection;

This kind of thing errors on script compilation - but I've seen lots
of JScript examples using that notation...

Also how do I get access to the windows String object (etc) ie:

var sMessage : String;

I've tried 'import system;' in various syntax forms but none of them
work - they all give script syntax errors...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top