p:menuItem and width

UI Components for JSF
Post Reply
chudikm
Posts: 16
Joined: 13 Jun 2011, 15:33

07 Nov 2011, 16:55

Hi,

can be a p:menuButton styled in some way?

My problem is the width of component is too narrow to a text I want to place there

Code: Select all

<p:menuButton value="Options"   >  
                                <p:menuitem value="Some a little bit longer text is here"   icon='some-icon'    >
                                    ....
                                </p:menuitem>   
                               
                                  
 </p:menuButton>
 
Then what will happen is that text gets wrapped. So icon is on one line and text on other line - very ugly.

However changing width would help - I tried it dynamically in chrome.

But I am not sure how to set it in xhtml on p:menuButton.

style="width:200px" does nothing.

Changing it on p:menuItem helps neither. Generated sub-div is broader but frame of context menu is still narrow.

Can anyone help?

Thanks,

Milan
GF: 3.1.1
PrimeFaces: 3.0.1
JSF:2.0

mayconcancini
Posts: 3
Joined: 12 Dec 2011, 17:07

02 Feb 2012, 23:12

Primefaces 3.0.1 uses a default menuitem width 150px. By example, to change this width to 200px,
create a CSS to your XHTML (Example):

example.xhtml:
----------------------
<h:head>
<link
href="/myproject/resources/css/default.css"
rel="stylesheet"
type="text/css" />
(...)


default.css:
-----------------
.ui-menu .ui-menu-parent .ui-menu-child {
width: 200px;
}
Maycon Jose
PrimeFaces 3.0.RC1
Glassfish 3.1.1
Mojarra 2.1.4

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests