#set($componentNameBase = ${reference.getPropertyNameInLocal()} )
##
#foreach( $entry in ${reference.toList()} )
#set( $prop = ${entry.getLocal()} )
#set( $propTypeCategory = ${prop.getType().getCategory().getName()} )
#set( $componentName = "input${componentNameBase}_${prop.getName()}" )
####
#if( $propTypeCategory == "number" )
	<component id="${componentName}" type="contrib:NumericField">
    	<binding name="value" expression="target.${prop.getName()}" />
        <static-binding name="id" value="id_${prop.getName()}"/>
        <static-binding name="type" value="${prop.getType().getName()}"/>
        <static-binding name="displayName" value="${prop.getLabel()}"/>
	</component>
#elseif( $propTypeCategory == "string" )
	<component id="${componentName}" type="TextField">
    	<binding name="value" expression="target.${prop.getName()}" />
        <static-binding name="size" value="${prop.getMaxLength()}"/>
	</component>
#else
	<!-- no component for type '${entry.getLocal().getType().getName()}'  -->
#end
####
#end
##
#set( $refEntity = ${reference.getReferenceClass()} )
#set( $listPageName = "${tapestryPageListPrefix}${refEntity.getName()}${tapestryPageListSuffix}" )
#set( $mapping = "" )
##
#foreach( $entry in ${reference.toList()} )
#set( $local = ${entry.getLocal()} )
#set( $foreign = ${entry.getForeign()} )
####
#if( ${mapping} != "" )
#set( $mapping = "${mapping}," )
#end
####
#set( $mapping = "${mapping}'id_${prop.getName()}': '${foreign.getName()}'")
#end
##
#set( $mapping = "'id_${componentNameBase}_caption': 'caption', ${mapping}" )
#set( $mapping = "#{${mapping}}" )
	<component id="input${componentNameBase}Link" type="brownie:SubWindowLink">
    	<binding name="fieldMapping" expression="${mapping}" />
        <binding name="windowName" expression='page.pageName + "_sub"'/>
        <static-binding name="page" value="${listPageName}"/>
	</component>
