Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page controller="VF_Lion_Pitch_Me2NEW" sidebar="false" tabStyle="Pitch_Me__tab">
- <apex:form>
- <script type="text/javascript">
- function count()
- {
- alert('{!RoleTypeCount}');
- }
- </script
- <apex:pageBlock>
- <div id="" style="" ><b>Role Type: </b> <br/>
- <apex:selectRadio layout="pagedirection" value="{!SearchRoleType}" onchange="PutValue(this);" style="" >
- <apex:selectoptions value="{!roletypesvalue}" />
- <apex:actionSupport event="onchange" oncomplete="count()" reRender="" />
- </apex:selectRadio>
- </div>
- </apex:pageBlock>
- </apex:form>
- </apex:page
- public with sharing class VF_Lion_Pitch_Me2NEW{
- public Integer RoleTypeCount{get;set;}
- List <Job__c> job =new list <Job__c>();
- public List<selectoption> getRoletypesvalue() {
- list<selectoption> options = new list<selectoption>();
- Schema.DescribeFieldResult fieldResult = job__c.Role_Type__c.getDescribe();
- list<schema.picklistentry> values = fieldResult.getPickListValues();
- for (Schema.PicklistEntry a : values)
- {
- List <Job__c> job= [select Role_Type__c from job__c where Role_Type__c=:a.getValue()] ;
- if(job.size()>0)
- options.add(new SelectOption(a.getLabel(), a.getValue()));
- }
- system.debug('7777'+options.size());
- RoleTypeCount=options.size();
- return options;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement