【发布时间】:2014-02-04 14:43:47
【问题描述】:
我有一个这样的 xhtml:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
<ui:define name="body">
<h:body>
<h:form id="form">
<rich:panel>
<rich:dataTable value="#{scriptConsole.serversList}" var="server">
<f:facet name="header">
<h:outputText value="Servers" />
</f:facet>
<rich:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{server.name}" />
</rich:column>
<rich:column>
<f:facet name="header">Actions</f:facet>
<a4j:commandButton value="view" oncomplete="#{rich:component('modalScripts')}.show();" action="#{scriptConsole.setServerSelected(server)}"/>
</rich:column>
</rich:dataTable>
</rich:panel>
<rich:popupPanel id="modalScripts" modal="true" autosized="true"
resizeable="false">
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('modalScripts')}.hide(); return false;">X</h:outputLink>
</f:facet>
<h:outputText
value="#{scriptConsole.serverSelected.name}" />
</rich:popupPanel>
</h:form>
</h:body>
</ui:define>
</ui:composition>
我尝试显示带有服务器信息的数据表并在弹出窗口中显示服务器的详细信息,但是当单击按钮时,服务器的详细信息不会出现在弹出窗口中,我不知道如何设置在 bean 中选择的服务器和在弹出窗口中显示。
【问题讨论】: