Fill colour turns black on exit

Avatar

Avatar

SciMax

Avatar

SciMax

SciMax

16-06-2009

Because LiveCycle will not accept "transparent" as a colour, I have been using this JS to highlight the active field on enter, and return to the original fill colour on exit (usually none).  For example, the field turns pale yellow on entry, and back to pale grey on exit.

The script is called hilite.

var

highlightedFillColor = "255,255,204";

          var

oldFillColor = "";

          function

TabIn( Field ){

               oldFillColor

= Field.fillColor;

               Field.fillColor

= highlightedFillColor;

          }

          function

TabOut( Field ) {

     Field.fillColor

= oldFillColor;

In each object I insert these JS scripts into the enter and exit event.

hilite.TabIn(

this );

hilite.TabOut(

this );

For months this has been working perfectly... until last week.   Now, occasionally the field will fill completely in black on exit.  Normally I would suspect the code but this only happens intermittently.  I will go into a field and it will fill with pale yellow, and then black when I exit.  I can then go immediately back into that field again turning it pale yellow and it will fill return to NO fill on the exit which is what it should do.  The next field which has the same JS will work perfectly.  No consistency! 

This is not a "screen thing" either... the blacked-out field prints the same way -- blacked-out.  Which makes the data beneath it very difficult to read <lol>!

Any ideas on what is happening?  I would prefer not to change the object's fill colour to white.

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

SnookerDJ

Avatar

SnookerDJ

SnookerDJ

17-06-2009

Hi

You would have to use white as your original background color.

To access inside of each object that you refer to has slightly different code:

text box = xfa.resolveNode("Page1.Subform1.TextBox1.ui.#textEdit.border.fill.color").value = 255,255,255;

will set the inside of the text box white.

Replace'#textEdit' with the following for other objects:

Drop Down list = #choiceList

Date field = #dateTimeEdit

CheckBox = #checkButton

NumericField = #numericEdit

I am sure that you can also do this for radio buttons and if you really need it I can see if I can find out but I generally highlight the whole of the radio section using '.Page1.Subform1.RadioButtonGroup.fillColor = 255,255,255.

I hope that this helps. it took me a while to figure this out too!

Cheers

Darren

Avatar

Avatar

SciMax

Avatar

SciMax

SciMax

17-06-2009

Okay, I guess no-one knows what the problem is.  Since I'm still have the issue, it looks like I'm going to have to change my tactics! 

So my next question is...

If I want to highlight the active field for the user, then have it return to its original state on exit, what is the best and easiest way to do this?  Noting this would have to work in all the objects, including radio buttons and check boxes.

Thanks.