6 Replies Latest reply on Aug 30, 2008 3:59 PM by Pete Muir

    Foreign key and facelet

    Mario Moya Newbie

      Hello seamers!
      I'm making my first steps in seam (i'm very newbie ;-) and i want to avoid some headaches.
      A simple example for my question:
      Supose that i have two entityes, Person and Country.
      The entity Person have some atributes, like name, surname, etc, and have an atribute @ManyToOne to the Country table.
      That is:

      public class Person implements Serializable {
      private String name;
      private Country countrycod;
      /* getters and setters */
           @ManyToOne @NotNull
           public Country getCountrycod() {
                return this.countrycod;

      Then if i use seam generate-ui or the 'Seam Generate Entities' from Jboss Tools, the generated Edit.xhtml contains an <rich:dataTable>
      with some tabs for each one of my foreign keys.
      How can i do this in another way?
      It means, supose that i want and edit form like this:

      • Name

      • Surname

      • Country

      • City

      • Street

      if i don't want the Country field below all remainig fields (like seam-gem does)?
      I see some options to achieve it:
      1)May be I coud have a dynamic combo box that add his values from the Country table. How can i do that?
      2)Coud I have a new web window prompt to select the value?
      3)Coud I have some Rich Faces or ajax component like suggestion box?
      4)Any other way?

      I hope that you can help me...