Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <apex:page controller="VF_Lion_Pitch_Me2NEW" sidebar="false" tabStyle="Pitch_Me__tab">
  2. <apex:form>
  3.  
  4. <script type="text/javascript">
  5. function count()
  6. {
  7. alert('{!RoleTypeCount}');
  8. }
  9. </script
  10.  
  11. <apex:pageBlock>
  12. <div id="" style="" ><b>Role Type:&nbsp;</b> <br/>
  13.  
  14. <apex:selectRadio layout="pagedirection" value="{!SearchRoleType}" onchange="PutValue(this);" style="" >
  15. <apex:selectoptions value="{!roletypesvalue}" />
  16. <apex:actionSupport event="onchange" oncomplete="count()" reRender="" />
  17. </apex:selectRadio>
  18. </div>
  19. </apex:pageBlock>
  20. </apex:form>
  21. </apex:page
  22.  
  23. public with sharing class VF_Lion_Pitch_Me2NEW{
  24. public Integer RoleTypeCount{get;set;}
  25.  
  26. List <Job__c> job =new list <Job__c>();
  27. public List<selectoption> getRoletypesvalue() {
  28. list<selectoption> options = new list<selectoption>();
  29.  
  30. Schema.DescribeFieldResult fieldResult = job__c.Role_Type__c.getDescribe();
  31.  
  32. list<schema.picklistentry> values = fieldResult.getPickListValues();
  33.  
  34. for (Schema.PicklistEntry a : values)
  35. {
  36. List <Job__c> job= [select Role_Type__c from job__c where Role_Type__c=:a.getValue()] ;
  37.  
  38.  
  39. if(job.size()>0)
  40. options.add(new SelectOption(a.getLabel(), a.getValue()));
  41. }
  42. system.debug('7777'+options.size());
  43. RoleTypeCount=options.size();
  44.  
  45. return options;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement