0

I have a design problem in implementing search functionality for custom report developing on visual force page

i was getting data through rest api in apex from external system and converting it to list of wrapper class

wrapper class

  public class PatientRecordsWrapp{
    public String BlueStarID{get;set;}
    public String PatientID{get;set;}
    public String FirstName{get;set;}
    public String LastName{get;set;}
    public String PhoneNumber{get;set;}
    public String ProviderName{get;set;}
    public String BlueStarActivationDate{get;set;}
    public PatientRecordsWrapp(){
    }
}

parsing return json to list of wrapper class

public List<PatientRecordsWrapp> patientRecordsList{get;set;} 
patientRecordsList=(list<PatientRecordsWrapp>)System.JSON.deserialize(json,list<PatientRecordsWrapp>.class);

And displaying this list as report to Visual force page

enter image description here

But i was not able to implement search functionality for this list of wrapper class.To achieve this i was storing data in custom object and playing around soql. But client don't want to store any data in salesforce he wants all the things to be on fly without storing any data in salesforce.So i was wondering is there any way to do search using variable name and it's value of wrapper class on a list of it's type.

    Very happy to hear ideas to achieve this

1 Answer 1

1

While you could write Apex code that does the search, but the round trip back to the server makes for sluggish UI.

Instead I suggest you do the search in the browser by turning the table you are presenting into a DataTables table (or pick some other equivalent JavaScript library). This also gives you other features such as pagination. The UI is very responsive because the work is all done in the browser.

Google "datatables salesforce" and you'll find blogs on the subject.

3
  • this was really good idea... but i need to do it server side only because i have to hold the final search result in a list to send back the filtered data to external system..I will try to play around with apex code like doing for looping . And when it comes to purely UI Datatable is really good thing , i have used this in a Java Project
    – Rajasekhar
    Commented Jun 18, 2015 at 8:10
  • @rajasekhar OK. As all the fields are strings, the Apex code shouldn't be too bad.
    – Keith C
    Commented Jun 18, 2015 at 8:13
  • i achieved this through apex coding... because of just few columns it's not lagging much ...
    – Rajasekhar
    Commented Jun 18, 2015 at 10:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .