• MX
  • NEWBIE
  • 25 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

Hey there,

 

is there a easy way to sort a SelectList alphabetic in Visualforce? Like sortby ="abc" or something like that, or have I got to do this in my controller?

 

Thanks a lot,

MX

  • March 12, 2013
  • Like
  • 0

Hey there,

 

I want to create a list of all Objects in my Org and then filter them by my definied List, how can i do this?

 

So I have created a list of all Objects like this:

 

public List<SelectOption> getName(){
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd){
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
}

 

This actually works fine.

But I'd like to create a filter, so i made this List of Selectoptions:

 

public List <SelectOption> testObjects = new List <SelectOption>();

public TestOverrideSettingController(ApexPages.StandardController stdController){
testObjects.add(new SelectOption('Event','Event'));
testObjects.add(new SelectOption('Account','Account'));
testObjects.add(new SelectOption('Contact','Contact'));
}

 

But now I don't know how to go on and compare the Elements in the 2 Lists to each other.

 

Thanks a lot for every help.

  • March 11, 2013
  • Like
  • 0

Hi guys,

 

I developed an Visualforce Page, which shows all Objects that are available. Now I want to find all Instances of one Particular Object. 

 

I tried some stuff like this, but can't verify if it works, cause i have no idea how i could get a String with the Name out of the SObject.

Do I need a wrapperclass for showing the Results in a table?

 

String queryString = 'SELECT Id, Name, FROM '+ paramFromVF; // paramFromVF is the name of the Object
List<sObject> L = Database.query(queryString);

 

Anyway, I think this is quite a beginner question, but as I am a beginner this is tough for me at the moment.

Thanks a lot for your help.

  • March 07, 2013
  • Like
  • 0

Hey there,

 

is there a easy way to sort a SelectList alphabetic in Visualforce? Like sortby ="abc" or something like that, or have I got to do this in my controller?

 

Thanks a lot,

MX

  • March 12, 2013
  • Like
  • 0

Hey there,

 

I want to create a list of all Objects in my Org and then filter them by my definied List, how can i do this?

 

So I have created a list of all Objects like this:

 

public List<SelectOption> getName(){
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd){
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
}

 

This actually works fine.

But I'd like to create a filter, so i made this List of Selectoptions:

 

public List <SelectOption> testObjects = new List <SelectOption>();

public TestOverrideSettingController(ApexPages.StandardController stdController){
testObjects.add(new SelectOption('Event','Event'));
testObjects.add(new SelectOption('Account','Account'));
testObjects.add(new SelectOption('Contact','Contact'));
}

 

But now I don't know how to go on and compare the Elements in the 2 Lists to each other.

 

Thanks a lot for every help.

  • March 11, 2013
  • Like
  • 0

Hi guys,

 

I developed an Visualforce Page, which shows all Objects that are available. Now I want to find all Instances of one Particular Object. 

 

I tried some stuff like this, but can't verify if it works, cause i have no idea how i could get a String with the Name out of the SObject.

Do I need a wrapperclass for showing the Results in a table?

 

String queryString = 'SELECT Id, Name, FROM '+ paramFromVF; // paramFromVF is the name of the Object
List<sObject> L = Database.query(queryString);

 

Anyway, I think this is quite a beginner question, but as I am a beginner this is tough for me at the moment.

Thanks a lot for your help.

  • March 07, 2013
  • Like
  • 0