Picklist: Title for each element?

UI Components for JSF
Post Reply
crappi
Posts: 1
Joined: 26 Aug 2011, 17:16

28 Mar 2012, 09:22

Hello!

We finally took our time to change our code from the 3.0M1 to 3.2. We need a title for each element of the picklist (which shows a more detailed information about each item).

With 3.0M1 it was possible to do a workaround by providing a converter which inserted a "<span title='information'>itemLabel</span>".

Code: Select all

return String.format("<span title='%s'>%s</span>", realName, name);
But with 3.2 the HTML tags are rendered as text.

Is there any possibility to achieve this now? Also workarounds are welcomed!

I also tried to use a <p:column> setting an ID and a <p:tooltip> referring to this ID - but the ID won't get rendered:

Code: Select all

<p:pickList id="groupPickList" value="#{bean.members}"
	var="user" converter="userConverter">

	<p:column style="width:75%" id="#{user.id}">  
           #{user.name} 
           <p:tooltip for="#{user.id}" value="#{user.realName}" />
	</p:column>

</p:pickList>
Thanks in advance!
crappi

MyFaces 2.0.3 | Mojarra 2.1.2 | PrimeFaces 3.2

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

28 Mar 2012, 10:35

Try pe:tooltip with "forSelector" attribute. This is any jQuery selector for (HTML) elements tooltip is attached to. You can look JQuery selector for PickList items in Firebug.

Inside of table we did that as follows, for instance:

Code: Select all

        <p:column>
            <f:facet name="header">
                Name
            </f:facet>
            <h:outputText id="name" value="..."/>
            <pe:tooltip for="name" value="..."/>
        </p:column>
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests