You need to sign in to do that
Don't have an account?
Vincent van Drunen Littel
Create a simple searchbox in VisualForcePage
I would like to create a simple searchbox within my visualforce page.
Could anyone help with this?
Could anyone help with this?
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html
Page:- Class:-
Please mark this as solution if this will help you
Thanks
Amit Chaudhary
All Answers
Please find the below code,
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html
Page:- Class:-
Please mark this as solution if this will help you
Thanks
Amit Chaudhary
i already have the VF page and wanted to implement it here, how would you adjust the code?
Controller
Also I have 2 questions to the side if one of you would be able answer would be great.
1. I would like it to show about 20 records per page and have a "previous & next" buttons to show the next 20 records etc.
2. The "add Target" button is not working for some reason, I have this same code applied for different object and it works there, can you see where I'm wrong?
Thank you
Also I have 2 questions to the side if one of you would be able answer would be great.
1. I would like it to show about 20 records per page and have a "previous & next" buttons to show the next 20 records etc.
Amit :- You need to user pagination for same
2. The "add Target" button is not working for some reason, I have this same code applied for different object and it works there, can you see where I'm wrong?
Amit :- I am not able to see any method "addTarget" in your code.
Please try below blog code :-
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html
In this code you can see pagination
Hi Amit, thanks for the quick response.
About the method "addTarget" i think is strange.. as i copied this code from a working one and changed around object and names to target..
Would you be able to show me where i need to put the method that is missing?
ps; Im new to apex code, so i most likely dont see what you see..
thanks a million
My suggestion for pagination go with standardsetcontroller --> https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_pages_standardsetcontroller.htm
For "addTarget", i saw this button in your visualforce page. But where is the "addTarget" method in controller. What function you want to do using this button?
go figure... add button is working..
Here are my codes,
and error
Error: Compile Error: Variable does not exist: selectedlstAccounts at line 27 column 40
To get the selected record you can create the Wrapper classes in salesforce
Please check below post
https://developer.salesforce.com/page/Wrapper_Class
if you want pagination with Wrapper class then please try below code :-
http://amitsalesforce.blogspot.in/2014/11/pagination-with-wrapper-class-with.html
NOTE:- You need to merge your code with wrapper class code.
Pleas let us know if this will help you
HI
Ajay K Dubedi
Class:
public class DataTableExampleController {
public List<Contact> contactList {
get {
if (contactList == null) {
contactList = [SELECT Account.Name, FirstName, LastName, Phone FROM Contact limit 1000];
}
return contactList;
}
set;
}
}
Page:
<apex:page Controller="DataTableExampleController" readOnly="true">
<head>
<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
<apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
<apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
<script>
j$ = jQuery.noConflict();
j$(document).ready( function () {
var contactTable = j$('[id$="contacttable"]').DataTable({
});
});
</script>
</head>
<body>
<table id="contacttable" class="display">
<thead>
<tr>
<th>Account</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<apex:repeat value="{!contactList}" var="contact">
<tr>
<td>{!contact.Account.Name}</td>
<td>{!contact.FirstName}</td>
<td>{!contact.LastName}</td>
<td>{!contact.Phone}</td>
</tr>
</apex:repeat>
</tbody>
</table>
</body>
</apex:page>
in the same process i want to display account Details . in this senario here searching based on contact firstname . i want to search based on account number