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

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.

  • 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 Jun 18 '15 at 8:10
  • @rajasekhar OK. As all the fields are strings, the Apex code shouldn't be too bad. – Keith C Jun 18 '15 at 8:13
  • i achieved this through apex coding... because of just few columns it's not lagging much ... – rajasekhar Jun 18 '15 at 10:14

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.