From 8275215809ab5a41d86e721a574bd388ee58a19f Mon Sep 17 00:00:00 2001 From: Nils Christian Ehmke <nie@informatik.uni-kiel.de> Date: Wed, 25 Apr 2012 17:37:45 +0200 Subject: [PATCH] Modified the updating within the connection dialog. --- .../main/webapp/main/connectionDialog.xhtml | 161 +++++++++--------- 1 file changed, 78 insertions(+), 83 deletions(-) diff --git a/Kieker.WebGUI/src/main/webapp/main/connectionDialog.xhtml b/Kieker.WebGUI/src/main/webapp/main/connectionDialog.xhtml index a4e0fad5..2c0f7f2b 100644 --- a/Kieker.WebGUI/src/main/webapp/main/connectionDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main/connectionDialog.xhtml @@ -7,94 +7,89 @@ xmlns:c="http://java.sun.com/jsp/jstl/core"> <!-- ******************************************************************************** --> - <p:dialog id="connectionDialog" header="Manage Connections" resizable="false" - modal="true" widgetVar="connectionDialog"> - <h:form id="connectionDialogForm"> - <c:if test="#{not empty selectedMainProjectBean.mainProject}"> - <p:commandButton value="Add Connection" ajax="true" action="#{selectedMainProjectBean.addConnection()}" update=":connectionDialogForm"/> - <br/><br/> - <p:dataTable value="#{selectedMainProjectBean.connections}" var="connection" paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"> - <p:column headerText="Source" style="width:125px"> - <p:cellEditor> - <f:facet name="output"> - <h:outputText value="#{connection.source.name}"/> - </f:facet> - <f:facet name="input"> - <h:selectOneMenu converter="kieker.webgui.converter.MIPluginToStringConverter" value="#{connection.source}"> - <f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}" - var="plugin" - itemLabel="#{plugin.name}" - itemValue="#{plugin}"/> - <p:ajax event="change" update=":connectionDialogForm"></p:ajax> - </h:selectOneMenu> - </f:facet> - </p:cellEditor> - </p:column> + <p:dialog id="connectionDialog" header="Manage Connections" resizable="false" modal="true" widgetVar="connectionDialog"> + <h:form id="connectionDialogForm" rendered="#{not empty selectedMainProjectBean.mainProject}"> + <p:commandButton value="Add Connection" ajax="true" action="#{selectedMainProjectBean.addConnection()}" update=":connectionDialogForm"/> + <br/><br/> + <p:dataTable value="#{selectedMainProjectBean.connections}" var="connection" paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"> - <p:column headerText="Output Port" style="width: 125px"> - <p:cellEditor> - <f:facet name="output" rendered="#{not empty connection.outputPort}"> - <h:outputText value="#{connection.outputPort.name}"/> - </f:facet> - <f:facet name="input"> - <h:selectOneMenu converter="kieker.webgui.converter.MIPortToStringConverter" value="#{connection.outputPort}"> - <f:selectItems value="#{connection.source.outputPorts}" - var="port" - itemLabel="#{port.name}" - itemValue="#{port}"/> - </h:selectOneMenu> - </f:facet> - </p:cellEditor> - </p:column> + <p:column headerText="Source" style="width:125px"> + <p:cellEditor> + <f:facet name="output"> + <h:outputText value="#{empty connection.source ? 'N/A' : connection.source.name}"/> + </f:facet> + <f:facet name="input"> + <p:selectOneMenu converter="kieker.webgui.converter.MIPluginToStringConverter" value="#{connection.source}" effectDuration="100"> + <f:selectItem value="#{null}" itemLabel="N/A" itemValue="#{null}"/> + <f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}" var="plugin" itemLabel="#{plugin.name}" itemValue="#{plugin}"/> + <p:ajax event="change" update="validColumn outputPortsList"/> + </p:selectOneMenu> + </f:facet> + </p:cellEditor> + </p:column> - <p:column headerText="Destination" style="width:125px"> - <p:cellEditor> - <f:facet name="output" rendered="#{not empty connection.destination}"> - <h:outputText value="#{connection.destination.name}"/> - </f:facet> - <f:facet name="input"> - <h:selectOneMenu converter="kieker.webgui.converter.MIPluginToStringConverter" value="#{connection.destination}"> - <f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}" - var="plugin" - itemLabel="#{plugin.name}" - itemValue="#{plugin}"/> - <p:ajax event="change" update=":connectionDialogForm"></p:ajax> - </h:selectOneMenu> - </f:facet> - </p:cellEditor> - </p:column> + <p:column headerText="Output Port" style="width:125px"> + <p:cellEditor> + <f:facet name="output"> + <h:outputText value="#{empty connection.outputPort ? 'N/A' : connection.outputPort.name}"/> + </f:facet> + <f:facet name="input"> + <h:form id="outputPortsList"> + <p:selectOneMenu rendered="#{not empty connection.source}" converter="kieker.webgui.converter.MIPortToStringConverter" value="#{connection.outputPort}" effectDuration="100"> + <f:selectItem value="#{null}" itemLabel="N/A" itemValue="#{null}"/> + <f:selectItems value="#{connection.source.outputPorts}" var="port" itemLabel="#{port.name}" itemValue="#{port}"/> + <p:ajax event="change" update="validColumn"/> + </p:selectOneMenu> + </h:form> + </f:facet> + </p:cellEditor> + </p:column> + + <p:column headerText="Destination" style="width:125px"> + <p:cellEditor> + <f:facet name="output"> + <h:outputText value="#{empty connection.destination ? 'N/A' : connection.destination.name}"/> + </f:facet> + <f:facet name="input"> + <p:selectOneMenu converter="kieker.webgui.converter.MIPluginToStringConverter" value="#{connection.destination}" effectDuration="100"> + <f:selectItem value="#{null}" itemLabel="N/A" itemValue="#{null}"/> + <f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}" var="plugin" itemLabel="#{plugin.name}" itemValue="#{plugin}"/> + <p:ajax event="change" update="validColumn inputPortsList"/> + </p:selectOneMenu> + </f:facet> + </p:cellEditor> + </p:column> - <p:column headerText="Input Port" style="width: 125px"> - <p:cellEditor> - <f:facet name="output" rendered="#{not empty connection.inputPort}"> - <h:outputText value="#{connection.inputPort.name}"/> - </f:facet> - <f:facet name="input"> - <h:selectOneMenu converter="kieker.webgui.converter.MIPortToStringConverter" value="#{connection.inputPort}"> - <f:selectItems value="#{connection.destination.inputPorts}" - var="port" - itemLabel="#{port.name}" - itemValue="#{port}"/> - </h:selectOneMenu> - </f:facet> - </p:cellEditor> - </p:column> + <p:column headerText="Input Port" style="width:125px"> + <p:cellEditor> + <f:facet name="output"> + <h:outputText value="#{empty connection.inputPort ? 'N/A' : connection.inputPort.name}"/> + </f:facet> + <f:facet name="input"> + <h:form id="inputPortsList"> + <p:selectOneMenu rendered="#{not empty connection.destination}" converter="kieker.webgui.converter.MIPortToStringConverter" value="#{connection.inputPort}" effectDuration="100"> + <f:selectItem value="#{null}" itemLabel="N/A" itemValue="#{null}"/> + <f:selectItems value="#{connection.destination.inputPorts}" var="port" itemLabel="#{port.name}" itemValue="#{port}"/> + <p:ajax event="change" update="validColumn"/> + </p:selectOneMenu> + </h:form> + </f:facet> + </p:cellEditor> + </p:column> - <p:column headerText="Valid" style="width:50px" > - <h:outputText rendered="#{connection.valid}" value="True"/> - <h:outputText rendered="#{not connection.valid}" value="False"/> - </p:column> + <p:column id="validColumn" headerText="Valid" style="width:50px"> + <h:outputText rendered="#{connection.valid}" value="#{connection.valid ? 'True' : 'False'}"/> + </p:column> - <p:column headerText="Options" style="width:50px"> - <p:rowEditor /> - </p:column> - </p:dataTable> - <br/> - <hr/> - <div style="text-align: right"> - <p:commandButton value="Ok" action="#{selectedMainProjectBean.submitConnections()}" oncomplete="connectionDialog.hide();" /> - </div> - </c:if> + <p:column headerText="Options" style="width:50px"> + <p:rowEditor /> + </p:column> + </p:dataTable> + <br/> + <hr/> + <div style="text-align: right"> + <p:commandButton value="Ok" action="#{selectedMainProjectBean.submitConnections()}" oncomplete="connectionDialog.hide();" /> + </div> </h:form> </p:dialog> <!-- ******************************************************************************** --> -- GitLab