xpath Constrained by showing incorrect value on reference selector
End result of list is All, Korea, not Korea and a valid combonation should be Korea, not Korea. I have 2 entities (Region and channel) that have an association to an entity Approval Matrix. I have checked ‘ApprovalMatrix’ for the combo of the certain channel and region I select, and the only valid options that come up are Korea, not Korea. After study, I saw that independently if I choose only a certain channel filter or only a certain Region filter on approvalmatrix that I get All, Korea, and all Korea all in common. When I go and filter the selectable items in a reference selector using constrain by I should only get Korea, not Korea… however I am getting: All, Korea, not Korea. When I look at my developer window in chrome, I can see that it is querying the following for my Area reference selector; //MyFirstModule.Areas[MyFirstModule.ApprovalMatrix_Areas/MyFirstModule.ApprovalMatrix[MyFirstModule.ApprovalMatrix_Channel/MyFirstModule.Channel[id='7881299347898470']]][MyFirstModule.ApprovalMatrix_Areas/MyFirstModule.ApprovalMatrix[MyFirstModule.ApprovalMatrix_Region/MyFirstModule.Region[id='3096224743817217']]] With this path it is essentially saying… Hey Region of Pacific Rim what values do you have? then it asks the same for channel… it looks like it joins the ones it has in common, which happen to be All, Korea, and not Korea… however, if the query looked like this, it would produce an accurate result `//MyFirstModule.Areas[MyFirstModule.ApprovalMatrix_Areas/MyFirstModule.ApprovalMatrix[MyFirstModule.ApprovalMatrix_Channel/MyFirstModule.Channel[id='7881299347898470']][MyFirstModule.ApprovalMatrix_Region/MyFirstModule.Region[id='3096224743817221']]]` also, I only have access to currentObject, so I can’t type this out in the xpath query… I noticed this when I first started using mendex, and learned that I needed to group them like above or use and id = and id=… etc.. Am I doing this wrong? I don’t think I am since I have come across this before.. EDIT: Added photo of domain model as requested. Search with both filters on overview page to show what areas there should be Results with only searching for ChannelId = 2 Search for only RegionId=5 Match results table of what it shows vs what it should show Now if you look at xpath query it would hopefully make more sense.
I created the same domain model
And a page showing an overview of the matrix records that allows searching via the references for regions and channels.
The image below shows all available options:
So searching for only channelID = 1 delivers me 3 records as expected:
Searching for the combination of ChannelId=1 and regionId=2 will result in 1 record as expected:
Combining the channel 1 with region 1 will deliver 2 records as expected:
So I’m still not sure what is happening differently in your case, maybe the example above will help in clarifying even more what your case exactly is.
Erwin 't Hoen
I’m not seeing anything wrong here? Mendix joins the objects based on your region and channel filters and everything that is returned matches your filters.. I'm guessing your model is wrong if you need other results or you need to set up other filters.