Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7520129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:00:48+00:00 2026-05-30T02:00:48+00:00

I am using JSF 2.0 I am able to add Background image to the

  • 0

I am using JSF 2.0

I am able to add Background image to the JSF button but am not able to add icon to the button.

My Requirement is:- JSF button with Background image and a Icon

Following code am using to add background.

     <!-- Discard button-->
        
<h:commandButton action="discard"  style="background-image: url('..\\Images\\leftMenuActiveBg.png');width: 150px;height: 30px;color: white;border-color: white;font-size: 15px; "  value="#{message.discard}">
<rich:componentControl target="popup" operation="show" />
 </h:commandButton> 

Can somebody help me in adding a icon to the button too please.
enter image description here

I am updating a image for better Explainanation as what I want to achieve and I what I have achieved till now with above code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:00:48+00:00Added an answer on May 30, 2026 at 2:00 am

    So you want a button with two background images? That’s not possible on a single HTML element. The <h:commandButton> generates an single HTML <input type="submit"> element, while you basically need a <button type="submit" class="background"><span class="icon"> instead. You’d need to create a custom component which generates exactly that HTML, or to adopt a 3rd party component librarty which has such a component in its set, such as PrimeFaces. See also the <p:commandButton> showcase.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using JSF 2.0 and it's new (actually old, but now incorporated in JSF)
I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have
I'm using JSF 1.2 with Spring on Tomcat 6.0.18. I am able to successfully
I've been using JSF for a while but there's something that has always confused
I want to perform the following task using JSF / Richfaces On click of
With JSF 2 you should be able to do this: <h:commandButton action=#{myBean.myAction(myParameter)}/> which would
In JSF 2.0 have the following: Using this as a base <h:inputText id=email size=60
I'm new to JSF. I am using JSF 2.0. I'd like to be able
I'm using JSF/Facelets, and I'm trying to iterate over some Document objects (custom object)
I'm using jsf 1.2. When a particular jsp has more than one form with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.