function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gbabeygbabey 

knowledge:categoryList with selectOption

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

Best Answer chosen by Admin (Salesforce Developers) 
etienne.giraudyetienne.giraudy

Hi,

Your issue comes from the fact that nesting knowledge categoryList tag within an apex:select is not supported at the moment. Unfortunately you should then stick to the plain select html tag.

Etienne

All Answers

etienne.giraudyetienne.giraudy

Hi,

Your issue comes from the fact that nesting knowledge categoryList tag within an apex:select is not supported at the moment. Unfortunately you should then stick to the plain select html tag.

Etienne

This was selected as the best answer
Rune AndersenRune Andersen
What's the status of solving this issue?