# Undocumented feature breaks existing style usage, PLS VOTE

**URL:** <https://forum.servoy.com/t/undocumented-feature-breaks-existing-style-usage-pls-vote/17141>\
**Category:** Classic Servoy\
**Created:** [March 25, 2013, 8:29pm UTC](https://forum.servoy.com/t/undocumented-feature-breaks-existing-style-usage-pls-vote/17141 "2013-03-25T20:29:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [March 25, 2013, 8:29pm UTC](https://forum.servoy.com/t/undocumented-feature-breaks-existing-style-usage-pls-vote/17141/1 "2013-03-25T20:29:05Z")

</div>

Here is a heads-up for you developers using/going to Servoy 6.1.

It seems that Servoy 6.1 introduced a nice new feature where a form style-name can be automatically applied to all it’s form elements.  
It’s also undocumented, at least I can’t find it anywhere in the [release notes](http://wiki.servoy.com/display/SERV61/New+in+this+release) of 6.1.  
If you have a form style named form.fancyStyle and field/label/etc. styles with the same name then all these styles are applied even without assigning this style to you form element. It can be a nice timesaver.

BUT.

If you are migrating pre-6.1 solutions to 6.1 then you might end up with some surprises. I for one use the style name ‘border’ a lot for adding borders to my many different form elements.

Lets say you have the following stylesheet:

```auto
form.border {
	border-color: #CCCCCC #CCCCCC #CCCCCC #CCCCCC;	
	border-style: solid;
	border-width: 1px 1px 1px 1px;
}

label.border {
	border-color: #CCCCCC #CCCCCC #CCCCCC #CCCCCC;
	border-style: solid;
	border-width: 1px 1px 1px 1px;
}

field.border {
	border-color: #CCCCCC #CCCCCC #CCCCCC #CCCCCC;
	border-style: solid;
	border-width: 1px 1px 1px 1px;
}

tabpanel.border {
	border-color: #CCCCCC #CCCCCC #CCCCCC #CCCCCC;
	border-style: solid;
	border-width: 1px 1px 1px 1px;
}

```

Now in Servoy 6.1 just by assigning the style ‘border’ to your form ALL your form elements on that form will show their ‘border’ style. I haven’t found a way to override this other then renaming your style classes. Of course in large solutions this can be a Royal-pain-in-you-know-where.

I already [filed an issue](https://support.servoy.com/browse/SVY-4164) with Servoy for this but they say that it’s a feature and that changing this behavior might break existing solutions. (Of course this new behavior already broke existing behavior to begin with…)

So my question to you all is who is using this new style behavior and who thinks this should be reverted to the old behavior.  
I think it’s still a nice feature so perhaps Servoy should add a form property (checkbox) to enable this behavior as an option (i.e. Opt-In) instead of making it the default.

Please vote or add a comment to the ticket (or in this thread)  
[https://support.servoy.com/browse/SVY-4164](https://support.servoy.com/browse/SVY-4164)

Thanks for any input!

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [March 25, 2013, 11:01pm UTC](https://forum.servoy.com/t/undocumented-feature-breaks-existing-style-usage-pls-vote/17141/2 "2013-03-25T23:01:46Z")

</div>

From Troy: rename your form.border class to something unique and the find/replace in your \*frm files on regexp:

```auto
(?s)(items:\[.*\](?:.*?)styleClass:")(?:border)(")

```

replace with:

```auto
$1uniqueStyleName$2

```

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [March 26, 2013, 1:13pm UTC](https://forum.servoy.com/t/undocumented-feature-breaks-existing-style-usage-pls-vote/17141/3 "2013-03-26T13:13:43Z")

</div>

Just received word that this issue is now solved (6.1 and 7.0).
