Original field border

Questions and answers for designing and implementing forms in Servoy

Original field border

Postby maria.kyselova » Tue Oct 28, 2014 2:18 am

Hi All,

Does anyone know how to return a field's border to the original border it had before it changed?

What happens is I change a field border colour from the default to red at some point, then I want to put it back to normal.
However I don't know what the normal is, because the field appearance is defined by the stylesheet, so the 'border' property is null, I can't get it from the forms.elements.field.border.
I can't get it from the solutionModel either, because, well, of the same reason.
If I get the stylesheet through the solutionModel, I'd have to parse the css text, which is not a reliable method really.

So what I do is this: elements.field.border = 'DEFAULT'.
It sort of works, but not really :) The screenshot attached shows four fields, the top one is the one I'm changing. So that is the result after assigning the border the 'DEFAULT' value.
Is it the Servoy default border? Because it looks different from the rest of the fields (originally it was the same as them).
Untitled.jpg
Untitled.jpg (9.76 KiB) Viewed 2073 times


Please share a hint or method of returning the border to its original state, if you have a know-how.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: Original field border

Postby jcompagner » Mon Nov 24, 2014 7:05 pm

i think you fall back to dialog font or something

Best is to remember the border before you set another and set that one back.

because i think field.border = null

will not really go to the default
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Forms

Who is online

Users browsing this forum: No registered users and 7 guests