Cmobilecom AF 5.19 Developer Guide

21.3 Embedded Objects - Region

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

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="objectId" type="objectType" region="9">
	</object>
Two embedded objects can not be in a same region. If the region number of an embedded object 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 cmobilecom.home/conf/containers.xml, which will be overridden by conf/containers.xml (if any) of current website (if applicable).

For example,

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

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="object1" type="objectType">
	</object>

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="object2" type="objectType" region="9">
	</object>

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="object3" type="objectType">
	</object>

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="object4" type="objectType" region="QUERY">
	</object>
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 object can be put in the region inside a border layout unit. For example,

conf/containers.xml

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

		<pageLayout>
			<unit position="north">
				<content>#{facet_logo}</content>				
			</unit>
			
			<unit position="west">
				<content>#{region_0}#{region_1}</content>				
			</unit>

			<unit position="center">
				<content>#{OBJECT:page}</content>			
			</unit>			
				
			<unit position="east">
				<content>#{region_5}#{region_6}</content>			
			</unit>
							
		</pageLayout>		
	</container>
</containers>
Embed the following object in a web page, and the object will be added to the region 5 inside the east unit.

	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="object2" type="objectType" region="5">
	</object>
Embedded Objects: Render ConditionEmbedded Objects: Criteria ElementsFrames / No Frames