1

My xhtml code is:

<p:selectOneMenu id="advanced" value="#{bean.selectedColorName}"
                                effect="fade" var="t" filter="true"
                                filterMatchMode="startsWith">
        <f:selectItems value="#{bean.colorList}" var="color"
                                itemLabel="#{color}" itemValue="#{color}/>

        <p:column>
                <p:panel style="width:20px;heigth:20px;background:red"/>
        </p:column>                     

</p:selectOneMenu>

According to above code I want a color tile with color red, next to the select Item. But now, it is displaying only the select item. In the original requirement, I need to to display the color tile, with the actual color as said in the selectItem. For ex: red color tile in front of red; blue tile inf ront of blue etc.

I referred the Primefaces SelectOneMenu's Advanced option. But no help. What I'm missing here?

Harihara_K
  • 174
  • 16
  • You have to add columns for your selectOneMenu. Please refer to the documentation [here](https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml) on how to do what you need. Look at the Advanced code. – Jorge Campos Jun 24 '20 at 18:15
  • PF showcase selectonemenu advanced feature shows a different example... https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml. what is weird in my humble opinion is that it would have cost you more time to write a question then to read the showcase and manual – Kukeltje Jun 24 '20 at 18:22
  • @Kukeltje As I have said in question, I have referred the document of primefaces. But I'm not able to reflect it back in my screen. I have edited the code in my question, which now includes the p:column. Where did I go wrong? – Harihara_K Jun 24 '20 at 18:30
  • You said you 'referred' to it but had a complety wrong example. It then just looks to us like you did not use the example but just mentioned it. In addition you do not use the var in the color and do not mention if ypu have a somewhat changed behaviour. You e.g. did not inspect the client-side html and mentioned the results. And also please mention version info (PF3 did not have this feature) – Kukeltje Jun 24 '20 at 18:39
  • As it may help any other , who is facing the same issue; BaluC has provided the answer for this https://stackoverflow.com/questions/32735770/pselectonemenu-doesnt-render-custom-content-via-pcolumn-on-liststring – Harihara_K Jun 24 '20 at 18:45
  • 1
    Thanks! Good find! Please file an issue with PF to see if they can 'fix' this. – Kukeltje Jun 24 '20 at 19:08

0 Answers0