Ricardo Vaz Alves wrote:
Do you know how to do this for a check box??I have an app where I'd like to change the background if checked and updated from orig value to RED, and #FFBBBB if Unchecked and updated from orig value.. At the moment I'm resorting to changing the Font color of the Title, to red, but it is clunky and not consistent with what we are doing for other fields..
Thanks in advance..
Hi,
How about having a condition with 3 results? for example, i want to set the style with red, blue and white?
ty
Hi Nhorwin,
Given this is on topic, I'll just answer it here, but in the future please refrain from waking up old threads from 3 years ago ;) It is best to just post a new question.
Why not chain two If() functions? For instance, if you want that behaviour on text color, assigning something like this to the style extended property would do the trick, no?
"color: " + If(condition1, "red", If(condition2, "blue", "white")) + ";"
Hope this helps!
Hi Steve,
You can Check condition On Check Box On Change event. You can set local variable as Variable parameter to Checkbox and On Change event you can verify the variable to set condition True/False.
There still is no easy way to style a browser's default checkbox/radio-button look & feel without replacing the entire thing with your own. This is actually what has been down in OutSystems in recent versions of the platform that use Silk UI or OutSystems UI.
I did some digging using the OutSystems UI Reactive Style Guide, but it should be similar for OutSystems UI Web:
You can change the background of the checkbox by setting the background-color of the [data-checkbox]:before selector, like this:
[data-checkbox]:before { background-color: #FFBBBB; border-color: #FFBBBB; }
And for the background once selected use:
[data-checkbox]:checked:before { background-color: red; border-color: red; }
As is, this would apply to all Checkboxes in screens where this CSS is applied.
Jorge Martins wrote:
Thank you for taking the time to look at this.. Couldn't get this working in Os 10... tried versions with [data-checkbox] and [checkbox]... Quite frustrating as I have it working for normal inputs.. Checkboxes are not obvious if they have been updated, from the original value.
Steve,
I don't know how this was implemented in Silk UI, maybe not exactly the same?... but don't have any O10 server to analyse. You can use the Browser's Developer tools to inspect what styles are applied to your Checkboxes, it's likely something similar to what has been implemented in OutSystems UI on O11.