Expand my Community achievements bar.

SOLVED

highlighting fields

Avatar

Former Community Member

Hello,

I need to disable some radio buttons, text-fields etc. according to some validation logic.

When i set property access to "readOnly", it has no visual effect. So I have tried to change e.g. border of edge:

//o is exclusion group of radioButtons

o.border.edge.color.value = "150,150,150";

which has strange side-effect. It seems, that implicitly is radioButton displayed as a raster (with shadows).

When border color is set, it is like it swithches to vector graphics and it replaces raster with only colored thick circle.

After some condition is valid again I need to switch back to original appearance -> raster like, but I cannot find any way, how to "rollback".

I was pretty close with this, but it still leaves some coloring on border:

o.border.presence="hidden";
o.border.edge.thickness="0pt";

What is the right way to highlight some field and take it back for Acrobat Reader 8.1 ?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 7

You're not allowed to change the visual object properties in static forms. The behavior you're seeing in the static form is actually not supposed to happen, oddly enough you should probably report that as a bug. The only way I can think of to get the behavior you want, where only the circle on the radio button changes color, is in the sample I've posted below.

View solution in original post

13 Replies

Avatar

Level 7

Would it work if you placed a protected text field behind the radio button you want to highlight and changed the border on that? The effect for the user would be the same and the scripting would be easier to manage.

Avatar

Former Community Member

Thanks for reply djaknow, I can use this method as a workaround if there is no easier way.

Precise placing of textfields for larger forms with many radio-buttons could be elaborate.

Avatar

Level 7

How about using checkboxes instead of radio buttons? You can use scripting to make them mutually exclusive and you wouldn't have to fool around with the extra fields. The appearance to the user is identical to radio buttons.

Avatar

Former Community Member

I unfortunately cannot work with Designer right now, but the issue should be the same for every input object.

The problem is, that when the border-color of object is programaticly changed, Reader changes more then only color. It makes e.g. thicker border or removes shadows for radio-buttons. When the color is set back to its default, the aditional changes remain.

At this task, I just need to get back the original appearance of object, after it is valid again ... at least thickness of border. I think, that the thicker border appears also for textFields, but I currently cannot test it.

Avatar

Level 7

Does it have to be a border change? I haven't tested it, but I wonder if changing the fill color would work better. Another alternative might be to simply hide the fields that you don't want the user to fill.

Avatar

Former Community Member

Sorry for late response.

I have tried to change radio-button's background-color in a following way:

xfa.resolveNode("xxxFieldNamexxx.#field").fillColor = "255,100,50";

Which also removes default style -> shadows etc. When I set it back to white, it looks really buggy.

Setting background color of input objects seems to me quite fundamental functionality , this should work.

I have tested switching from static to dynamic forms, but have not found any good looking solution.

Is there any example how to set and revert background-color of radio-buttons ?

Thanks.

Avatar

Level 7

Have a look at this and tell me if it's what you're looking for. Clicking the checkbox highlights the border on the radio button. I've posted a sample below.

Avatar

Former Community Member

Thank You very much for patience djaknow.

I see, that the behaviour really differs for dynamic and static forms, your example helped me to understand it better.

Please look at changes I made to it.

I would like to set only the rounded border for radioButton (as seen in the static form version), but then setting visibility to "invisible" has no effect and also there are those problems with replacing shadows etc.

So, the original motivation was to be able to visually disable some input objects (by setting its background to gray). This seems to be problematic, so I will try to use dynamic forms and to hide those ones.

Avatar

Correct answer by
Level 7

You're not allowed to change the visual object properties in static forms. The behavior you're seeing in the static form is actually not supposed to happen, oddly enough you should probably report that as a bug. The only way I can think of to get the behavior you want, where only the circle on the radio button changes color, is in the sample I've posted below.

Avatar

Former Community Member

That is nice workaround. I can use it, if there has to be this visual style.

I hope last OT: for this topic:

- when I re-save the same form as a dynamic form (this is the only change), the form is 6x larger (from 0.2MB to 1.2MB). What could cause this ?

Thanks.

Avatar

Former Community Member

Ok, according to :

http://help.adobe.com/en_US/livecycle/8.2/static_dynamic_diffs.pdf

"In static PDF forms, fonts can be subset for text and field captions. Subsetting reduces the size of the PDF
file."

So the reason should be embeded fonts.

Avatar

Level 7

I know that embedding fonts increases file size, but for our forms where I work we times new roman is our standard so I've never had to deal with that issue. If you have a specific font you need for a company header for example, you'd probably be better off turning it into an image and getting it into your form that way.

Avatar

Level 7

One other thing, if you end up using the workaround and think you'll use it again at some point, you can wrap the objects in a subform and save it into your custom objects so you don't have to keep creating it from scratch.