Expand my Community achievements bar.

How to restore border/fill to default "lowered"

Avatar

Level 2

If you highlight a field border with red on an error condition, how do you restore the field border to its "factory default" setting, i.e. lowered, when the field is corrected?

When you set the border color, or fill color, the object model seems to tank with side-effects that crap over the whole thing.  Also, you can't save the previous state to a javascript var and expect it to be restored through reassignment.

Trying to do even the simplest things in LiveCycle is absurd and non-intuitive, like most Adobe products.

P.S. Even tried fieldname.remerge() ... sigh

4 Replies

Avatar

Level 10

Hi,

You could set up your validation along the lines:

fld = xfa.resolveNode("form1.p1.textField1.ui.#textEdit.border.fill.color"); // this is for the fill colour

if (test fails)

{
     fld.value = "255,0,0";

     textField1.border.fill.color.value = "255,0,0" // border colour red

}

else

{
     fld.value = "255,255,255";

     textField1.border.fill.color.value = "255,255,255" // border colour black

}

Hope that helps,

Niall

Avatar

Level 2

Thanks very much for your reply -- much appreciated.

Basically, setting the border color, or even the fill color, destroys the 3d "lowered" setting that you get by default.  Obviously, I'd like to restore the appearance of the input box when a correct answer is made, which is a 3d-box.  How do you do that?

Avatar

Level 10

Sorry, hit my limit. I don't know how to script for that property. It might be along the lines for specifying a line, but I am not sure:

line1.resolveNode("value.#line.edge").stroke = "lowered";

Adobe's Calcu;lations and Scripts guide states:

This is beyond the scope of this document. Updating these
properties using scripting requires a thorough knowledge of the
XML Form Object Model.

So I suspect that you can change back to lowered.

Good luck,

N.

Avatar

Level 4

Try

xfa.resolveNode("insertfieldandetc".ui.textEdit.border.edge").stroke = "lowered";