primefaces

Primefaces Toolbar is a horizontal grouping for commands and other contents.

Primefaces工具栏是命令和其他内容的水平分组。

Primefaces工具栏基本信息 (Primefaces Toolbar Basic Info)

Tag Toolbar
Component Class org.primefaces.component.toolbar.Toolbar
Component Type org.primefaces.component.Toolbar
Component Family org.primefaces.component
Renderer Type org.primefaces.component.ToolbarRenderer
Renderer Class org.primefaces.component.toolbar.ToolbarRenderer
标签 工具列
组件类别 org.primefaces.component.toolbar.Toolbar
组件类型 org.primefaces.component.Toolbar
组件族 org.primefaces.component
渲染器类型 org.primefaces.component.ToolbarRenderer
渲染器类 org.primefaces.component.toolbar.ToolbarRenderer

Primefaces工具栏属性 (Primefaces Toolbar Attributes)

Name Default Type Description
id null String Unique identifier of the component
rendered true Boolean Boolean value to specify the rendering of the component, when set to false component will not be rendered.
style null String Inline style of the container element.
binding null Object An el expression that maps to a server sideUIComponent instance in a backing bean
styleClass null String Style class of the container element.
名称 默认 类型 描述
ID 空值 组件的唯一标识符
呈现 真正 布尔型 布尔值,用于指定组件的呈现,当设置为false时将不呈现组件。
样式 空值 容器元素的内联样式。
捆绑 空值 目的 El表达式,它映射到支持bean中的服务器sideUIComponent实例
styleClass 空值 容器元素的样式类。

工具栏入门 (Getting Started With Toolbar)

Toolbar component has two placeholders (left & right) that are defined with facets. Following the most simple example help you understanding Toolbar component and its Left/Right sections.

工具栏组件有两个用facet定义的占位符(左和右)。 通过最简单的示例,可以帮助您了解工具栏组件及其左/右部分。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui"><h:head><script name="jquery/jquery.js" library="primefaces"></script></h:head><h:form><p:toolbar><f:facet name="left">Left Side</f:facet><f:facet name="right">Right Side</f:facet></p:toolbar></h:form>
</html>
  • Facets component used for defining Toolbar’s Left/Right Side.构面组件,用于定义工具栏的左侧/右侧。
  • It’s applicable for your, setting whatever components you want inside these defined sections.它适用于您,在这些定义的部分中设置所需的任何组件。

Now, let’s see how can we use the same Toolbar component for enclosing different types of JSF/Primefaces components.

现在,让我们看看如何使用相同的工具栏组件来封装不同类型的JSF / Primefaces组件。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<h:form><p:toolbar><f:facet name="left"><p:commandButton type="push" value="New" image="ui-icon-document" /><p:commandButton type="push" value="Open" image="ui-icon-folder-open" /><h:outputText value="<h2>Just HTML Separator</h2>" escape="false"></h:outputText></f:facet><f:facet name="right"><p:menuButton value="Navigate"><p:menuitem value="Home" url="#" /><p:menuitem value="Logout" url="#" /></p:menuButton></f:facet></p:toolbar>
</h:form>
</html>
  • JSF/Primefaces components can be used in conjunction with Toolbar’s sections.JSF / Primefaces组件可与工具栏的部分结合使用。
  • It’s also applicable for using rendered HTML using <h:outputText/>.它也适用于通过<h:outputText />使用呈现HTML。

Primefaces ToolbarGroup基本信息 (Primefaces ToolbarGroup Basic Info)

ToolbarGroup is a helper component for Toolbar component to define Placeholders.

ToolbarGroup是用于Toolbar组件定义占位符的帮助器组件。

Tag ToolbarGroup
Tag org.primefaces.component.toolbar.ToolbarGroup
Component Type org.primefaces.component.ToolbarGroup
Component Family org.primefaces.component
标签 工具栏组
标签 org.primefaces.component.toolbar.ToolbarGroup
组件类型 org.primefaces.component.ToolbarGroup
组件族 org.primefaces.component

