1 Reply Latest reply on Jul 30, 2010 3:39 AM by Ganzorig Bayaraa

    2 foreign keys reference the same table :: DOESN'T WORK AS EXPECTED

    Ganzorig Bayaraa Newbie

      This one is very complicated that I couldn't figure out after 4 days. So I have a 2 table user and article. There are 2 kinds of user, author and editor and they are both stored in user. Article has both author and editor, and these 2 are referencing the same table, user.Well, it works fine and shows the content as it's in DB. The problem is when I try to create new article or edit the article, I'd select either author or editor from the user list. This one sets the selected user to both author and editor on the article, even though they were different and I intented to change one of them. It's showing the content correctly from database, but when I edit (or create), it's having a side effect that I would not ask for. There must be problem with userHome object. I'm referencing it twice in articleHome object. But as I said before, when it loads data from DB, it works fine. If I go deeper, as I have known until now, the parameter (passed by GET method on the seam page) userId (from userList) sets the passed one 1 user's id to both author and editor. Okay, so that's the problem and hope you guys would help me with your precious experience.

      Appreciate you,