You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2017/11/12 09:42:33 UTC

change borderRadius dynamically

Hi,

what's the way to change borderRadius in a button dynamically?

I can use:

<js:style>
            <js:SimpleCSSStyles id="buttonStyle" borderRadius="3"/>

and this generated

border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;

If I use a change handler with a slider or textinput I can't change the
default value in buttonStyle

There's some way to do this?

Thanks

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: change borderRadius dynamically

Posted by Harbs <ha...@gmail.com>.
Why can’t you change the style value?

It’s a bit odd that the css produced includes each corner separately.
border-radius: 3px should do the same thing.

By default, css is not bound unless you use BindableCSSStyles. You can also handle the value changes manually, but the value needs to be propagated to the element.

HTH,
Harbs

> On Nov 12, 2017, at 11:42 AM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi,
> 
> what's the way to change borderRadius in a button dynamically?
> 
> I can use:
> 
> <js:style>
>            <js:SimpleCSSStyles id="buttonStyle" borderRadius="3"/>
> 
> and this generated
> 
> border-top-left-radius: 3px;
> border-top-right-radius: 3px;
> border-bottom-right-radius: 3px;
> border-bottom-left-radius: 3px;
> 
> If I use a change handler with a slider or textinput I can't change the
> default value in buttonStyle
> 
> There's some way to do this?
> 
> Thanks
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira