cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate IDs while routing in ObjectPage layout (uxap)

Former Member
0 Kudos
420

Hello colleagues,

I've faced a strange issue with the duplicate ID's while navigating from ObjectPage layout control to another view and back.

What I'm trying to do - is to navigate from a block (BlockBase.js) to another view. When I navigate to this view - everything is OK, but when a navigate back - I'm getting the following Error: adding element with duplicate id '__xmlview2-layoutData'.

What could be wrong here?

The subsection looks like:

<ObjectPageSubSection title="Item Section" id="subSectionId">
	<blocks>
	</blocks>
</ObjectPageSubSection>

I need a router instance inside my block controller, so I have to leave blocks section empty and add a view using router.

I have the following routes and targets:

routes: [
	{
		name: "listview",
		pattern: "",
		target: "listview"
	},
	{
		name: "objectpage",
		pattern: "listview/{ItemId}",
		target: ["objectpage", "objectBlock"],
	},
	{
		name: "objectdetails",
		pattern: "listview/{ItemId}/Subitems/{SubItemId}",
		target: "objectdetails"
	}					
],
targets: {
	listview: {
		viewName: "listview",
		viewLevel: 1,
		clearAggregation: true
	},
	objectpage: {
		viewName: "objectpage",
		viewLevel: 2,
		clearAggregation: true
	},
	objectBlock: {
		parent: "objectpage",
		controlId: "subSectionId",
		controlAggregation: "blocks",
		viewPath: "testroute.blocks",
		viewName: "ObjectDetailsBlock",
		clearAggregation: true
	},					
	objectdetails: {
		viewName: "objectdetails",
		viewLevel: 3,
		clearAggregation: true
	}
}

Accepted Solutions (0)

Answers (1)

Answers (1)

devendervb
Contributor
0 Kudos

seems it is creating ObjectPage again, if you are not refering to it's id in your code you can remove the id property for ObjectPage, otherwise check where it is creating the ObjectPage again.