Showing attributes from "Entity A" in a details component of "Entity B"

25 Nov '13, 06:21 AM
2,565 Views
No Forum Badges

Hi! I have this ER diagram, where I have a blogger who write some posts, and every post need to have one or more tags: alt text

In order to show this, I have a Homepage where I show a list of posts. When the user clicks on "read more" he/she can access to the full post content:

alt text

But the problem is that this "details page" shows the post and all the tags in database, not only the tags assigned to this particular post. And I only need to show the selected tags for that post. Like this: alt text

So, how can I show only that tags? The Web Project: https://www.dropbox.com/s/bm40fouovsx4s7d/News.zip

 
x 0
Follow
Answer Answer at this question and get points!
Forum Starter - Level 2

HI,

to filter only the tags of the selected post you can use a relationship role condition on the "Tags" list (right click > add > relationship role condition), selecting the relationship between the Post and Tag entities. Then, with the data flow connecting the details and the list components, you have to pass the oid of the post detail to the relationship role condition of the list.

In this way you're selecting only the tags having a connection with your post.

One observation: it seems that you're modeling the relationships in the wrong way. The default notation of WebRatio is the ER, which is the opposite of the UML one that you're using, so the relationships should have the opposite cardinality. See also this article: http://www.webratio.com/forum/question-details?kcond29x.att11=310&link=oln49x.redirect&nav=43

 
x 0
Answer at this question and get points!