How do I put line break in p:tooltip

UI Components for JSF
Post Reply
Darleen98
Posts: 1
Joined: 12 Feb 2019, 10:37

28 Mar 2019, 06:44

How can I put a line break to the tooltip primefaces 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"/>

DazzlingBob
Posts: 11
Joined: 07 Mar 2019, 15:20

28 Mar 2019, 12:49

Try this.

Code: Select all

	<h:button id="backButton" value="Back" />
	<p:tooltip showDelay="600" for="backButton">
		<p:outputPanel layout="inline">
			<h:outputText value="line1" /><br />
			<h:outputText value="line2" /><br />
			line3<br />line4
		</p:outputPanel>
	</p:tooltip>

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

28 Mar 2019, 13:59

Another option...

Code: Select all

<p:tooltip id="toolTip" for="idButton" value="First line<br/>Second Line" position="top" escape="false"/>
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests