How do I put line break in p:tooltip

jQuery UI Widgets
Post Reply
Marissa20
Posts: 1
Joined: 11 Feb 2019, 08:37

20 Feb 2019, 07:51

How can I put a line break to the tooltip prime faces component to separate the first line from the second line?

Code: Select all

<p:tooltip id="toolTip" for="idButton" value="First line Second Line" position="top"/>

barryallen1337
Posts: 1
Joined: 21 Aug 2019, 23:04

21 Aug 2019, 23:08

Why you're showing the message in an extra tooltip? Looks a bit strange.

Anyway, what you need is a <br/> where you want the line break and set escape="false" in your p:message.
message: shareit

Password should contain&#13;Minimum 8 characters&#13;1 <br/> Uppercase Password...
xhtml:

<p:message for="password1" escape="false"/>
https://get-vidmateapk.com

smithclarkson02
Posts: 1
Joined: 18 Mar 2020, 04:22

18 Mar 2020, 04:25

To show the tooltip with a line break you have to put it like this

<p:tooltip for="...">
<h:outputText value="First line"/>
<br/> https://9Appsapk.vin https://VidMateapp.vin https://vlc.vin/
<h:outputText value="Second line"/>
</p:tooltip>
Or using PrimeFaces Extensions (pe:tooltip)

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:pe="http://primefaces.org/ui/extensions">
...

<pe:tooltip for="...">
<h:outputText value="First line <br/> Second line" escape="false" />
</pe:tooltip>
viewtopic.php?t=23196

Post Reply

Return to “PrimeUI”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests