You need to sign in to do that
Don't have an account?
N>Help Removing An Option on Other Dynamic SelectOptions
I have some code that displays dynamic values in a selectlist
<apex:pageBlock >
<apex:pageBlockTable value="{!Sample}" var="field" styleClass="table table-striped">
<apex:column value="{!Sample[field][0]}" headerValue="Salesforce Field"/>
<apex:column headerValue="CSV Field">
<apex:selectList value="{!Sample[field][1]}" styleClass="form-control" size="1">
<apex:selectOptions value="{!csvField}"/>
</apex:selectList>
</apex:column>
<apex:column >
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
the problem is I want to remove the value that one selectlist has chosen
ex. options = Name, Gender, Age
I want to remove Name from other selectlist if one of the selectlist chooses it. It's my first time so I don't know how to do it.
The dynamic values in the selectlist are from an uploaded csv file.
<apex:pageBlock >
<apex:pageBlockTable value="{!Sample}" var="field" styleClass="table table-striped">
<apex:column value="{!Sample[field][0]}" headerValue="Salesforce Field"/>
<apex:column headerValue="CSV Field">
<apex:selectList value="{!Sample[field][1]}" styleClass="form-control" size="1">
<apex:selectOptions value="{!csvField}"/>
</apex:selectList>
</apex:column>
<apex:column >
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
the problem is I want to remove the value that one selectlist has chosen
ex. options = Name, Gender, Age
I want to remove Name from other selectlist if one of the selectlist chooses it. It's my first time so I don't know how to do it.
The dynamic values in the selectlist are from an uploaded csv file.
you have to change your code according to your other part of the class.
There are few errors I made when initializing the list of List<SelectOption>:
Remember that:
All Answers
Hi miczster,
I can imagine you have more than 1 selectlist defined as your script in the page.
You are asking something that could be done both via javascript and via Apex.
I will show you how to handle this via Apex (because via Javascript could be done in different ways and may be more complex).
N.B. This is only an hint, it is "not tested" code.
In the controller: Where:
May the Force.com be with you!
I worked with the code you gave me and I encountered few errors and solved them and I stopped with an error
Variable does not exist: csvOriginal
I tried declaring it on my own and I get different errors all the time. May I ask how to do it?
you have to change your code according to your other part of the class.
There are few errors I made when initializing the list of List<SelectOption>:
Remember that: