• gbabey
  • NEWBIE
  • 0 Points
  • Member since 2010

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

This should be a pretty straightforward one but I can't seem to figure out why this isn't working.  I'm trying to create a select box with the different categoryGroups of knowledge.  It seems to work fine when I use basic html <select> and <option>  but when using <apex:selectList> and <apex:selectOption> it does not.

 

This works:

 

<select name="category">
<option Value="myRoot">--All--</option>
<knowledge:categoryList categoryVar="category" categoryGroup="IssueType" rootCategory="myRoot" level="-1">
<option value="{!category.name}">{!category.label}</option>
</knowledge:categoryList>
</select>

 

 

But this does not (only the  --All-- selection is displayed, nothing inside the categoryList loop)

 

<apex:selectList id="issueTypeList" size="1" value="{!issueType}">
<apex:selectOption itemLabel="--All--" itemValue="myRoot" />
<knowledge:categoryList categoryVar="category" categoryGroup="IssueType" rootCategory="myRoot" level="-1">
<apex:selectOption itemLabel="{!category.name}" itemValue="{!category.label}" />
</knowledge:categoryList>
</apex:selectList>

 

 

Is there something about knowledge:categoryList and apex:selectOption that do not play well together?  I'm sure I could work around it using the basic html controls but was hoping to understand why this isn't working.

 

 

Thanks,

 

George

  • April 26, 2010
  • Like
  • 0

I am trying to pass a string representing a data category to a controller and then filter my SOQL query for knowledge based on that.

 

Ideally I would like to do something like:

 

 

    public String release { get; set; }
    
    public List<FAQ__kav> getFAQsForRelease()
    {
        List<FAQ__kav> faqlist = [select id, Title, Answer__c from FAQ__kav WHERE PublishStatus = 'Online' WITH DATA CATEGORY Releases__c ABOVE release];  
        return faqlist;
    }

 

but I can't figure out if there is any possible way to convert the string object 'release' into an datacategory type. Maybe a helper function or something?

 

I realize a big block of if / else if statements would do the trick, but I am hoping there is a cleaner solution. Thanks in advance.

  • April 20, 2010
  • Like
  • 0

I am trying to pass a string representing a data category to a controller and then filter my SOQL query for knowledge based on that.

 

Ideally I would like to do something like:

 

 

    public String release { get; set; }
    
    public List<FAQ__kav> getFAQsForRelease()
    {
        List<FAQ__kav> faqlist = [select id, Title, Answer__c from FAQ__kav WHERE PublishStatus = 'Online' WITH DATA CATEGORY Releases__c ABOVE release];  
        return faqlist;
    }

 

but I can't figure out if there is any possible way to convert the string object 'release' into an datacategory type. Maybe a helper function or something?

 

I realize a big block of if / else if statements would do the trick, but I am hoping there is a cleaner solution. Thanks in advance.

  • April 20, 2010
  • Like
  • 0