Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
themeEclipse
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.qcadoo.org/view" 
	xsi:schemaLocation="http://schema.qcadoo.org/view http://schema.qcadoo.org/view.xsd"
	name="product"
	modelName="product"
	menuAccessible="true">

	<component type="window" name="window">
		<ribbon>
			<group template="navigation"/>
			<group template="formSaveCopyAndRemoveActions"/>
		</ribbon>
		<component type="form" name="product" reference="form">
			<script>
				<![CDATA[
                                        var 					var save = #{window}.getRibbonItem("actions.save");

                                        this					this.addOnChangeListener({
                                            onSetValue						onSetValue: function(value) {
                                                if 							if (value && value.content && !value.content.entityId) {
                                                    save								save.disable();
                                                }
                                            }
                                        							}
						}
					});
				]]>
			</script>
			<component type="gridLayout" name="gridLayout" columns="3" rows="11">
				<layoutElement column="1" row="1">
					<component type="input" name="number" field="number" reference="number" />
				</layoutElement>
				<layoutElement column="1" row="2">
					<component type="textarea" name="name" field="name" hasDescription="true" />
				</layoutElement>
				<layoutElement column="1" row="3">
					<component type="select" name="typeOfMaterial" field="typeOfMaterial" />
				</layoutElement>
				<layoutElement column="1" row="4">
					<component type="select" name="unit" field="unit" />
				</layoutElement>
				<layoutElement column="2" row="1">
					<component type="input" name="ean" field="ean" />
				</layoutElement>
				<layoutElement column="2" row="2">
					<component type="select" name="category" field="category" />
				</layoutElement>
				<layoutElement column="2" row="3">
					<component type="input" name="batch" field="batch" />
				</layoutElement>
				<layoutElement column="2" row="4">
					<component type="checkbox" name="genealogyBatchReq" field="genealogyBatchReq">
						<option type="labelWidth" value="60" />
					</component>
				</layoutElement>
				<layoutElement column="1" row="5" width="3" height="7">
					<component type="borderLayout" name="substitutesBorderLayout" reference="substitutesBorderLayout">
						<option type="label" value="substitutesBorderLayoutLabel" />
						<component type="gridLayout" name="gridsLayout" columns="5" rows="6" hasBorders="false">
							<layoutElement column="1" row="1" width="2" height="6">
								<component type="grid" name="substitutes" reference="substitutes" source="#{form}.substitutes">
									<option type="column" name="number" fields="number" link="true" width="50"/>
									<option type="column" name="name" fields="name" link="true" width="100"/>
									<option type="order" column="priority" direction="asc"/>
									<option type="correspondingView" value="products/substitute" />
									<option type="correspondingComponent" value="form" />
									<option type="correspondingViewInModal" value="true" />
									<option type="paginable" value="false" />
									<option type="creatable" value="true" />
									<option type="deletable" value="true" />
									<option type="fullscreen" value="true" />
									<option type="multiselect" value="true" />
								</component>
							</layoutElement>
							<layoutElement column="3" row="1" width="3" height="6">
								<component type="grid" name="substituteComponents"
									source="#{substitutes}.components">
									<option type="column" name="number" fields="product"
										expression="#product['number']" link="true" width="50"/>
									<option type="column" name="name" fields="product"
										expression="#product['name']" link="true" width="100"/>
									<option type="column" name="quantity" fields="quantity" width="40"/>
									<option type="column" name="unit" fields="product"
										expression="#product['unit']" link="false" width="30"/>
									<option type="order" column="number" direction="desc"/>
									<option type="correspondingView" value="products/substituteComponent" />
									<option type="correspondingComponent" value="form" />
									<option type="correspondingViewInModal" value="true" />
									<option type="paginable" value="false" />
									<option type="creatable" value="true" />
									<option type="deletable" value="true" />
									<option type="fullscreen" value="true" />
									<option type="multiselect" value="true" />
								</component>
							</layoutElement>
						</component>
					</component>
				</layoutElement>
			</component>
			<option type="header" value="true"/>
			<option type="expression" value="#name" />
		</component>
	</component>
	<preRenderHook bean="com.qcadoo.mes.products.ProductService" method="generateProductNumber" />
</view>

...