Primefaces ToolbarGroup属性 (Primefaces ToolbarGroup Attributes)

Name Default Type Description
id null String Unique identifier of the component
rendered true Boolean Boolean value to specify the rendering of the component, when set to false component will not be rendered.
align null String Defines the alignment within toolbar, valid valuesare left and right.
style null String Inline style of the container element.
binding null Object An el expression that maps to a server side UIComponent instance in a backing bean
styleClass null String Style class of the container element.
名称 默认 类型 描述
ID 空值 组件的唯一标识符
呈现 真正 布尔型 布尔值,用于指定组件的呈现,当设置为false时将不呈现组件。
对齐 空值 定义工具栏中的对齐方式,有效值位于左侧和右侧。
样式 空值 容器元素的内联样式。
捆绑 空值 目的 El表达式,它映射到支持Bean中的服务器端UIComponent实例
styleClass 空值 容器元素的样式类。

ToolbarGroup入门 (Getting Started With ToolbarGroup)

ToolbarGroup component is working in conjunction with Toolbar component, rather using of facets component for determining Right/Left place. Primefaces 5 has supported it as it’s might be not supported in the next coming version. Following simple example shows you how can we use ToolbarGroup for positioning the Toolbar’s content.

ToolbarGroup组件与Toolbar组件结合使用,而不是使用构面组件来确定“右/左”位置。 Primefaces 5支持它,因为在下一版本中可能不支持。 下面的简单示例向您展示了如何使用ToolbarGroup定位工具栏的内容。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<h:form><p:toolbar><p:toolbarGroup align="right"><p:commandButton type="push" value="New" image="ui-icon-document" /><p:commandButton type="push" value="Open" image="ui-icon-folder-open" /></p:toolbarGroup><p:toolbarGroup align="left"><p:menuButton value="Navigate"><p:menuitem value="Home" url="#" /><p:menuitem value="Logout" url="#" /></p:menuButton></p:toolbarGroup></p:toolbar>
</h:form>
</html>

Primefaces工具提示基本信息 (Primefaces Tooltip Basic Info)

Similar to html, Tooltip component has the same functionality with more advantage by providing custom effects, events, html content and advance theme support.

与html相似,Tooltip组件具有相同的功能,并且通过提供自定义效果,事件,html内容和高级主题支持而具有更多优势。

Name Default Type Description
id null String Unique identifier of the component
rendered true Boolean Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding null Object An el expression that maps to a server sideUIComponent instance in a backing bean
value null Object Value of the component than can be either an ELexpression of a literal text
converter null Converter/String An el expression or a literal text that defines aconverter for the component. When it’s an ELexpression, it’s resolved to a converter instance. Incase it’s a static text, it must refer to a converter id
widgetVar null String Name of the client side widget.
showEvent mouseover String Event displaying the tooltip.
showEffect fade String Effect to be used for displaying.
hideEvent mouseout String Event hiding the tooltip.
hideEffect fade String Effect to be used for hiding.
showDelay 150 Integer Delay time to show tooltip in milliseconds.
名称 默认 类型 描述
ID 空值 组件的唯一标识符
呈现 真正 布尔型 布尔值,用于指定组件的呈现,当设置为false时将不呈现组件。
捆绑 空值 目的 El表达式,它映射到支持bean中的服务器sideUIComponent实例
空值 目的 组件的值可以是文字文本的ELexpression
转换器 空值 转换器/字符串 定义组件转换器的el表达式或文字文本。 当它是ELexpression时,它将解析为转换器实例。 如果是静态文本,则必须引用转换器ID
widgetVar 空值 客户端小部件的名称。
showEvent 鼠标移到 显示工具提示的事件。
showEffect 褪色 用于显示的效果。
hideEvent 鼠标移出 事件隐藏工具提示。
hideEffect 褪色 用于隐藏的效果。
showDelay 150 整数 延迟时间以毫秒为单位显示工具提示。

