SplitButton with StyleClass

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
bigzidane
Posts: 58
Joined: 21 Jan 2015, 22:16

07 Dec 2016, 08:40

Hello All,

I'm using Ultima license. I'd like to apply styleClass for splitButton as

<p:splitButton value="XYZ" styleClass="secondary">

But it appears it doesn't not work. SplitButton still have 'default' color. Please advice.

Thanks,
Nghia

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

07 Dec 2016, 13:09

We use secondary or other color class for only buttons. Therefore, you can override color of splitButton. If you use blue color on theme, please try;

Code: Select all

<style type="text/css">
    body .secondary .ui-button {
        background-color: #e91e63;
        color: #ffffff;
    }
    body .secondary .ui-button.ui-state-hover {
        background-color: #ad1457;
    }
    body .secondary .ui-button.ui-state-focus {
        background-color: #ee4c83;
        outline: 0 none;
    }
</style>

bigzidane
Posts: 58
Joined: 21 Jan 2015, 22:16

07 Dec 2016, 19:58

Thanks a lot. It is working perfectly.

But why SplitButton can't take styleClass as Button in PrimeFaces? Should we support it?

Thanks,
Nghia

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

07 Dec 2016, 20:46

We designed these css classes for buttons. It is by design. I'll talk about this issue with our other team members and get back to you.

raho
Posts: 27
Joined: 05 Feb 2016, 21:08

15 Nov 2022, 11:26

Hi,

I have a similar problem! How to set the styleClass for the menuItem of a splitButton?

Using the approach show by mert does not work!

Code: Select all

<p:splitButton ....>
    <p:menuItem styleClass="secondary" ... />
</p:splitButton>
PF 12.0.4
WildFly 23.0.2.Final

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

17 Nov 2022, 13:31

Hi,

You need to use button classes on SplitButton tag. For the menuitems, you need to write custom styles according to your needs.

Best Regards,

raho
Posts: 27
Joined: 05 Feb 2016, 21:08

17 Nov 2022, 13:34

Thank you, I'll try that ;-)
Regards,
Rainer
PF 12.0.4
WildFly 23.0.2.Final

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

17 Nov 2022, 13:55

You're welcome!

Best Regards,

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests