Search By Activity Name
Previous Next
//////And Here is My Vf Page////// ", "answerCount": 1, "upvoteCount": 0, "datePublished": "2013-11-13T14:21:28.000Z", "author": { "@type": "Person", "name": "Mohan potru", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009bx8bAAA", "affiliation": { "@type": "Organization", "name": "--" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hey Mohan,   You're gonna need some SOQL to do this   String searchTerm = '%' + input + '%';   List accounts = [SELECT Id, Name FROM Account WHERE Name LIKE :searchTerm];   The % are just wildcards in the search!   David", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A7nkgSAB", "datePublished": "2013-11-14T05:17:36.000Z", "author": { "@type": "Person", "name": "David K. Liu", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009YxpWAAS", "affiliation": { "@type": "Organization", "name": "Google" } } } ] } } Skip to main content
Mohan potru が「#Customer Service」で質問
Here i am posting my VF Componet And Vf page For Pagination And now i want to dispaly search by name field in activity name field and search items based on the records anybody help me plz...any java Scipt function for this

 

////My Component/////// 

 

<apex:component selfClosing="true" layout="block" >

 

   

 

    <apex:attribute type="SObject[]" description="List of records that needs to be displayed in the table" name="sObjList" required="true"/>

 

    <apex:attribute type="String[]" description="List of field api name to be displayed as column" name="fieldList" required="true"/>

 

    <!--Inculding the required jQuery Files--->

 

    <apex:includeScript value="{!URLFOR($Resource.jQuery_BlogForce9_162, 'js/jquery-1.6.2.min.js')}"/>

 

    <apex:includeScript value="{!URLFOR($Resource.jqQueryTableSorter, 'jquery.tablesorter.min.js')}"/>

 

    <apex:includeScript value="{!URLFOR($Resource.jqQueryTableSorter, 'jquery.tablesorter.pager.js')}"/>

 

    <script>

 

        $j = jQuery.noConflict();

 

        $j(document).ready(function()

 

            {

 

                //enable sorting in pageblock tables using table sorter plugin

 

                $j(".BlogForce9Table").tablesorter().tablesorterPager({container: $j("#.pager")});

 

             

 

               

 

                $j(".BlogForce9Table").bind("sortEnd",function(e) {

 

                    $j('.mySort').remove();

 

                    $j('.headerSortDown').children().append('<apex:image value="/s.gif" styleClass="sortDesc mySort"  alt="Sorted Descending" title="Sorted Descending" /> ');

 

                    $j('.headerSortUp').children().append('<apex:image value="/s.gif" styleClass="sortAsc mySort"  alt="Sorted Ascending" title="Sorted Ascending" />');

 

                });

 

            }

 

        );

 

               

 

    </script>

 

    <apex:pageBlockSection columns="1">

 

        <apex:pageBlockTable value="{!sObjList}" var="obj" id="myTableBlogForce9" styleClass="BlogForce9Table">

 

            <apex:column headerValue="select">

 

            <apex:inputCheckbox />

 

            </apex:column>           

 

                 Search By Activity Name<apex:inputText />

 

            <apex:repeat value="{!fieldList}" var="f">           

 

                <apex:column value="{!obj[f]}"/>

 

            </apex:repeat>

 

            <apex:facet name="footer">

 

              

 

            </apex:facet>

 

        </apex:pageBlockTable>

 

        <div class="paginator" id="pager">

 

           <span class="prevNextLinks">          

 

                <span class="prevNext">

 

                    <img src="/s.gif" class="first" style="cursor:pointer"/>

 

                </span>              

 

                <span class="prevNext">

 

                    <img src="/s.gif" class="prev" style="cursor:pointer"/>Previous

 

                </span>

 

              

 

                <span class="prevNext">

 

                    Next<img src="/s.gif" class="next" style="cursor:pointer"/>      

 

                </span>

 

                <span class="prevNext">

 

                    <img src="/s.gif" class="last" style="cursor:pointer"/>

 

                </span>          

 

            </span>

 

            <select class="pagesize">

 

                <option selected="selected"  value="10">10</option>

 

                <option value="20">20</option>

 

                <option value="30">30</option>

 

                <option  value="40">35</option>

 

            </select>     

 

         </div>

 

    </apex:pageBlockSection>

 

</apex:component>

 

//////And Here is My Vf Page//////

 

<apex:page controller="pagination" showHeader="true" sidebar="false">

 

<apex:form >

 

<apex:pageBlock title="Sample Pagination ">

 

<c:Enhancedpageblock sObjList="{!ActivityMaster}" fieldList="{!fields}"/>

 

<apex:outputPanel >

 

</apex:outputPanel>  

 

</apex:pageBlock>

 

</apex:form>

 

</apex:page>
1 件の回答
  1. 2013年11月14日 5:17
    Hey Mohan,

     

    You're gonna need some SOQL to do this

     

    String searchTerm = '%' + input + '%';

     

    List<Account> accounts = [SELECT Id, Name FROM Account WHERE Name LIKE :searchTerm];

     

    The % are just wildcards in the search!

     

    David
0/9000