Red dashed lines disappear

S

StefanO-nl

When the enduser entered an invalid value in a textbox, InfoPath displays red dashed lines around that textbox, indicating he entered a wrong value. However sometimes these lines disappear (and reappear random?). I would expect them to be visible until the user enters a valid value. Why isn't this the case?

Is it possible to manipulate the behaviour of these red dashed lines in any way?
 
S

StefanO-nl

Greg Collins said:
I know you said it happens randomly, but if it is possible to provide steps to cause this to happen consistently, that would help.

Ok, when they disappear, it seems to be in the following (or a?) scenario filling out a published fully trusted form (SP1):
- I fill a textbox with an invalid value (either invalid because of the schema or invalid because of a rule I defined, that doesn't seem to matter).
- I leave the textbox (e.g. by tabbing to the next textbox or clicking the mouse at a random spot on the form) and the red dashed lines are visible (also visible now around other textboxes that have invalid values) as expected.
- I tab to the next textbox or I move my mouse over a textbox and the red lines disappear.
- I return to the invalid textbox (either by tabbing back or clicking the mouse) and the red lines reappear.
- I tab to the next textbox or I move my mouse over a textbox and the red lines disappear.
- I return to the invalid textbox (either by tabbing back or clicking the mouse) and the red lines do not reappear.
- The red lines don't reappear until I go to a textbox that I didn't enter before, but after tabbing to another (random) textbox or just moving my mouse, they disappear again.
- Go back to the first step, but now the red lines only reappear when I fill in an other invalid value (e.g. changing "a" to "b" in an integer field).

I'm using context sensitive help as described at http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx
(but when I comment out the code in the OnContextChange-event the red dashed lines still disappear)
 
S

StefanO-nl

I've tried to create a new form that has this problem (and probably when I succeed I know what's the problem too :)). I couldn't reproduce the problem...

However I did notice something else: in forms without the problem (showing red dashes that don't disappear) around textboxes a thicker line is shown when you move the mouse over the textbox.
I don't know if this has anything to do with the problem, but maybe it could help you figure out what could be wrong?

When I minimize a form where the red dashed are gone and maximize it again, the red dashes reappear, but as soon as I move my mouse, they disappear again.

Greg Collins said:
Very strange. If you have time can you generate a very simple form (2 or 3 text boxes) that repros this problem and attach to your reply here? I'd like to play with it, and see if I can make it happen here. If I can, I may be able to figure out why its happening.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



StefanO-nl said:
I know you said it happens randomly, but if it is possible to provide steps to cause this to happen consistently, that would help.

Ok, when they disappear, it seems to be in the following (or a?) scenario filling out a published fully trusted form (SP1):
- I fill a textbox with an invalid value (either invalid because of the schema or invalid because of a rule I defined, that doesn't seem to matter).
- I leave the textbox (e.g. by tabbing to the next textbox or clicking the mouse at a random spot on the form) and the red dashed lines are visible (also visible now around other textboxes that have invalid values) as expected.
- I tab to the next textbox or I move my mouse over a textbox and the red lines disappear.
- I return to the invalid textbox (either by tabbing back or clicking the mouse) and the red lines reappear.
- I tab to the next textbox or I move my mouse over a textbox and the red lines disappear.
- I return to the invalid textbox (either by tabbing back or clicking the mouse) and the red lines do not reappear.
- The red lines don't reappear until I go to a textbox that I didn't enter before, but after tabbing to another (random) textbox or just moving my mouse, they disappear again.
- Go back to the first step, but now the red lines only reappear when I fill in an other invalid value (e.g. changing "a" to "b" in an integer field).

I'm using context sensitive help as described at http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx
(but when I comment out the code in the OnContextChange-event the red dashed lines still disappear)
 
S

StefanO-nl

In SP1 final release this problem is solved.

But I still wonder if it's possible to manipulate the behaviour of these red
dashed lines in any way. Now they only appear when the value of a
particular node is invalid according A) the schema, B) designer specified
validation, or C) script which creates/destroys an error for that node.
So is it possible to write C# code to create/destroy an error for that node?
If that would be possible, my guess is that's the solution...

StefanO-nl said:
When the enduser entered an invalid value in a textbox, InfoPath displays
red dashed lines around that textbox, indicating he entered a wrong value.
However sometimes these lines disappear (and reappear random?). I would
expect them to be visible until the user enters a valid value. Why isn't
this the case?
Is it possible to manipulate the behaviour of these red dashed lines in
any way?
 
S

StefanO-nl

I want to enable the red dashes from C# code.

I know in script it's possible like this:
eventObj.ReportError(eventObj.Site, message, false);

But in C# the ReportError expects 6 parameters.
And when I try e.Site as the first parameter, an InvalidArgumentException is
thrown with the message {"InfoPath has encountered an error. The operation
failed.\n??\nThe form's code contains an error. \n\nThe following call in
the form's code failed: DataDOMEvent.ReportError\nThe parameter is
incorrect.\r\n" }

Without saying which parameter, my guess is the first parameter.
 

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