• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Diagram Editable

Connections can be created and edited on the fly using drag and drop. In this example, computers are sources whereas servers are the targets. Once a connection is created, removed or changed using drag and drop, diagram makes an ajax request to save changes in the backend model. Additionally, optional ajax events are provided as callbacks.

Diagram Tag Documentation

Diagram is a component to create visual elements and connect them on a web page.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
first int false 0 Index of the first data to display.
lazy boolean false True, if the value-binding is instance of LazyDataModel. Defines if lazy loading is enabled for the data component.
rowIndexVar String false Name of iterator to refer each row index.
rowStatePreserved boolean false false Keeps state of its children on a per-row basis.
rows int false 0 Number of rows to display per page. Default value is 0 meaning to display all data available.
style String false Inline style of the component.
styleClass String false Style class of the component.
value Object true Datasource of the component.
var String true Name of the iterator variable that references each element in the data set.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc Basic Hierarchical FlowChart StateMachine Editable
Computer A
Computer B
Computer C
Server A
Server B

Usage


<style>
    .ui-diagram-element {
        border: 0.1em dotted #E5E4E2;
        background-color: #EFEEEC;
        width: 10em;
        height: 8em;
        text-align: center;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
        user-select: none;
    }

    .ui-diagram-element:hover {
        background-color: #C7C6C4;
    }
</style>

<div class="card">
    <h:form id="form">
        <p:growl id="msgs" showDetail="true" skipDetailIfEqualsSummary="true"/>

        <p:diagram value="#{diagramEditableView.model}" style="height:600px" styleClass="ui-widget-content"
                   var="el">
            <f:facet name="element">
                <h:outputText value="#{el.data.name}" style="display:block;margin-top:1em;"/>
                <p:graphicImage name="demo/images/#{el.data.image}"/>
            </f:facet>
            <p:ajax event="connect" listener="#{diagramEditableView.onConnect}"/>
            <p:ajax event="disconnect" listener="#{diagramEditableView.onDisconnect}"/>
            <p:ajax event="connectionChange" listener="#{diagramEditableView.onConnectionChange}"/>
        </p:diagram>
    </h:form>
</div>