2

I would like to have something similar to Picklist, but Picklist needs to bind to sObject.

Other than InputText, is there any component to get user input that does not correspond to a field on a Salesforce object?

5

There are many different VF tags that don't tie directly to a SF object, but rather than controller properties.

inputText
inputCheckbox
inputHidden
inputTextArea
selectList
selectOption
selectOptions
selectRadio
selectCheckboxes

Check the VF developers guide for info on these

http://www.salesforce.com/us/developer/docs/pages/

Also, new in the Winter 14 release, they came out with the <apex:input> tag. This tage references a controller property and does not need to tie to a SF object field.

From the Release notes.

is a new, HTML5-friendly, general purpose input component that adapts to the data expected by a form field. It uses the HTML type attribute to allow client browsers to display type-appropriate user input widgets

More Information

https://help.salesforce.com/help/pdfs/en/salesforce_winter14_release_notes.pdf

http://blogs.developerforce.com/developer-relations/2013/08/winter-14-developer-preview.html

1
  • Thanks, @SF_Ninja! This looks like a comprehensive list.
    – Mingyu
    Oct 30 '13 at 20:56
4

I think you're looking for apex:selectList.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_selectList.htm

3
  • Thanks, @couchand! This is really similar to Picklist. The only problem is that it displays all the options at once, which looks weird in view mode.
    – Mingyu
    Oct 30 '13 at 20:56
  • You can prevent this by setting the size to 1, then it only shows 1 selectoption at a time, and looks like a traditional picklist Oct 30 '13 at 20:58
  • Great, that's exactly what I want. Thanks, @SF_Ninja!
    – Mingyu
    Oct 30 '13 at 21:05

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.