Primefaces工具提示属性 (Primefaces Tooltip Attributes)

Tag Tooltip
Tag org.primefaces.component.tooltip.Tooltip
Component Type org.primefaces.component.Tooltip
Component Family org.primefaces.component
Renderer Type org.primefaces.component.TooltipRenderer
Renderer Class org.primefaces.component.tooltip.TooltipRenderer
标签 工具提示
标签 org.primefaces.component.tooltip.Tooltip
组件类型 org.primefaces.component.Tooltip
组件族 org.primefaces.component
渲染器类型 org.primefaces.component.TooltipRenderer
渲染器类 org.primefaces.component.tooltip.TooltipRenderer

工具提示入门 (Getting Started With Tooltip)

Tooltip component is working in conjunction with any of Primefaces components. For providing a Tooltip, two options can be used:

工具提示组件可与任何Primefaces组件一起使用。 为了提供工具提示,可以使用两个选项:

  • Provide a value and a for Tooltip’s attributes for determining the value of the Tooltip and the component that is the Tooltip is for, respectively.工具提示的属性提供一个和一个属性,分别确定工具提示的值和该工具提示所针对的组件。
  • Just provide a for Tooltip’s attribute, in such cases, be careful that the component the Tooltip is for has specified the title attribute.只需提供一个用于 Tooltip的属性,在这种情况下,请注意Tooltip所针对的组件已指定title属性。

Following sample, shows you the most simple example that help you define a Toolbar using mentioned both of ways.

下面的示例向您展示了最简单的示例,可以帮助您使用上述两种方法来定义工具栏。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<h:form style="width:50%">Enter Username : <p:inputText id="username"></p:inputText><p:separator/>Enter Password : <p:inputText id="password" title="Enter Password"></p:inputText><p:tooltip for="username" value="Enter Username"></p:tooltip><p:tooltip for="password"></p:tooltip>
</h:form>
</html>

全局工具提示 (Global Tooltip)

Primefaces has also provided a global Tooltip component. Global Tooltip binds to elements with title attributes. Global Tooltip is more efficient than using of individual instances. It’s suggested to be used instead of using individual Tooltip components unless a custom case would be implemented. Global Tooltip also has supported Ajax updates, in case your Targeted components are updating asynchronously, Global Tooltip component can still bind.

Primefaces还提供了一个全局的工具提示组件。 全局工具提示绑定到具有标题属性的元素。 全局工具提示比使用单个实例更有效。 除非要实现自定义案例,否则建议不要使用单个Tooltip组件。 Global Tooltip还支持Ajax更新,以防您的Targeted组件异步更新,Global Tooltip组件仍然可以绑定。

Following a simple example that depicts you how can you use the Global Tooltip for achieving both of Global Tooltip and Asynchronously Global Tooltip.

下面的简单示例向您描述如何使用全局工具提示来实现全局工具提示和异步全局工具提示。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<h:form style="width:50%"><p:tooltip id="tooltip"/>Enter Username : <p:inputText id="username" title="Enter Username"></p:inputText><p:separator/>Enter Password : <p:inputText id="password" title="Enter Password"></p:inputText><p:separator/><p:commandButton value="Change Tooltip Asynchrounsly"action="#{tooltipManagedBean.changeTooltipValues}"title="Asynchrouns Action"update="username password tooltip"></p:commandButton>
</h:form>
</html>

工具提示焦点,事件和效果 (Tooltip Focus, Events & Effects)

A Tooltip is shown on mouseover event and hidden when mouse is out by default. If you need to change this behavior you should use showEvent and hideEvent feature. Also, you can control the effect to be used for controlling the form that the Tooltip will use while showing.

