• Tanny
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi There,

 

I'm trying to get the value from a Selectlist in my VF page to my controller "Task_Leadership". The VF page works fine and the "refresh" button works good too. BUt, I can;t get the value from the SelectList with the ID = "Positions" to my controller. I've tried " ApexPages.currentPage().getParameters().get('Positions');" and no success. Here is the Page and Class:

 

 

<apex:page controller="Taskleader" showHeader="false" >
<apex:form >
<apex:pageBlock id="pageBlock" Title="Activities logged with Presidents in the Last 90 days">
<apex:pageMessages ></apex:pageMessages>
<apex:selectList id="Positions" size="1">
<apex:selectoption itemLabel="President" itemValue="President"></apex:selectoption>
<apex:selectoption itemLabel="Co-President" itemValue="Co-President"></apex:selectoption>
<apex:selectoption itemLabel="Education director" itemValue="Education director"></apex:selectoption>
</apex:selectList>
<apex:commandButton action="{!Refreshtsk}" value="Run Report" />
<apex:pageBlockTable value="{!tsk}" var="tskl" rendered="{!NOT(ISNULL(tsk))}">
<apex:column headerValue="Name" ><apex:outputLink value="/{!tskl.who.id}" target="_parent">{!tskl.who.Name}
</apex:outputLink></apex:column>
<apex:column headerValue="Subject" ><apex:outputLink value="/{!tskl.id}" target="_parent">{!tskl.subject}
</apex:outputLink></apex:column>
<apex:column value="{!tskl.Activity_Type__c}"></apex:column>
<apex:column value="{!tskl.status}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

public class Taskleader
{

    public PageReference Refreshtsk() {
        return null;
    }

  String POS = ApexPages.currentPage().getParameters().get('Positions');
  private List<task> tsk;
  public List<task> gettsk()

    {
    TAsk[] tsk = [select id, subject, who.name, status, Activity_type__C, activitydate, what.name, Account.BillingCity, Account.BillingState FROM Task WHERE WhoID IN ( SELECT Contact__c FROM Leadership_position_code__c WHERE Position__c = :POS and  (Thru_Date__c = null OR Thru_Date__c > :system.today()) and (Start_Date__C <= :system.today()) ) and OwnerID = :UserInfo.getUserId() and createddate >= :system.today()-90];
    return tsk;
    }
}

 

 

Thanks as usual!!