How to read the selected value of an p:autoComplete field

UI Components for JSF
Post Reply
User avatar
MISS_DUKE
Posts: 273
Joined: 08 Aug 2010, 05:52

26 Oct 2011, 10:24

I want to give a custom style to the p:autoComplete field, according to the value selected (for example, a pink background for the value GIRL and gray for BOY and so on).

I know I can achieve this using Javascript / jQuery, but I have to read the selected value first (using Javascript). As the selected value is not attached to DOM, I find it very hard to do and I tried various ways but none of them was success.

Please advice me how to read the selected value of the p:autoComplete field using Javascript / jQuery.
JSF implementation: Mojarra V2.1.7
JSF component library: Primefaces V3.1.1
Server: GlassFish Open Source Edition V3.1.1 (build 12)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 72 guests