默认情况下,鼠标悬停事件上会显示工具提示,鼠标悬停时会隐藏工具提示。 如果需要更改此行为,则应使用showEventhideEvent功能。 另外,您可以控制用于控制工具提示在显示时使用的形式的效果。

Following example shows you how can you use these events and effects for controlling the Tooltip behavior.

下面的示例向您展示如何使用这些事件和效果来控制工具提示行为。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<h:form style="width:50%">Enter Username : <p:inputText id="username"></p:inputText><p:tooltip for="username" value="Enter Username" showEvent="focus" hideEvent="blur" showEffect="bounce" hideEffect="explode" trackMouse="true"></p:tooltip>
</h:form>
</html>

工具提示HTML内容 (Tooltip HTML Content)

It’s also applicable for you to display custom content as a tooltip rather using of just text value. Just inject whatever content you want inside Tooltip component. Following example shows you a Tooltip component that contains a text value in addition to image content.

它也适用于将自定义内容显示为工具提示,而不仅仅是使用文本值。 只需将任何所需的内容注入到Tooltip组件中即可。 下面的示例向您显示一个Tooltip组件,该组件除了图像内容外还包含文本值。

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"xmlns:p="https://primefaces.org/ui">
<h:head><script name="jquery/jquery.js" library="primefaces"></script>
</h:head>
<p:tooltip/>
<h:form style="width:50%">Enter Username : <p:inputText id="username" title="Enter Username"></p:inputText><p:tooltip for="username" showEvent="focus"hideEvent="blur" showEffect="bounce"hideEffect="explode"><h:graphicImage value="/resources/images/journaldev.jpg"></h:graphicImage></p:tooltip></h:form>
</html>

摘要 (Summary)

This tutorial intended to cover Toolbar, ToolbarGroup and Tooltip that’s used intensively inside any Primefaces application. Contribute us by commenting below and download the given source code.

本教程旨在介绍在任何Primefaces应用程序中大量使用的工具栏,工具栏组和工具提示。 通过在下面发表评论来贡献我们,并下载给定的源代码。

Download PrimeFaces Toolbar Tooltip Project下载PrimeFaces工具栏工具提示项目

翻译自: https://www.journaldev.com/3540/primefaces-toolbar-toolbargroup-tooltip

primefaces

primefaces_Primefaces工具栏,工具栏组和工具提示相关推荐

  1. Bootstrap组件——【按钮(预定义样式类、边框颜色、大小、激活和禁用状态 、按钮标签)、按钮组(定义按钮组、工具栏按钮组、大小、嵌套按钮、垂直排列)、下拉菜单(定义下拉菜单、下拉菜单样式)】

    一.按钮        按钮是网页中不可缺少的一种组件,例如页面中搜索.注册等按钮.按钮还广泛应用于表单.下拉菜单.模态框等场景中. 1.预定义样式类 Bootstrap提供了btn来定义按钮,btn ...

  2. MFC对话框中的工具栏、状态栏设计小结

    对网上的资料结合自己的实践的总结,由于大部分都是网上先辈们的经验,这里只是直接将内容拿来,格式优化一下更易读而已. 对话框中建立工具栏的方法 工具栏中包含了一组用于执行命令的按钮,每个按钮都用一个图标 ...

  3. tinymce 工具栏 不显示_winform中MenuStrip主菜单、工具栏、状态栏、托盘、其他控件...

    MenuStrip主菜单 如果要写某个菜单的事件就双击那个菜单即可.设置热键 符号要加上&这个符号,快捷键shortcutkeys选择快捷键,快速选择菜单可以插入标准项,主菜单和工具栏都有这个 ...

  4. 【QT】QT菜单栏、状态栏、工具栏

    菜单栏.工具栏.状态栏 主窗口框架(QMainWindow)拥有自己的布局,包括以下组件: 菜单栏 菜单栏包含了一个下拉菜单项的列表,这些菜单项通过QAction动作类实现.一个主窗口只能有一个菜单栏 ...

  5. Qt菜单栏、状态栏、工具栏

    菜单栏.工具栏.状态栏 主窗口框架(QMainWindow)拥有自己的布局,包括以下组件: 菜单栏 菜单栏包含了一个下拉菜单项的列表,这些菜单项通过QAction动作类实现.一个主窗口只能有一个菜单栏 ...

  6. VC MFC工具栏(CToolBar)控件

    工具栏 工具栏控件在控件面板里没有对应的选项(图标),但有一个工具栏控件类CToolBar,所以我们如果要创建一个工具栏控件并显示在窗口里的话,只能用代码来完成,事实上任何一种控件,都可以用代码创建, ...

  7. 计算机工具选项卡,Word中的辅助功能——工具栏和菜单选项

    Word包含一些辅助功能,使得具有各种需要的用户可以使用该软件,包括在行动能力.视力或其他方面稍有障碍的用户.比如工具栏和菜单选项-- 创建自定义工具栏 1.单击"工具"菜单中的& ...

  8. iOS 新浪微博-5.2 首页微博列表_转发微博/工具栏

    继续于上一篇,还是做首页的功能,这一篇把剩下的首页继续完善. 看看上面的图片,分析: 1.转发微博里面的内容,和原创微博是一样的,由文字+配图组成.这应该放在一个UIView里处理. 2.工具栏也当成 ...

  9. python界面不同按钮实现不同功能-三、PyQt5不同方法创建菜单栏、工具栏和状态栏...

    创建菜单栏.工具栏和状态栏可以直接通过代码实现,也可以通过Qt Designer中的属性编辑器等实现.通过两种方法的学习可以加深理解,更好的掌握PyQt5. 一.菜单栏与状态栏 状态栏的设置比较简单, ...

最新文章

  1. WPF 浏览PDF 文件
  2. socket连接 代码
  3. Docker 学习资源整理
  4. Java中的queue和deque
  5. 慎用ToLower和ToUpper,小心把你的系统给拖垮了
  6. Visual C++利用互斥量同步线程实现文件读取进度条
  7. rsyslog官方文档
  8. 页面跳转_PyQt5多页面跳转
  9. layui表格使用复选框批量删除_layui表格数据复选框回显设置方法,表格复选框...
  10. Ubuntu上安装gcc
  11. cs七龙珠机器人_CS七龙珠机器人的命令
  12. ubuntu系统安装完显卡驱动出现黑屏和登录死循环的解决方法(新增惠普暗夜精灵7-3070显卡解决方法)
  13. Just Speak 论文精读
  14. 保险行业线上引流渠道有哪些?还在为没有客户而烦恼吗?这几招教你线上低成本引流获客!
  15. 京东VC后台自动批量上传主图 大聪明自动传主图 c# selenium网页自动化传图
  16. Java后端技术面试汇总(第一套)
  17. VO、DTO、BO、QO、DO 如何使用,在那一层使用,一张图告诉你;别再纠结命名规则啦,我来告诉你
  18. 关于sqlserver身份登录失败的解决方法
  19. long型转String(*)
  20. 详解 FTP、FTPS 与 SFTP 的原理

热门文章

  1. Welcome-to-Swift-05控制流(Control Flow )
  2. 子类能不能继承父类的成员变量
  3. PL/SQL Developer主界面窗口左边窗口默认设置
  4. EF 保证线程内唯一 上下文的创建
  5. [转载] 当心掉进Python多重继承里的坑
  6. [转载] Sublime Text 3 插件 ClangFormat 格式化 C/C++版
  7. [转载] 用Tkinter打造GUI开发工具(45)用Tkinter做自己的中文代码编辑器
  8. [转载] pandas将Series变成键值对
  9. Spring的数据库编程浅入浅出——不吹牛逼不装逼
  10. SQL Server实际执行计划COST欺骗案例