Looking through SAN application, I remark that you are emphasizing the field focus by dynamically changing background color.
Once we thought to do the same thing in our solutions, but abandon the idea as we ‘found’ that we will be forced to attach two global methods to each field (onFocusGained/Lost).
As Maarten confirm it to me, you used a similar strategy to implement it in SAN. But this is time consuming and it seems to me that adding two calls for every field object in big solutions is not a good idea…
So, can you please provide us with an effective way to actively change the appearance of a field when it gets and loses focus?
My two cents on this:
a new property for fields (+Labels?), focusBackgroud, where we could choose the highlight color for the object, by analogy with imageMedia/rolloverImageMedia properties.
a mechanism similar to the rowBgColorCalculation for the form (or the entire solution) highlightFieldBgColorCalculation
even a special selected styleclass for fields, to be used in css (my preference if it is possible)
Yet not a major issue, this could let all servoy developers offer a ‘visually important’ interface feature to their customers.
jcompagner:
Doesn’t seem to be very time consuming to me.
Off course, I knew how to do that. I would use that if our solutions had less than 50 forms / 1000 fields (ours have more than 200 currently).
The point with this request is to be able not to change two properties for each and every field in the solution. Thus letting these properties free for ‘real’ methods call. You know, highlighting the current field is a nice, but minor feature.
If you can’t (or don’t want) implement it directly, we will either choose to add it as a last minute feature or not to implement it.
With the requested feature, we will implement it in all cases (as a stylesheet/class preferably).
I think this is an excellent extension to Servoy.
For existing forms, we may already have methods attached to the OnFocusGained/Lost properties for other purpose, so there’s a bit more work than just slelecting all fields and changing the properties.
The other option is Marcel’s newly acquired Decorator plugin which lets you set the border, background and foreground of any element. I haven’t tried it myself yet, but it looks perfect for this purpose. See
Thanks for that - though it does require editing those properties on every field on every form. The nice things about Decorator was you could set it once for an entire solution, and only attach methods to those events for other specific purposes.