<apex:selectOption itemvalue="Reports" itemLabel="select Report" />
<apex:selectOption itemvalue="1" itemLabel="Test1"/>
<apex:selectOption itemvalue="2" itemLabel="Test2"/>
我首先选择值1,如何在visualforce页面中选择2后检索值1
</apex:selectList>
答案 0 :(得分:0)
您可以使用onfocus
组件的selectList
属性来存储选项列表的当前值,然后在某些JS变量和onselect
或onchange
selectList
属性中选择新值。 1}}用于处理新旧值。
<apex:selectList value="{!test}" onfocus="storeOldValue(this.value)">
<apex:selectOptions value="{!testOptions}"/>
</apex:selectList>
<script type="text/javascript">
function storeOldValue(oldValue){
oldVal = oldValue;
}
</script>