Skip to content
Snippets Groups Projects
Forked from DM / dm-docs
261 commits behind, 472 commits ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
experimentPoliciesEditSelection.xhtml 4.08 KiB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html 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:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <ui:include src="experimentPolicyAddDialog.xhtml" />

    <ui:param name="isAdmin" value="#{loginController.admin}" />

    <p:commandButton id="experimentPolicyAddButton" value="Add" onclick="PF('experimentPolicyAddDialogWidget').show();" rendered="true" icon="ui-icon-plus" >
        <p:tooltip for="experimentPolicyAddButton" value="Add new properties." />
    </p:commandButton>
    <p:commandButton id="addPoliciesNoOp" style="visibility:hidden" value="NoOp"/>
    <p:defaultCommand target="addPoliciesNoOp"/>

    <p:dataTable id="experimentPoliciesListDataTable"                              
                 var="experimentPolicyObject" 
                 value="#{experimentController.experimentPolicyEditTable.listDataModel}" 
                 filteredValue="#{experimentController.experimentPolicyEditTable.filteredObjectList}"
                 paginator="true" 
                 paginatorAlwaysVisible="false" 
                 rows="#{experimentController.rows}"
                 binding="#{experimentController.experimentPolicyEditTable.listDataTable}"
                 widgetVar="policyListWidget" 
                 emptyMessage="No policies found.">

        <p:columnGroup type="header" >
            <p:column headerText="Property" />
            <p:column headerText="Value" />
            <p:column headerText="Units" />
            <p:column headerText="Description" />
            <p:column headerText="Actions" />
        </p:columnGroup>

        <p:subTable var="propertyValue" value="#{experimentPolicyObject.getExperimentPolicyPropertyValueList()}" >
            <f:facet name="header" >
                <h:outputText value="#{experimentPolicyObject.policyType.name} Policy"/>
            </f:facet>

            <p:column >
                <h:outputText value="#{propertyValue.getPolicyProperty().name}"/>
            </p:column>
            <p:column>
                <h:inputText id="propertyValue" value="#{propertyValue.policyPropertyValue}" rendered="#{!policyPropertyController.hasAllowedValues(propertyValue.getPolicyProperty())}" styleClass="entityDataTextShort"/>

                <p:selectOneMenu id="propertyValueSelect" value="#{propertyValue.policyPropertyValue}" styleClass="entityDataText" rendered="#{policyPropertyController.hasAllowedValues(propertyValue.getPolicyProperty())}">
                    <f:selectItems value="#{propertyValue.getPolicyProperty().allowedPolicyValueList}" 
                                   var="allowedPolicyValue"
                                   itemValue="#{allowedPolicyValue.policyValue}"
                                   itemLabel="#{allowedPolicyValue.policyValue}" />
                </p:selectOneMenu>
                <p:tooltip for="propertyValue" value="Modify property value" />
            </p:column>
            <p:column>
                <h:outputText value="#{propertyValue.getPolicyProperty().units}"/>
            </p:column>
            <p:column>
                <h:outputText value="#{propertyValue.getPolicyProperty().description}"/>
            </p:column>
        <p:column headerText="Actions" >
            <div class="actionLink">
                <p:commandLink oncomplete="PF('experimentPolicyRemoveDialogWidget').show()" rendered="#{loginController.admin or experimentController.canDeleteExperiment(experimentController.current)}" styleClass="ui-icon ui-icon-trash" title="Remove" update="@form">
                    <f:setPropertyActionListener value="#{propertyValue}" target="#{experimentController.experimentPropertyToDelete}"/>
                </p:commandLink>
            </div>
        </p:column>

        </p:subTable>
    </p:dataTable>

</ui:composition>