0

When i am using p:menuItem, i am not able to find the converter attribute as we have in the p:selectOneMenu. Is there any alternative to this? Please let me know.

I am using primefaces 3.4.2 version.

Thanks

3AK
  • 1,223
  • 15
  • 22
  • Menu item is component which fires some action (like for example commandButton). What are you using menuitem for? – partlov Dec 29 '12 at 18:00
  • I am using menuItem to display menu dynamically in a c:forEach loop. Suppose, i have to convert the value coming from backend layer to datetime and dispalay it in menuitem, then what shall i do? I tried using f:converter, it throws me this error: Parent not composite component or an instance of ValueHolder: org.primefaces.component.menuitem.MenuItem@1b13f5d – 3AK Dec 31 '12 at 06:13
  • You can use converters just in components which are value holders (these are input elements). Menuitem is UICommand component, which fires some actions. Only output which you can convert is value. For that you have to make to string conversion on your own. You have to do that in you backing bean, and read that value on page in EL. – partlov Dec 31 '12 at 09:36
  • Ok. your answer helped me a lot. I have written a converter of my own and it works. :) Thanks a lot for your answers. – 3AK Dec 31 '12 at 10:16

1 Answers1

0

You can use converters just in components which are value holders (these are input elements). Menuitem is UICommand component, which fires some actions. Only output which you can convert is value. For that you have to make to string conversion on your own. You have to do that in you backing bean, and read that value on page in EL.

partlov
  • 13,789
  • 6
  • 63
  • 82