1

this is my page

<apex:page controller="ContactCheckEditController">
   <apex:form id="frm">
      <apex:pagemessages />
         <apex:actionFunction name="check" reRender="table"/>

    <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="{!URLFOR($Resource.TagEditor,'jQuery-tagEditor-master/jquery.tag-editor.js')}" type="text/javascript"></script>
    <script src="{!URLFOR($Resource.TagEditor,'jQuery-tagEditor-master/jquery.tag-editor.min.js')}" type="text/javascript"></script>
    <script src="{!URLFOR($Resource.TagEditor,'jQuery-tagEditor-master/jquery.caret.min.js')}" type="text/javascript"></script>
    <apex:stylesheet value="{!URLFOR($Resource.TagEditor, 'jQuery-tagEditor-master/jquery.tag-editor.css')}" />

    <script>
    $(function() {
        $('input.tag').tagEditor({
                           autocomplete: {
                               delay: 0,
                               position: {
                                   collision: "flip"
                               },
                               source : "/apex/searchEmailJson"
                           },
                           forceLowercase: false
                       });
           });
   </script>
    <apex:pageBlock >
<

div class="form-group">
            <input type="text" name="tag[]" size="50" placeholder="Enter name here"/>
            <input type="hidden" id="tempSearchData"/>
            <br/><br/><br/>
            <textarea cols="100" rows="10" placeholder="Message Here"/>
          <apex:commandButton value="Send"/>
    </div>
    </apex:pageBlock>


this is my jsonPage
<apex:page sidebar="false" showHeader="false" contentType="application/json" controller="ContactCheckEditController" standardStylesheets="false">
[
<apex:repeat value="{!ConWrp1}" var="lc">
<apex:outputPanel rendered="{! lc.index != ConWrp1.size }" layout="none">
    {"0":"{!lc.conList.name}","value":"{!lc.conList.name}","1":"{!lc.conList.id}","id":"{!lc.conList.id}"},
</apex:outputPanel>
<apex:outputPanel rendered="{! lc.index == ConWrp1.size }" layout="none">
    {"0":"{!lc.conList.name}","value":"{!lc.conList.name}","1":"{!lc.conList.id}","id":"{!lc.conList.id}"}
</apex:outputPanel>
</apex:repeat>

]
</apex:page>

this is my class

public class ContactCheckEditController {
    public List<ContactWrapper> ConWrp1{get;set;}
    public List<contact> conList{get;set;}
    public ContactWrapper CW{get;set;}
    public ContactCheckEditController (){
        String term = ApexPages.currentPage().getParameters().get('term');
        conList = new List<contact>();
        ConWrp1 = new List<ContactWrapper>();
        integer i=1;
        for(contact con: [select name,email from contact where name like : '%'+term+ '%' limit 10]){
            CW=new ContactWrapper();
            CW.index=i;
            CW.conList=con;
            i++;
            ConWrp1.add(CW);
        }

    }


    public class ContactWrapper{
        public contact conList{get;set;}
        public integer index{get;set;}
    }
}
  • Issue resolved .problem is that i have not add jquery ui in static resources – Vipin Indora Jan 15 '16 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.