function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Carter85Carter85 

Help with styling a multi-select picklist in an inputField

I'm having trouble styling a multi-select list properly in my markup.  My table is as show below:
<apex:pageBlockTable value="{!component}" var="none" >
          			<apex:column headervalue="What extra features does the windshield have? (select all that apply):" style="text-align:center;">
          				<apex:inputField value="{!component.Windshield_Features__c}"/>
          			</apex:column>
          		</apex:pageBlockTable>
I simply want to increase the number of visible lines displayed to the user, as at the moment it is quite condensed.  I've made the defalut value of the field 10, but it won't reflect that here.  I've tried the style="size: 10" but that has no effect either.  The only thing which seems to work is style="height:100px".  However, that also enlarges the size of the selection buttons to the point that they look awful so I'm hoping someone knows a way to change the sizes independently because I even tried a styleClass to set the height but for some reason that only affected the button size rather than the table height.
 
Balaji BondarBalaji Bondar
Hi Carter,

Try below style:
style="width: 300px; height: 100px"
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
RamuRamu (Salesforce Developers) 
See if the below article might help

https://github.com/metadaddy-sfdc/Visualforce-Multiselect-Picklist
 
Carter85Carter85
Balaji, that was close, however the arrow buttons are still too distorted regardless of the size combinations I try.  Unfortunately it loos as if they are tied directly into the same width and height style attributes as the display table itself.

Ramu, I was trying to avoid going the custom table route if possible, since if it's already a field in salesforce we've created since it would be easier/faster to manage the items contained within.
David Kingery 3David Kingery 3
You don't modify this in visualforce. You want to modify the field itself in saleforce.  Go to "Object Mananger", "Fields and Relationships", choose the field, and bump up the "# Visible Lines"