简体   繁体   中英

Controling the size of dropdown button in p:autoComplete (primefaces)

I'm using primefaces 3 in my jsf 2 web application to show a list of suggestions : p:autoComplete

 <p:autoComplete
     value="#{articleBean.unite}"
     completeMethod="#{articleBean.autocompleteUnite}"
     var="item" itemLabel="#{item.code}" itemValue="#{item}"
     converter="#{articleBean.uniteConverter}" 
     dropdown="true"/>                                      

the attribute dropdown="true" adds a dropdown button next to the input item :

the problem is the size of the dropdown button : it looks huge and I can't change it's size.

is there a style class that controls its appearance of may be style element, please guide me.

<button class="ui-button ui-widget ui-state-default ui-corner-right ui-button-icon-only"         type="button" style="**width: 100px;**">
 <span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span>
 <span class="ui-button-text"></span>

'ui-button ui-widget ui-state-default ui-corner-right ui-button-icon-only' this class may help you.

In your page copy this code into <head> :

<style>
button.ui-button-icon-only {width: 1em} 
</style>

I hope that works for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM