Questions tagged [selectoption]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
13
votes
3answers
3k views

Is there a way to group options in a selectList

Is there a way to group options in an apex:selectList I have in my page <apex:selectList styleclass="form-control rec" size="1" id="country" > <apex:selectOption ...
7
votes
3answers
4k views

Return specific fields for sObject List

How can I control the getFieldTypeOptions method to return specific fields. In this case itreturns all available fields. Lets say I want only field name fieldName1 and fieldName2 public with ...
5
votes
1answer
6k views

Is it possible to re-render select options for a SelectList based on selected options for other SelectList controls on the same page?

I am trying to figure out how I would dynamically update the SelectOptions for multiple SelectLists on the same visualforce page. I have a page where the user selects contacts that are associated ...
5
votes
1answer
2k views

How to populate picklist values in Lightning Componets according to the metadata definition?

In Visualforce, we didn't thought much about picklist-values (=options) on simple CRUD UIs - they where simply there using an <apex:inputField ... /> Now in Lightning I found this documentation ...
4
votes
3answers
14k views

Apex:selectList value - How to set it initially?

I have a complicated problem so i'm hoping to ask this question generically: I see a lot of examples that mostly work just fine with SelectList and SelectOptions. My particular problem is that i can ...
4
votes
4answers
5k views

Adding/defaulting a null value to a selectlist on a Visualforce page

I am creating a VF page that basically has different "pages" that each have different questions on them. Each "page" is a different outputpanel that is rendered depending on clicking a Continue or ...
4
votes
2answers
286 views

Got problem on SelectOptions on Multiple Products

I got products. public List<ProntoEVents_Product__c> getProducts() { if(products == null) { products = [SELECT Id, Name, ProntoEvents_Product_Name__c, End_Date__c, Price__c, ...
3
votes
2answers
9k views

How to create select option in LWC?

I am creating a select option in LWC. From server side controller I am returning list of wrapper having key and value as below- [{"key":"All Accounts","value":"00B7F000006l0B3UAI"}] I the html ...
3
votes
2answers
4k views

Selectoptions used in SelectCheckboxes shows the checkboxes in a single Row

Selectoptions used in SelectCheckboxes shows the checkboxes in a single Row. I need to show the checkboxes in different rows. Ho can this be acheived. My code is : <!-- Page: --> <apex:page ...
3
votes
1answer
739 views

Invalid selectOptions found. Use SelectOption type in Apex (why?) [duplicate]

I was trying to add a dropdown menu inside VF page (where I already have other pageBlockTables). I only need to retrieve one field (c.sfprn) from an existing SOQL query where it is already used for ...
3
votes
2answers
11k views

How can I set the default Value on a custom SelectOption List?

The Following works good to retrieve my account list in a SelectList on my VF. But I'm trying to set a specific Default Account as the first value in the list - Now it shows up last.. *Is there any ...
3
votes
1answer
1k views

js remoting result returning selectOption

i wanted to know how to separate the selectOption value and lable in the result returned by js remoting function. i have a js remote function in apex page: <script> function sayhello() {...
3
votes
1answer
4k views

Language Translation for picklist values in VF Page

There are 2 picklist fields in my VF page. I successfully translated the whole VF page using custom labels (into Spanish), but the picklist values are not translated. How to translate them? Here's ...
3
votes
2answers
106 views

SelectOption Method only working before clicking commandButton (quiscksave)

Newb Alert With a basic Extension, I populate a field with a SOQL. The desired behavior is when the lookup field is populated by a user, the second field shows a picklist with only the relevant ...
3
votes
1answer
1k views

Dynamic Component Select Radio Selected Value

I have built a dyanmic component as selectOption (select radio with select option values). I need to know how can I access the selected value? (which radio button is selected?) Below is my code VF ...
3
votes
0answers
300 views

<optgroup> functionality in salesforce

Good day everyone, I want to create a select in salesforce which look is similar to html tag optgroup. I want create an option within an option. Is it possible ? If yes, how will I do it ? Thanks...
2
votes
2answers
1k views

Id none must be 15 characters

I am getting below error during execution time for below code in Apex page. I am unable to assign the value from here to standard controller. Can someone please help me? Apex Page <apex:...
2
votes
1answer
2k views

Render an InputText based on Selected Option

In my VF page I have an apex:selectList with a List of Vendors (e.g. Alcatel,Cisco ec..), the last option is "Other". When the user select "Other" an apex:inputText should be rendered where he can ...
2
votes
1answer
3k views

Multiple line itemLabel in apex:selectOption

I have a situation that should be pretty easy, but I can't seem to make it work. <apex:selectRadio id="restrictRadioBtns" layout="pageDirection" value="{!restrictedObjSettings.Restriction_Type__c}"...
2
votes
1answer
259 views

Cross Site Scripting issue

I am getting XSS issue for the following statements in my code : a. lstDisplay.add(new SelectOption('','--None--')); b. lstDisplay.add(new SelectOption(selectOptionObj.getValue(),selectOptionObj....
2
votes
1answer
451 views

Entity is not API accessible Error

I've been trying to create a wrapper class for either SelectOptions and/or input checkboxes combined with pseudo Id's for both the checkbox and a Description text area input field to send to a ...
2
votes
1answer
8k views

Get value of selectOption and populate value elsewhere on Visualforce page

I'm trying to take a selectOptions component, and display/manipulate it's value once selected onclick. So far I'm able to place actionSupport inside of my selectList but I'm not sure how to actually ...
2
votes
1answer
71 views

Controller not getting selected item

This is a large controller, so it's possible this is a naming issue, but I'm not able to get selected values for a section of code and want to see if someone sees something obvious that I'm missing. ...
2
votes
1answer
2k views

Pass parameter from html select tag to controller

I want to pass parameter that selected from html select tag to my controller (assign it to string "city") what should i do to achieve this ? --Visualforce-- <select> <option value="" ...
2
votes
1answer
1k views

Custom Sort of SelectOption [closed]

I have a scenario in which i need to display the country data in below format: United States Canada {Alphabetical Ascending sort of the remaining countries} The data is coming from custom table ...
2
votes
1answer
1k views

inputcheckbox behavior with select option actionfunctions clarification

After looking at a LOT of posts, I've concluded that I'm confused on exactly how input checkboxes behave. I've created a custom wrapper class around a select option that looks like list<string ...
2
votes
1answer
668 views

Output label not conditional

I have a requirement to show page message for a particular selected template. The template selection done here. But render is always returning true in this case. Can someone help me here? <apex:...
2
votes
0answers
643 views

Rendered not working translated picklist value radio buttons

Im trying to translate visualforce page. I have used custom labels to built the page. the page is translated good. For picklist values I used the below code, the picklist values are also translated ...
1
vote
1answer
3k views

SelectOption with every picklist value as an option

I have a table & in it there is an attribute that is a picklist with 4 values, as seen: I'm trying to make a dropdown selectlist, something that would look like this: but adding these options ...
1
vote
1answer
153 views

Is there a way to override System class?

I made a new class and named it SelectOption.cls so i could use it as wrapper class, and after a while i noticed that other Apex controller was using System SelectOption class, and that visualforce ...
1
vote
2answers
662 views

Create dropdown list of pricebooks

I'm in the process of creating a variable dependent picklist, where you can select a pricebook from a dropdown and then a multiselect picklist will show the products in that pricebook. So far, I have ...
1
vote
1answer
430 views

SelectOption List not populating dropdown on VF Page

I've been over the code a thousand times but cannot work out why the getVenueLst() method is not populating the SelectList on the vf page. Anyone have any ideas? Controller Public string ...
1
vote
1answer
1k views

saveRecord Component: Set Required Picklist values

I am trying to just get a simple record saved, and I continue to get errors saying I am not setting a required field, campus__c. I have a ui:select component which should explicitly define the values....
1
vote
2answers
4k views

How retreive the selected option for ui:inputSelect on component load?

I'm working on a lightning app with variety of questions that the user answers by selecting an option from a ui:inputSelect component and then saves their answers to a field on my object. I have save ...
1
vote
2answers
70 views

question on using pageblocksection

A part of VF page is below: <apex:pageBlockSection title="EVALUATION"> <apex:pageblockTable value="{!interviewSkillReviews}" var="skillreview"> <apex:column headerValue="...
1
vote
1answer
79 views

can you please suggest me how to retain the same picklist values after selecting the one since it is repeating each time on selection

Posting my code here... <apex:page standardController="Patient_Registration__c" extensions="soption09"> <apex:form id="myForm"> <apex:selectList size="1" value="{!listvalue}"> &...
1
vote
3answers
3k views

How to display a picklist based on the value chose on another picklist

I need to display two picklist in VF page. I have created a picklist using selectoption (Say PickList1) which has values of '1,2,3,4,5'. Now on selecting a value from this picklist i need to display ...
1
vote
2answers
1k views

Invalid selectOptions found. Use SelectOption type in Apex error

I am getting the error stated in the question. I have used a <selectOption> list in my controller and in my VF page, I have used <apex: selectOptions>. What is the issue? I have attached ...
1
vote
1answer
255 views

How to capture the order of user-selections from a multi-select picklist

Right now SelectOption is sorting my selection of documents based on the TimeStamp of the document that has been uploaded, but I want to be able to have my list to be same order as what I select and ...
1
vote
1answer
1k views

javascript show a div while check radio button

I have 3 radio buttons, and when I select one I want that the div corresponding div shows up. <apex:form > <apex:selectRadio value="{!livraison}" layout="pageDirection" id="radios"> <...
1
vote
1answer
718 views

Aligning selectOption in PageBlockSection

me again. So, take this: <apex:pageBlockSection id="clientsList" title="Clients List" rendered="{!searchCriteria.Search_Type__c ='Clients List'}" columns="1"> <apex:...
1
vote
1answer
215 views

Transfer SelectOption Values to Dynamin Query

Trying to get the values to my Controller that I can change the limit on the displayed List on my Page. I'm Using a dynamic query and everything is working fine but what's below. What am I'm missing? ...
1
vote
1answer
345 views

selectlist inside apex:column errors out

I have a pageblock table with column as a selectlist, populated from controller. Here is the code: <apex:pageBlockTable value="{!records}" var="k" id="thePageBlockTable" rendered="{!records.size&...
1
vote
1answer
1k views

Getting Keys from SelectOption in a String List

I have a getter method to create a SelectOption. I want to put all the keys in Returned value to a List in another Method. public List<SelectOption> getsortlist() { List<SelectOption&...
1
vote
1answer
1k views

Get the value of drop down list that was selected earlier

In my piece of code below, I use select list tag to get user's input for a field of an object. I have a text field type for an object which I am trying to update using a VF page. <...
1
vote
2answers
288 views

Update user input value to a custom field

I have a below Visualforce page , where I am getting a user input using drop down selection. This input is for a custom field of an object which I need to update once I click save on the VF page. VF ...
1
vote
1answer
166 views

Place input tag inline with a specific selectRadio option

I have a select options tag inside a select radio Tag. I am trying to achieve something in which I will have radio button with its label and then an input box in line. below is my apex code` <...
1
vote
3answers
296 views

getting error Unknown property 'Multipicklist.getPicklistValues' for VF page

I have one controller and one VF page.I am getting error saying "Unknown property 'Multipicklist.getPicklistValues'" for VF page.Dont know why it is. Controller: global class Multipicklist { ...
1
vote
2answers
744 views

selectOption Required only when Rendered

I have a vf page with radiobuttons. This is rendered only when a condition satisfied. The radiobuttons need to be mandatory only when it is rendered. But the problem is even if the radio options are ...
1
vote
0answers
154 views

'actionSupport' is not working when inputField is included in same 'form'

What I am doing ? I have 3 fields in an object Account(lookup to Account),User(Lookup to User) and Permissions(Multi select picklist). I needed to only show few values from all the values in ...