+ Start a Discussion
SiddharthSiddharth 

get selected item value from selectlist when clicking on output link

Hi,
 
On my VF page i have a Dropdownlist and a PageBlockTable section and I am building OutputLink in PageBlockTable. I need, that when ever user clicks on the link, whatever value is presently selected in dropdownlist should be added as a parameter to my URL for the new VF page.
 
My Dropdownlist is populating at runtime as below:

<apex:selectList id="type" value="{!ROIOptions}" size="1" >

           <apex:selectOptions value="{!ROIFieldValues}"/>

</apex:selectList>

I tried using <apex:param> tag but no luck with that. Is this possible.
 

<apex:pageBlockTable value="{!Campaigns}" var="cmp">

      <apex:column width="10%">

           <apex:outputLink value="/apex/Marketing_Campaign?pcnt=0&id={!cmp.Id}">{!cmp.ExtnName}

                <apex:param value="{!ROIOptions}" name="mode" ></apex:param>

            </apex:outputLink>

      </apex:column>

Using above stuff just adds parameter name but no value is assigned. Suggestion??
 
 
Thanks
Siddharth 
hisrinuhisrinu
Hi Siddharth,

    If you want to pass that value as a parameter, you need to get that value to the controller and then you need to set that value as a parameter to the current page using pagereference.getparameters.put('value').

I hope this will solve your problem.