 		if rendererClass?.prototype instanceof Renderer.Extension
 			r += "#{child.id}.target = #{obj.id};\n"
 		else
-			r += "#{child.id}.parent = #{obj.id};\n"
-
-	r
+			r += "if (#{child.id} instanceof Item) #{child.id}.parent = #{obj.id};\n"
+
+	r
+
+stringObject = (obj) ->
+	r = stringObjectHead obj
+	r += stringObjectChildren obj
 
 stringAttribute = (obj, parents) ->
 	assert obj.type is ATTRIBUTE, "stringAttribute: type must be an attribute"

		if elem.type is OBJECT
			code += "if (#{elem.id} instanceof Item) mainItem = #{elem.id};\n"

	idsObject = '{'
	for id in idsKeys
		idsObject += "#{id}: #{id}, "
	if idsKeys.length > 0
		idsObject = idsObject.slice 0, -2
	idsObject += "}"
	code += "var ids = #{idsObject};\n"

	code

	# filter by ids
	for elem, i in binding when typeof elem isnt 'string'
		[id] = elem
		if id is 'parent' or id is 'target'
			elem.unshift "'this'"
		else if id is 'this'
			elem[0] = "'this'"
		else if id is 'view' or ids.hasOwnProperty(id)
			continue
		else
			binding[i] = elem.join '.'
