I have a xhtml like this:
<!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>
I try to show a datatable with server info and show the details of a server in a popup, but when the button are clicked the details of server not appears in popup, i dont know how set the server selected in the bean and show it in the popup.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…