2

I am trying to use the standard right-left multi-select picklist in my VF Page so it looks something like this:

enter image description here

I have tried this:

<apex:inputField value="{!Request_for_System_Change__c.Benefits_Reasons__c}"/>     

Unfortunately the default looks like this: enter image description here

and when I try to style it as below:

<apex:inputField value="{!Request_for_System_Change__c.Benefits_Reasons__c}" style="width: 100px; height: 100px"/>

it looks like this:

enter image description here

So how on earth can I get this to look good?

In the standard field definition the picklist is defined as below with visible lines: enter image description here

  • 1
    please check your css. are you doing Standardstylesheet='false' or showheader='false' – Tushar Sharma Jan 5 '16 at 13:07
  • This normally works fine; the problem is likely to be the tags surrounding the apex:inputField or something major in the page as Tushar suggests. – Keith C Jan 5 '16 at 13:21
  • @TusharSharma: Yes, we have standardStylesheets="false" showHeader="false" at the top of the page. so how can I style this properly? – Our Man in Bananas Jan 5 '16 at 13:24
1

I think css is overriding the dropdown css in page.

Please check css static resource or style in page with '.select' and change accordingly.

| improve this answer | |
1

As you have standardStylesheets="false" showHeader="false". SO you have only option left is try to manually style this using the standardfield css. Use this field in some page and copy css from their and use it in your code.

Otherwise you can use https://github.com/metadaddy-sfdc/Visualforce-Multiselect-Picklist . Select which method suits you better. I think in your case first approach is better.

| improve this answer | |
1

as Arun and Tushar have said, the org styles were affecting the select element.

so I changed it to include inline style as below

 style="height:auto !important;"

and now it works

| improve this answer | |
  • Please mark it as answered so that others can get help. – Arun SFDC Jan 8 '16 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.