- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想根据单击的按钮包含特定页面。
到目前为止 h:commandButton
用过,不能用f:param
,所以看起来我应该使用 f:attribute
标签。
如果是 f:param
我会这样编码:
<h:commandLink action="connectedFilein">
<f:param name="fileId" value="#{fileRecord.fileId}"/>
<h:commandLink>
<c:if test="#{requestParameters.fileId!=null}">
<ui:include src="fileOut.xhtml" id="searchOutResults"/>
</c:if>
f:attribuite
案件?
最佳答案
我假设您使用的是 JSF 1.x,否则这个问题没有意义。 <f:param>
在 <h:commandButton>
旧版 JSF 1.x 确实不支持,但从 JSF 2.0 开始就支持了。<f:attribute>
可与actionListener
结合使用.
<h:commandButton action="connectedFilein" actionListener="#{bean.listener}">
<f:attribute name="fileId" value="#{fileRecord.fileId}" />
</h:commandButton>
public void listener(ActionEvent event) {
this.fileId = (Long) event.getComponent().getAttributes().get("fileId");
}
Long
类型,这是一个经典的 ID)
<f:setPropertyActionListener>
.
<h:commandButton action="connectedFilein">
<f:setPropertyActionListener target="#{bean.fileId}" value="#{fileRecord.fileId}" />
</h:commandButton>
web.xml
时声明符合 Servlet 3.0,那么您可以将其作为方法参数传递。
<h:commandButton action="#{bean.show(fileRecord.fileId)}" />
public String show(Long fileId) {
this.fileId = fileId;
return "connectedFilein";
}
<ui:fragment rendered="#{bean.fileId != null}">
<ui:include src="fileOut.xhtml" id="searchOutResults"/>
</ui:fragment>
<h:panelGroup>
也是可能的,并且是使用 JSP 代替 Facelets 时的最佳方法)
关于jsf - 使用 f :attribute for commandButton instead of f:param for h:commandLink,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5221299/
今天我有一个非常简单的任务需要帮助。首先让我解释一下我的环境。我们正在使用 Java/Hibernate/SEAM/Facelets/JSF/RichFaces 和 A4J 设置..我对此了解不多。
f:param与 h:link 配合使用效果很好,但不是 p:commandLink或 h:commandLink . 例如,我有两页 test_first.xhtml和 test_second.xh
我最近开始做一些JSF工作-在此之前,我一直使用PHP或Python进行Web开发。 当我发现使用h:commandLink标记时,JSF使用HTTP POST进行导航时,我感到有些惊讶。 我一直在使
环境:Tomcat 6、jsf 2.0、prime faces 2.2.1、chrome 浏览器 我想单击左侧伸展树(Splay Tree)中的“查看详细信息”链接并显示产品的详细信息。但下面的代码不
我正在尝试在我的应用程序 (Seam/RichFaces) 中显示购物车,并包含“从购物车中删除”旁边的每个项目以从购物车中删除该项目。当我单击该链接时,它应该重新呈现购物车内容以显示该项目已被删除。
当我创建一个包含分面的复合组件并在该分面内放置一个命令链接时,我收到一条错误消息:This link is disabled as it is not nested within a JSF form
我对 有疑问.我想制作悬停效果,但无法将图像加载到 通过 CSS。 CSS: .accountEditBtn { background-image: url('#{request.c
我是新手,但我的操作没有被触发。在 a4j:commandLink id="linklogout"中,我添加了一个不起作用的新操作 menubean.resetMenuActionVariables
我的树表中有很多命令链接,我动态构建它们,如果我想在单击一个命令链接时更改它的颜色,所有命令链接都会更改它们的颜色,我不知道如何做更改此指定链接的颜色,因为我不知道她的号码或 ID,如果有人知道答案,
我有以下 XHTML: TODO supply a title
我有一个包含两个 JSP 的 JSF 应用程序:login.jsp 和 main.jsp。 我有以下 faces-config.xml: package.programs.scorecard.b
写作能力不足请谅解。 我正在测试制作自定义凭证提供程序。我想创建一个 CommandLink 来对提交按钮做同样的事情。我想通过 CommandLink 与“提交”按钮分开登录。目前,只有自定义凭证提
我正在开发一个 JSF 应用程序并想要一个简单的功能 - 单击命令按钮并显示一个命令链接。我做了一个测试。代码: function testfunc() { docu
我在我的应用程序中使用了 icefaces commandLink,我想在水印中添加一个图标。我在 commandLink 中添加了一个属性 styleCss="disconnect",但在渲染过程中
这是我的代码。我在面板网格内有两个图像,这两个图像放置在动画 Javascript 渐变之上。当左侧图像与右侧的注销图标平行放置时(如图所示),注销功能不起作用。当我删除左侧图像时,注销功能正在运行。
我想知道是否可以将 h:commandLink 嵌套到 h:outputFormat 消息中,例如: 消息.属性 disclaimerLink=Click {0] for Disclaimer 现在我
谁能告诉我如何在 WPF 窗口中添加 CommandLink 控件? 这就是我所说的 CommandLink 的意思:http://msdn.microsoft.com/en-us/library/a
如何使用 commandLink 显示图标: outputText (Add) 不可见。 commandLink 支持图标的正确方法是什么?谢谢。 最佳答案
我在延迟加载 Primefaces Datascroller 时遇到问题成分。 我有一个 jsf 页面,它应该在页面加载时显示 10 个事件。如果用户想要查看更多,他/她可以单击更多按钮加载并显示 1
我想使用我的 faces-config.xml (JSF 2.0) 的导航规则功能,但我遇到了一些问题。我有三个文件(index.xhtml、index2.html、index3.xhtml),它们看
我是一名优秀的程序员,十分优秀!