• Tderosa
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

I have a multselect picklist in my visualforce page as the following:

 

<apex:selectList size="5" id="selectRev" value="{!selRevRange}" onchange="//doSearch();">
    <apex:selectOptions value="{!RevRange}"/>
</apex:selectList>

 

and the following code in apex to populate them:

 

public String selRevRange {get;set;}
public List<SelectOption> getRevRange() {
List<SelectOption> options = new List<SelectOption>();

options.add(new SelectOption('(AnnualRevenue >= 0 and AnnualRevenue <= 20000000)','$0-20M'));
options.add(new SelectOption('(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000)','$20-50M'));
options.add(new SelectOption('(AnnualRevenue > 50000000 and AnnualRevenue <= 100000000)','$50-100M'));
options.add(new SelectOption('(AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)','$100-500M'));
options.add(new SelectOption('(AnnualRevenue > 500000000 and AnnualRevenue <= 1000000000.00)','$500M-1B'));
options.add(new SelectOption('(AnnualRevenue > 1000000000.00 and AnnualRevenue <= 5000000000.00)','$1-5B'));
options.add(new SelectOption('(AnnualRevenue > 5000000000.00 )','$5B+'));
return options;
}

 

this works fine.   This multiselect picklist is part of a parameter search screen where I want to save the search values and then pull them up at a later time for the user.  The problem is that for the multiselect it only seems to select the optionwhen there is one value selected and saved.  If I save multiple values it won't highlight them in the box when the search record is pulled back up.

 

Here is what gets saved in the database for the picklist when 2 values are stored:

 

[(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000), (AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)]

 

another note: it works with one value if I take out the outer brackets [ ].  For multiple values I have tried replacing the comma with a semicolon ; and a few other things but I can't seem to find a delimiter that works.

 

Any thoughts?

 

Todd

 

I have a service cloud console app with a visualforce page on the left side that lets a user search for accounts.  If they collapse the left side and then uncollapse it, the visualforce page has lost all of it's search parameter values and the result set of search items.  It's as if the page has reloaded.  Has anyone seen this before and come up with a solution?

Thanks,

Todd

I have a multselect picklist in my visualforce page as the following:

 

<apex:selectList size="5" id="selectRev" value="{!selRevRange}" onchange="//doSearch();">
    <apex:selectOptions value="{!RevRange}"/>
</apex:selectList>

 

and the following code in apex to populate them:

 

public String selRevRange {get;set;}
public List<SelectOption> getRevRange() {
List<SelectOption> options = new List<SelectOption>();

options.add(new SelectOption('(AnnualRevenue >= 0 and AnnualRevenue <= 20000000)','$0-20M'));
options.add(new SelectOption('(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000)','$20-50M'));
options.add(new SelectOption('(AnnualRevenue > 50000000 and AnnualRevenue <= 100000000)','$50-100M'));
options.add(new SelectOption('(AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)','$100-500M'));
options.add(new SelectOption('(AnnualRevenue > 500000000 and AnnualRevenue <= 1000000000.00)','$500M-1B'));
options.add(new SelectOption('(AnnualRevenue > 1000000000.00 and AnnualRevenue <= 5000000000.00)','$1-5B'));
options.add(new SelectOption('(AnnualRevenue > 5000000000.00 )','$5B+'));
return options;
}

 

this works fine.   This multiselect picklist is part of a parameter search screen where I want to save the search values and then pull them up at a later time for the user.  The problem is that for the multiselect it only seems to select the optionwhen there is one value selected and saved.  If I save multiple values it won't highlight them in the box when the search record is pulled back up.

 

Here is what gets saved in the database for the picklist when 2 values are stored:

 

[(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000), (AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)]

 

another note: it works with one value if I take out the outer brackets [ ].  For multiple values I have tried replacing the comma with a semicolon ; and a few other things but I can't seem to find a delimiter that works.

 

Any thoughts?

 

Todd