• umesh1234
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 9
    Replies
Here is my code
<apex:page controller="demoMyCreditDetails3" sidebar="false" standardStylesheets="false">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://davidstutz.github.io/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="https://davidstutz.github.io/bootstrap-multiselect/dist/css/bootstrap-multiselect.css" type="text/css"/>
<meta charset="utf-8"/>


<apex:form >
<apex:actionFunction name="submitActionFunction" action="{!filterRecords}"  reRender="actionFun">
        <apex:param name="uname" assignTo="{!testString}" value="" />
    </apex:actionFunction>
<select id="example-multiple-selected" multiple="multiple"  >
<apex:repeat value="{!YearItems}" var="stage">  
        <option value="{!stage}">{!stage}</option>  
    </apex:repeat>  
</select>
      
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 <apex:commandButton onclick="submitData();" value="Run Report"/>  
<script type="text/javascript">
    $('#example-multiple-selected').multiselect();
    function submitData() {
        alert('hiiiissi');
        uname = document.getElementById('example-multiple-selected').value;
        uname.length;
        alert(uname);
        
        var a = document.getElementById("example-multiple-selected").innerHTML = uname.length;
        alert(a);
        
        var selected1 = [];
         alert(uname.size());
         
         if (select1.options[i].selected) selected1.push(select1.options[i].value);
         
         
        for (var i = 0; i <= uname.length; i++) {
            if (uname.options[i].selected) selected1.push(uname.options[i].value);
        }
        alert(selected1);
        submitActionFunction(selected1);
        alert('hiiiii');
    }
</script>

</apex:form>
</apex:page>

public class demoMyCreditDetails3{
  public demoMyCreditDetails3(){
    YourObjReference = new Account();
    edList=[select id,Name from Account];
    names=new List<String> ();
      
    
  }
  public string testString{get;set;}
  public String[] Names{get;set;}
  
  public Account YourObjReference{get;set;}
  public List<Account>  yourObjList{get;set;}
  public List<Account>  edList{get;set;}
  public void filterRecords(){
    system.debug('hiiiiiiiiiiii'+testString);
    yourObjList = new List<Account>();
   
    yourObjList = [SELECT Name FROM Account WHERE name IN :Names ];
     
  }
  public static List<String> getDistinctValues(List<String> duplicates){
    List<String> distinctValues = new List<String>();    
    for(String uniqueValue: duplicates){    
        Boolean found = false;    
        for(Integer i=0; i< distinctValues.size(); i++){    
            if(uniqueValue.equalsIgnoreCase(distinctValues[i])){ //Check if current lastname has been added yet    
                found=true;    
                break;    
            }   
        }   
        if(!found)   
        distinctValues.add(uniqueValue);   
    }  
        return distinctValues;  
    }
    public List<String> getYearItems() {
        List<String> yearList=new List<String>();
        for (Account ed:edList) {
            yearList.add(ed.Name);
        }
        yearList=getDistinctValues(yearList);
       
        return yearList;
    }
    
    
    }

please tell me wt idid wrong?
I have one Country text field in VF page i am converting into  select option i can able to select values. but i want to select multiple values from dropdown list using check box(multi seklect)? 
Description:
  I have one Visualforce page in that I want to display values in Dropdown list and I want to select Multiple values either using Check box or using Control .How to do this
Description:
Friends In standard Opportunity I created 2 Record type
one is Enable Record Type,Second One is Disable record type.
I want to do Update Enable record type when Stage is Prospecting,Analysis,Qualification,Quote
I want to do Update Disable record type when Stage is Closed Won
How to achive this for Both Conditions Either Process builder or Work flow.
Description:
I have 1 visualforce page that page i linked to Visualforce Tab.
in that VF i have 4 out putlink if i click one link that tab will go to "HOME" Tab same thing happened for all Link.
I wanty to stay in that VF Tab Only..
 
Description:
How to call visualforce component in javascript?
Friends i am stuck in javascript button,

Scenarion:
In list view i want to select a records and i want to popup total Annual revenue of selected opportunity

Using Javascript
I have one Country text field in VF page i am converting into  select option i can able to select values. but i want to select multiple values from dropdown list using check box(multi seklect)? 
Description:
Friends In standard Opportunity I created 2 Record type
one is Enable Record Type,Second One is Disable record type.
I want to do Update Enable record type when Stage is Prospecting,Analysis,Qualification,Quote
I want to do Update Disable record type when Stage is Closed Won
How to achive this for Both Conditions Either Process builder or Work flow.
Description:
I have 1 visualforce page that page i linked to Visualforce Tab.
in that VF i have 4 out putlink if i click one link that tab will go to "HOME" Tab same thing happened for all Link.
I wanty to stay in that VF Tab Only..
 
Description:
How to call visualforce component in javascript?
Friends i am stuck in javascript button,

Scenarion:
In list view i want to select a records and i want to popup total Annual revenue of selected opportunity

Using Javascript

<apex:page showheader="false" doctype="html-5.0">
<script src="https://ap1.salesforce.com/soap/ajax/28.0/connection.js"></script>
<script src="https://ap1.salesforce.com/soap/ajax/28.0/apex.js"></script>
<apex:includeScript value="/support/console/34.0/integration.js"/>

  
<script type="text/javascript">
      
    
    function Stopfunc(){
        logic.....
    }
    
    function Startfunc(){

    }
    
    function test(){
        alert('hiii');
    }
    $(document).ready(function(){
        test();
    });   
    
</script>

 
<button onclick="Stopfunc();" id="stop_id"> Stop  </button>
<button onclick="Startfunc();" id="start_id"> Resume start </button>
</apex:page>

 

I want to call Stopfunc() and Startfunc() functions from javascript buttons.