I want to open a tooltip when page loads for first time... somehow just like a help guide for first time use opens the page, not waiting for him to hover mouse on the object.
Best approach? thanks
You can use the onload
attribute in the body
tag:
<h:body onload="PF('tip1').show();">
<h:form>
<p:inputText id="txt" title="Type something into this field"/>
<p:tooltip for="txt" widgetVar="tip1" value="tooltip text"/>
</h:form>
</h:body>
You can use PrimeFaces Extensions Auto Shown tooltip
Download jar file from: primefaces-extensions-6.0.0.jar
namespace:
xmlns:pe="http://primefaces.org/ui/extensions"
usage:
<h:panelGrid id="details" columns="2">
<h:outputLabel value="Tooltip on InputText: "/>
<h:panelGroup layout="block" style="padding: 0 0 3px 0;">
<p:inputText id="txt" title="Type something into this field"/>
<pe:tooltip for="txt" autoShow="true" widgetVar="tip1"
myPosition="left center" atPosition="right center"/>
</h:panelGroup>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.