- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个 rich:dataTable,并且希望在用户单击详细信息按钮时显示 rich:popupPanel 中每一行的详细信息。
我这样做
<h:panelGrid columns="3" columnClasses="titleCell">
<h:form id="form">
<rich:dataScroller for="table" maxPages="5" />
<rich:dataTable value="#{tournSelectionBean.tournaments}"
var="tourn" id="table" rows="10">
<rich:column>
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputText value="#{tourn.name}" />
</rich:column>
<rich:column>
<a4j:commandButton value="Detail"
action="#{tournSelectionBean.setCurrentTournament(tourn)}"
render=":detailpopup"
oncomplete="#{rich:component('detailpopup')}.show();" />
</rich:column>
</rich:dataTable>
<rich:dataScroller for="table" maxPages="5" />
</h:form>
</h:panelGrid>
<rich:popupPanel id="detailpopup" modal="true" resizeable="false"
autosized="true">
<f:facet name="header">
<h:outputText value="#{tournSelectionBean.currentTournament.name}" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('detailpopup')}.hide(); return false;">
</h:outputLink>
</f:facet>
<h:panelGrid columns="2" columnClasses="titleCell">
<h:outputLabel value="City" />
<h:outputLabel
value="#{tournSelectionBean.currentTournament.city}" />
</h:panelGrid>
<a href="#" onclick="#{rich:component('detailpopup')}.hide()">Close</a>
</rich:popupPanel>
setPropertyActionListener 正确设置 ID,并且弹出窗口按预期打开。但弹出窗口显示了创建 View 时 bean 中的锦标赛的详细信息(而不是由 propertyactionlistner 设置的锦标赛的详细信息)。
我怎样才能实现这个目标?
编辑:更新了上面的代码并添加了 Bean:
@Named("tournSelectionBean")
@ViewScoped
public class TournamentSelectionBean implements Serializable {
@EJB
private TournamentControllerInterface tournamentController;
private List<Tournament> tournaments;
private Tournament currentTournament;
@PostConstruct
public void init() {
tournaments = tournamentController.loadTournaments(true, false);
}
/**
* @return the tournaments
*/
public List<Tournament> getTournaments() {
return tournaments;
}
/**
* @param tournaments
* the tournaments to set
*/
public void setTournaments(List<Tournament> tournaments) {
this.tournaments = tournaments;
}
/**
* @return the currentTournament
*/
public Tournament getCurrentTournament() {
return currentTournament;
}
/**
* @param currentTournament the currentTournament to set
*/
public void setCurrentTournament(Tournament currentTournament) {
this.currentTournament = currentTournament;
}
}
最佳答案
您需要告诉 JSF 在打开弹出 html 之前重新渲染它:
<a4j:commandButton value="Detail"
action="#{tournSelectionBean.setCurrentTournament(tourn)}"
render=":detailpopup"
oncomplete="#{rich:component('detailpopup')}.show();" />
小心:如果您有 <h:form>
在 popupPanel 内,重新渲染完整的弹出窗口时可能会遇到问题。将所有内容放入 <h:panelGroup>
在表单内,然后重新渲染该表单。
关于java - 以丰富的方式显示 bean 值 :popupPanel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20058058/
我有一个 PopupPanel 并试图在单击鼠标时执行某些操作。为此,我创建了一个 ClickHandler,如下所示: ClickHandler handler = new ClickHandler
这是 GWT PopupPanel ShowCase: http://gwt.google.com/samples/Showcase/Showcase.html#!CwBasicPopup 当用户点击
我有一种方法,在屏幕加载和服务器工作负载时使用 gwt PopupPanel 显示图像。 final static PopupPanel popup = new PopupPanel(false, t
我按照展示中的这个例子:http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=popup&sample=login&ski
我正在为我的项目使用 PopupPanel 和 Gwt Canvas。在此处单击 Canvas 绘图区域时会出现弹出面板。在我的主类中,我有一个扩展 PopupPanel 的私有(private)类,
我有一个点击按钮调用的函数,它需要很长时间来创建和附加到 DOM 一些元素,所以我想在函数完成时显示一个带有“加载”图标的 PopupPanel它必须做。请注意,我的函数不会调用服务器,它只会在 UI
我试图让 PopupPanel 上的提交按钮隐藏面板,但我似乎无法让它正常工作。我可以在我的入口点上有一个按钮来显示面板,但我似乎无法隐藏 PopupPanel。 submitLinkPopup.bt
我正在使用 PopupPanel 为某些元素创建上下文菜单;菜单本身将相当大且复杂。我想要做的是有一个按钮列表,加上一个图像和一些文本,与单击的元素相关。 我的问题是我希望按钮总是直接显示在被点击的元
我正在使用 GWT PopupPanel 在用户单击按钮时在按钮上方显示一个弹出窗口。 我正在设置弹出窗口的位置并像这样显示它: panel.setPopupPosition(leftPos, top
我有一个扩展 smartgwt ImgButton 的类。按下按钮时,应显示一个包含更多按钮的弹出窗口。此弹出窗口中的按钮不应呈现为普通按钮,而应呈现为文本链接 - 因此我应用了自定义 CSS 类。到
本质上,弹出面板与浏览器面板保持固定位置 - 我希望它随页面滚动。 我已经尝试设置弹出面板的 CSS 元素,使用“position: fixed !important”但没有成功。 This ques
我想在我的页面中淡化一个PopupPanel。我可以获得 PopupPanel 元素并自己设置不透明度动画,但我无权访问玻璃元素。这不是真正的技术问题,而是对 PopupPanel 选择公开的内容的限
我有一个 rich:dataTable,并且希望在用户单击详细信息按钮时显示 rich:popupPanel 中每一行的详细信息。 我这样做
我在 popupPanel 中有一个 pickList。如果我打开 popupPanel,它会出现在窗口中间。如果我关闭并重新打开它,它看起来会移动到左侧和底部。仅当我在 popupPanel 中有
我在 GWT 中编写了自己的 PopupPanel。我想显示相对于其他小部件的弹出窗口。我对该类的实现如下所示: public class Popover extends PopupPanel imp
我有一个弹出窗口,上面有一个表单和一个命令按钮。当我单击命令按钮时,我想提交表单并调用操作。 问题是,如果我将commandButton放在表单中,我必须单击它两次才能调用操作,如果我将它放在表单之外
我正在尝试使用 Seam 3、RichFaces 4 运行一个小应用程序,但在传递一些参数时遇到了一些麻烦。我尝试过很多不同的事情,但我总是在最后的障碍处跌倒。我通过请求参数传递 customerId
我使用 GWT 显示带有 ClickHandler 的图像缩略图,然后在居中的 PopupPanel 中显示完整图像(可以是几 MB)。为了使其居中,必须在显示弹出窗口之前加载图像,否则图像的左上角将
我想使用 GWT PopupPanel 向用户显示表单。当出现错误时,z-index 为 1000 的 AbsolutePanel 应显示错误消息。我的设置如下: glassStyle 在哪里 .
在我的 JSF+Spring 项目中,我尝试添加表单并从弹出窗口获取值。但是当单击按钮时,没有调试点转到相关 Controller 并且功能也不起作用。这里显示了我的 .xhtml 文件 请引用并建议
我是一名优秀的程序员,十分优秀!