You need to sign in to do that
Don't have an account?
amitashtekar
How to display picklist values on the visual force page without writing any code.
I want to show the picklist value for global variable User on a visual force page.
But it is showing me incorrect parameter.
I have written code within vf as
<apex:outputlabel value="{! TEXT($User.UserType) }"/>
Does anyone knows how to do it.
I have tried different things.
I dont want to write any apex code for it.
Hi,
from the help:
Picklist fields can only be used in the following functions:
Apparently TEXT function is not available in visualforce. But you can use the CASE function like so:
{!CASE($User.UserType,'Standard','Standard','default')}
All Answers
Hi,
from the help:
Picklist fields can only be used in the following functions:
Apparently TEXT function is not available in visualforce. But you can use the CASE function like so:
{!CASE($User.UserType,'Standard','Standard','default')}
You're already using ApexLabel. I'm guessing that the UserType is a field on the User object. I'm not sure you'll get the right output but could you do something like this:
I'm assuming here that you want to use the field value as your label.
It can be used to display the usertype if you have three choices known.
Thanks sebcos.
CASE function helped me a lot.
Hello BrianWK,
Thanks for reply.
But it doesnot work.
The case function worked for me - it's a little awkward but it works!