Skip to content

Instantly share code, notes, and snippets.

@tingletech
Created January 27, 2015 03:36
Show Gist options
  • Save tingletech/16e56186f77e1fb27620 to your computer and use it in GitHub Desktop.
Save tingletech/16e56186f77e1fb27620 to your computer and use it in GitHub Desktop.
<f:subview
xmlns:c="http://java.sun.com/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:nxl="http://nuxeo.org/nxforms/layout"
xmlns:nxu="http://nuxeo.org/nxweb/util"
xmlns:nxd="http://nuxeo.org/nxweb/document"
id="#{layout.id}">
<c:set var="isEditMode" value="#{nxl:isBoundToEditMode(layout.mode)}" />
<nxu:set var="layoutWidgetsDisplay"
value="#{layout.properties.widgetsDisplay}"
resolveTwice="true">
<nxu:set var="layoutStyleClass"
value="#{layout.properties.styleClass}"
resolveTwice="true">
<div class="dataInput studioFormTable #{layoutStyleClass}">
<nxl:layoutRow>
<nxu:set var="rowStyleClass"
value="#{layoutRow.properties.styleClass}"
resolveTwice="true">
<div class="#{rowStyleClass} line">
<nxl:layoutRowWidget>
<c:set var="containerWidth" value="#{widget.properties['containerWidth']}"/>
<c:set var="containerStyle" value="#{widget.properties['containerStyle']}"/>
<c:set var="containerClass" value="#{widget.properties['containerClass']}"/>
<!--TODO: default shouldn't be size1of2, default should be specified by columns defined in studio-->
<div class="unit #{nxu:test(not empty containerWidth, containerWidth, 'size1of2')}">
<div class="containerWrap line #{nxu:test(not empty containerClass, containerClass, '')}" style="#{nxu:test(not empty containerStyle, containerStyle, '')}">
<c:set var="specialLabel" value="#{widget.properties['specialLabel']}"/>
<c:set var="labelWidth" value="#{widget.properties['labelWidth']}"/>
<c:set var="widgetWidth" value="#{widget.properties['widgetWidth']}"/>
<c:choose>
<c:when test="${specialLabel != 'true'}">
<c:if test="#{not widget.handlingLabels}">
<div class="unit #{nxu:test(not empty labelWidth, labelWidth, 'size1of3')}">
<ui:include src="/widgets/incl/widget_label_template.xhtml" />
</div>
</c:if>
<div class="unit #{nxu:test(not empty widgetWidth, widgetWidth, 'size2of3')}">
<ui:decorate template="/widgets/incl/form_template.xhtml">
<ui:param name="addForm" value="#{widgetControl_requireSurroundingForm}" />
<ui:param name="formId" value="#{widget.id}_form" />
<ui:param name="useAjaxForm" value="#{widgetControl_useAjaxForm}" />
<ui:param name="eventsQueueId" value="#{layout.id}_queue" />
<ui:define name="form_template_content">
<nxl:widget widget="#{widget}" value="#{value}" />
</ui:define>
</ui:decorate>
</div>
</c:when>
<c:otherwise>
<ui:decorate template="/widgets/incl/form_template.xhtml">
<ui:param name="addForm" value="#{widgetControl_requireSurroundingForm}" />
<ui:param name="formId" value="#{widget.id}_form" />
<ui:param name="useAjaxForm" value="#{widgetControl_useAjaxForm}" />
<ui:param name="eventsQueueId" value="#{layout.id}_queue" />
<ui:define name="form_template_content">
<nxl:widget widget="#{widget}" value="#{value}" />
</ui:define>
</ui:decorate>
</c:otherwise>
</c:choose>
</div>
</div>
</nxl:layoutRowWidget>
</div>
</nxu:set>
</nxl:layoutRow>
</div>
</nxu:set>
</nxu:set>
<script>
jQuery(document).ready(function() {
jQuery(".widgetHelpLabel").tooltip({relative: true, position: 'bottom center'});
});
</script>
</f:subview>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment