function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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.