ZNize Platform 6.0 Developer Guide

23.2 Embedded Beans - Region

The region attribute specifies which region to put an embedded bean. For example,

	<bean id="beanId" type="beanType" region="9">
	</bean>
Two embedded beans can not be in a same region. If the region number of an embedded bean is not defined, it will be assigned as following:

The first region number is the 1st default region for queryResults in the containerBean. Then increase region number by 1 for next embedded object. The default regions for queryResults are defined in znize.home/conf/containers.xml, which will be overridden by conf/containers.xml (if any) of current site (if applicable).

For example,

	<regions>
		...
		<region number="5">queryForm</region>
		<region number="7,6">queryResults</region>
	</regions>
The first region number for embedded bean is 7. The predefined QUERY stands for the 1st query region, and it is region 5 for the example above.

	<bean id="bean1" type="beanType">
	</bean>

	<bean id="bean2" type="beanType" region="9">
	</bean>

	<bean id="bean3" type="beanType">
	</bean>

	<bean id="bean4" type="beanType" region="QUERY">
	</bean>
The region number for object1 is 7. The region number for object2 is 9. The region number for object3 is 10. The region number for object4 is 5 (QUERY).

If the region number of an embedded object is less than the 1st default queryResults region number, then the bean can be put in the region inside a border layout unit. For example,

conf/containers.xml

<containers>
	<container name="indexCntrBean">
		<regions>
			<region number="0">pageHeaderMenu</region>
			<region number="1">containerMenu</region>
			<region number="5">queryForm</region>
			<region number="7,6">queryResults</region>
		</regions>

		<borderLayout>
			<unit position="north">
				<appBar><facet name="logo"/><facet name="title"/></appBar>
			</unit>
			
			<unit position="west">
				<column><region number="0"/><region number="1"/></column>
			</unit>

			<unit position="center">
				<object name="page"/>
			</unit>			
				
			<unit position="east">
				<column><region number="5"/><region number="6"/></column>
			</unit>
							
		</borderLayout>
	</container>
</containers>
Embed the following bean in a page, and the bean will be added to the region 5 inside the east unit.

	<bean id="bean2" type="beanType" region="5">
	</bean>
Embedded Beans: OverviewEmbedded Beans: Criteria ElementsFrames / No Frames