primefaces

Today we will look into Primefaces CommandLink component. Primefaces CommandLink extends standard JSF commandLink with Ajax capabilities.

今天,我们将研究Primefaces CommandLink组件。 Primefaces CommandLink扩展了具有Ajax功能的标准JSF commandLink。

Primefaces CommandLink (Primefaces CommandLink)

Below table contains some of the basic information of Primefaces CommandLink component.

下表包含Primefaces CommandLink组件的一些基本信息。

Tag commandLink
Component Class org.primefaces.component.commandlink.CommandLink
Component Type org.primefaces.component.CommandLink
Component Family org.primefaces.component
Renderer Type org.primefaces.component.CommandLinkRenderer
Renderer Class org.primefaces.component. commandlink.CommandLinkRenderer
标签 命令链接
组件类别 org.primefaces.component.commandlink.CommandLink
组件类型 org.primefaces.component.CommandLink
组件族 org.primefaces.component
渲染器类型 org.primefaces.component.CommandLinkRenderer
渲染器类 org.primefaces.component。 commandlink.CommandLinkRenderer

Primefaces CommandLink属性 (Primefaces CommandLink 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.
binding null Object An el expression that maps to a server side UIComponent instance in a backing bean
value null String Href value of the rendered anchor.
action null MethodExpr/ String A method expression or a String outcome that’d be processed when link is clicked.
actionListener null MethodExpr An actionlistener that’d be processed when link is clicked.
immediate false Boolean Boolean value that determines the phaseId, when true actions are processed at apply_request_values, when false at invoke_application phase.
async false Boolean When set to true, ajax requests are not queued.
process null String Component(s) to process partially instead of whole view.
ajax true Boolean Specifies the submit mode, when set to true(default), submit would be made with Ajax.
update null String Component(s) to be updated with ajax.
onstart null String Client side callback to execute before ajax request is begins.
oncomplete null String Client side callback to execute when ajax request is completed.
onsuccess null String Client side callback to execute when ajax request succeeds.
onerror null String Client side callback to execute when ajax request fails.
global true Boolean Defines whether to trigger ajaxStatus or not.
delay null String If less than delay milliseconds elapses between calls to request() only the most recent one is sent and all other requests are discarded. If this option is not specified, or if the value of delay is the literal string ‘none’ without the quotes, no delay is used.
partialSubmit false Boolean Enables serialization of values belonging to the partially processed components only.
resetValues false Boolean If true, local values of input components to be updated within the ajax request would be reset.
ignoreAutoUpdate false Boolean If true, components which autoUpdate=”true” will not be updated for this request. If not specified, or the value is false, no such indication is made.
style null String Style to be applied on the anchor element
styleClass null String StyleClass to be applied on the anchor element
onblur null String Client side callback to execute when link loses focus.
onclick null String Client side callback to execute when link is clicked.
ondblclick null String Client side callback to execute when link is double clicked.
onfocus null String Client side callback to execute when link receives focus.
onkeydown null String Client side callback to execute when a key is pressed down over link.
onkeypress null String Client side callback to execute when a key is pressed and released over link.
onkeyup null String Client side callback to execute when a key is released over link.
onmousedown null String Client side callback to execute when a pointer button is pressed down over link.
onmousemove null String Client side callback to execute when a pointer button is moved within link.
onmouseout null String Client side callback to execute when a pointer button is moved away from link.
onmouseover null String Client side callback to execute when a pointer button is moved onto link.
onmouseup null String Client side callback to execute when a pointer button is released over link.
accesskey null String Access key that when pressed transfers focus to the link.
charset null String Character encoding of the resource designated by this hyperlink.
coords null String Position and shape of the hot spot on the screen for client use in image maps.
dir null String Direction indication for text that does not inherit directionality. Valid values are LTR and RTL.
disabled null Boolean Disables the link
hreflang null String Languae code of the resource designated by the link.
rel null String Relationship from the current document to the anchor specified by the link, values are provided by a space-separated list of link types.
rev null String A reverse link from the anchor specified by this link to the current document, values are provided by a space-separated list of link types.
shape null String Shape of hot spot on the screen, valid values are default, rect, circle and poly.
tabindex null Integer Position of the button element in the tabbing order.
target null String Name of a frame where the resource targeted by this link will be displayed.
title null String Advisory tooltip information.
type null String Type of resource referenced by the link.
名称 默认 类型 描述
ID 空值 组件的唯一标识符
呈现 真正 布尔型 布尔值,用于指定组件的呈现,当设置为false时将不呈现组件。
捆绑 空值 目的 El表达式,它映射到支持Bean中的服务器端UIComponent实例
空值 渲染锚点的Href值。
行动 空值 MethodExpr /字符串 单击链接时将处理的方法表达式或字符串结果。
actionListener 空值 方法专家 单击链接时将要处理的动作监听器。
即时 布尔型 当在apply_request_values处理为真时,在invoke_application阶段为false时,确定phaseId的布尔值。
异步的 布尔型 设置为true时,ajax请求不会排队。
处理 空值 要部分处理而不是整个视图的组件。
阿贾克斯 真正 布尔型 指定提交模式,当设置为true(默认)时,将使用Ajax进行提交。
更新 空值 用ajax更新的组件。
启动时 空值 在ajax请求开始之前执行的客户端回调。
未完成 空值 在ajax请求完成时执行的客户端回调。
成功 空值 在ajax请求成功时执行的客户端回调。
错误 空值 在ajax请求失败时执行的客户端回调。
全球 真正 布尔型 定义是否触发ajaxStatus。
延迟 空值 如果两次对request()的调用之间的延迟时间少于毫秒,则只会发送最近的一次,而所有其他请求都将被丢弃。 如果未指定此选项,或者delay的值是不带引号的文字字符串“ none”,则不使用延迟。
部分提交 布尔型 启用仅属于部分处理的组件的值的序列化。
resetValues 布尔型 如果为true,则将重置ajax请求中要更新的输入组件的本地值。
ignoreAutoUpdate 布尔型 如果为true,则不会为此请求更新autoUpdate =“ true”的组件。 如果未指定,或者值为false,则不会进行任何指示。
样式 空值 应用于锚元素的样式
styleClass 空值 要应用于锚元素的StyleClass
Onblur 空值 当链接失去焦点时执行客户端回调。
点击 空值 单击链接时执行的客户端回调。
ondblclick 空值 双击链接时执行客户端回调。
专注 空值 当链接获得焦点时执行客户端回调。
按键 空值 在链接上按下键时执行客户端回调。
按键 空值 按下并通过链接释放键时执行的客户端回调。
按键 空值 通过链接释放键时执行的客户端回调。
鼠标停下 空值 在链接上按下指针按钮时执行客户端回调。
情绪激动 空值 当指针按钮在链接内移动时执行客户端回调。
暂停 空值 当指针按钮从链接移开时执行客户端回调。
鼠标悬停 空值 当指针按钮移到链接上时执行客户端回调。
鼠标悬停 空值 通过链接释放指针按钮时执行的客户端回调。
快捷键 空值 按下访问键会将焦点转移到链接。
字符集 空值 此超链接指定的资源的字符编码。
座标 空值 屏幕上热点的位置和形状,供客户在图像地图中使用。
目录 空值 不继承方向性的文本的方向指示。 有效值为LTR和RTL。
残障人士 空值 布尔型 禁用链接
hreflang 空值 链接指定的资源的语言代码。
rel 空值 从当前文档到链接指定的锚点的关系,值由链接类型的空格分隔的列表提供。
转速 空值 从此链接指定的锚点到当前文档的反向链接,值由空格分隔的链接类型列表提供。
形状 空值 屏幕上热点的形状,有效值为默认值,矩形,圆形和多边形。
标签索引 空值 整数 按钮元素在制表顺序中的位置。
目标 空值 将显示此链接目标资源的框架的名称。
标题 空值 咨询工具提示信息。
类型 空值 链接引用的资源类型。

Primefaces CommandLink示例 (Primefaces CommandLink Example)

Primefaces CommandLink is similar to JSF h:commandLink except that the form is submitted with ajax by default.

Primefaces CommandLink与JSF h:commandLink相似,除了默认情况下使用ajax提交表单。

simpleCommandLink.xhtml

simpleCommandLink.xhtml

<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:commandLink value="Do Action" action="#{commandLinkManagedBean.doSomeAction}"></p:commandLink>
</h:form>
</html>
package com.journaldev.primefaces.beans;import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;@ManagedBean
@SessionScoped
public class CommandLinkManagedBean {public String doSomeAction(){System.out.println("CommandLink is used");return "";}
}

Below image shows the console output when you click on the Primefaces CommandLink link multiple times.

下图显示了多次单击Primefaces CommandLink链接时的控制台输出。

That’s all for a quick roundup on Primefaces CommandLink component. You can download the Primefaces CommandLink example project from below link.

这就是对Primefaces CommandLink组件的快速总结。 您可以从下面的链接下载Primefaces CommandLink示例项目。

Download PrimeFaces Command Confirm FileDownload Project下载PrimeFaces命令确认文件下载项目

翻译自: https://www.journaldev.com/12150/primefaces-commandlink

primefaces

primefaces_Primefaces CommandLink相关推荐

  1. JSF中的h:commandLink如何传递参数 三种取值比较

    声明本人刚学jsf三天 如有不足请指教.... 本人总结了三种取得参数的方法 这是jsf中的代码 <h:commandLink  action="#{}">       ...

  2. primefaces_PrimeFaces Mobile入门

    primefaces 介绍 如果您已经开发了利用PrimeFaces的应用程序,或者打算开发可在台式机和移动设备上使用的Web应用程序,请考虑将PrimeFaces Mobile用于您的移动实施. 这 ...

  3. primefaces_PrimeFaces:在动态生成的对话框中打开外部页面

    primefaces 我已经在即将出版的PrimeFaces Cookbook版本2中写过一篇食谱的博客. 在这篇文章中,我想发表第二篇关于一个名为Dialog Framework的小型框架的文章. ...

  4. primefaces_PrimeFaces 5.0 DataTable列切换器

    primefaces 我有机会与PrimeFaces 5.0 DataTable一起工作,并且增强功能很棒. 今天,我只想展示其中的一项新功能--DataTable列切换器. 通过此功能,可以通过复选 ...

  5. primefaces_PrimeFaces扩展中的全新JSF组件

    primefaces PrimeFaces扩展团队很高兴宣布即将推出的3.0.0主要版本的几个新组件. 我们的新提交者Francesco Strazzullo为该项目提供了" Turbo B ...

  6. primefaces_PrimeFaces在GlassFish 3.1.2.2上推动大气

    primefaces PrimeFaces 3.4在三天前发布. 除了通常令人敬畏的新组件和更新组件外,它还包括新的PrimeFaces Push框架. 基于Atmosphere,这为您的应用程序提供 ...

  7. primefaces_Primefaces工具栏,工具栏组和工具提示

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

  8. primefaces_Primefaces单选按钮,复选框示例

    primefaces Primefaces Radio Button and checkbox are select elements. Below are the primefaces compon ...

  9. primefaces_Primefaces向导组件示例

    primefaces Primefaces Wizard Component provides an ajax enhanced UI to implement a workflow easily i ...

最新文章

  1. Keras【Deep Learning With Python】手写数字识别
  2. python【蓝桥杯vip练习题库】BASIC-16分解质因数(数论 质数分解)
  3. 搜索引擎设计实用教程(2)-以百度为例
  4. 【机器学习——决策树】——两种方法实现,含模型的保存和调用
  5. String path = request.getContextPath()和String basePath = request.getScheme()
  6. 在Linux中对硬盘进行分区、格式化和挂载
  7. 数据库连接,实现增删改查操作具体步骤(全)
  8. cuSPARSE库:(八)cusparseGetStream()
  9. 特斯拉为什么不用激光雷达和高精地图?
  10. 电脑网速慢怎么办?手把手教你提升网速
  11. 前端学习01 HTML入门
  12. DC-DC升压和降压电路电感参数选择详解
  13. C++中的TEXT函数
  14. (thinkPHP)入门
  15. delphi php 移动开发工具,盒子 - 完整版DELPHI XE10.1移动开发框架  绝对可以使用...
  16. vc_redist 静默安装的方法
  17. BISTU-(1)-4-17-2016
  18. 科技部马颂德:中国积极支持开放源代码软件发展
  19. (十 七)张量函数的微分与导数
  20. 如何设置植筋/预留钢筋形式的砌体加筋?

热门文章

  1. Android -- 写xml到SD卡中
  2. SQL Cookbook:一、检索记录(2)从表中检索部分行
  3. 微软VC/MFC FAQ(转)
  4. [转载] python并行处理任务_Python 并行任务技巧
  5. [转载] Pandas:DataFrame对象的基础操作
  6. [转载] JAVA的throw用法及扩展
  7. [转载] 由swap引出的java中参数严格值传递问题
  8. PAT 1079 Total Sales of Supply Chain[比较]
  9. js datagrid 移动去重
  10. [bzoj4763]雪辉[bzoj4812][Ynoi2017]由乃打扑克