commandButton size

UI Components for JSF
Post Reply
User avatar
brad.revolver
Posts: 21
Joined: 16 Aug 2010, 15:35

16 Aug 2010, 16:06

Hello,

I have a command button like this :

Code: Select all

<p:commandButton style="margin-right:20px;" value="Login" update="growl" actionListener="#{loginBean.login}" oncomplete="handleLoginRequest(xhr, status, args)"/>
I found it from primefaces example page . (By the way I dont understand why the examples are working from http://www.primefaces.org:8080? Since the port is 8080, i cant reach through the company's network. It is too strange. I am sure many people have the same opinion as mine. It is nonsense )

But this button is so huge! How can i re size it? I checked from user's guide - skinning section. But I couldn't handle it.

thanks in advance
Prime Faces 2.2MI
JSF 2.0.3
Mojarra 2.0.3 (FCS b03)
Apache Tomcat-7.0.0
FireFox 3.6.10, IE 8, Google Chrome 6.0.472
Windows 7
IntelliJ Idea

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

16 Aug 2010, 16:48

try by setting style :

Code: Select all

.ui-widget,
.ui-widget .ui-widget {
   font-size: 12px !important;
}
or

Code: Select all

.ui-widget {
   font-size: 75% !important;
}
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

16 Aug 2010, 17:01

Hi,

Welcome to PrimeFaces!

Regarding 8080, we'll make it run on 80 very soon as many users requested this for the same reason.

Is your button larger than the showcase buttons?

As an example, you can try;

Code: Select all

.ui-widget, 
.ui-widget .ui-widget {
    font-size: 12px;
}
This selector is a global selector that applies almost all PrimeFaces components.

ramo.karahasan
Posts: 76
Joined: 18 Apr 2010, 23:57

29 Aug 2010, 18:40

Hi Cagatay,

yes for true, my p:commandButton is larger than the h:commandbutton:

i use this code

Code: Select all

<h:commandButton actionListener="#{executeClass.doSome}" value="Match" >

</h:commandButton>

<p:commandButton actionListener="#{executeClass.doSome}" value="Match"/>
and the result looks graphically like this:

http://img834.imageshack.us/img834/817/ ... age01h.png

And if i do a inline style like this to the p:commandbutton

Code: Select all

<p:commandButton actionListener="#{executeClass.doSome}" value="Match" style="width: auto; height: 20px"/>
than it looks like this:

http://img836.imageshack.us/img836/2995 ... lage01.png

why is that by default so large?

Cheerio,
Ramo

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Aug 2010, 18:56

There are many discussions and solutions to this, please do a forum search.

bobby
Posts: 1
Joined: 17 Oct 2013, 15:05

17 Oct 2013, 15:21

I also have the same question, about how to resize a button. When I search for "button size" and similar, I don't get any topics that seem to be related to my question. If there's an answer already available, could someone post the link here?

kamaleshkumarkg
Posts: 2
Joined: 06 Nov 2013, 08:51

06 Nov 2013, 09:00

Hi,
By the following code u can reduce the button size

<p:commandButton value="Add" style="width: auto; height: 20px;font-size:80%;" actionListener="#{specAddBean.saveSpec}"
ajax="false" />

Regards,
Kamalesh

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

06 Nov 2013, 10:45

in the end it is all just html, css and javascript...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests