3 Replies Latest reply on Oct 7, 2010 7:13 AM by Leo van den berg

    How to create subentity?

    Benjamin Mark Newbie

      Hello,


      I'm trying several things with my seam-gen (2.2) project. In my model the entity company can have N entitys of address.
      Seam-gen generated for me a separate edit gui for the company and a separate edit gui for the address.
      Now I want to built a gui form in which the user can enter the company data and the first(main) address in one step. Further address can be edited with the standard address gui.


      Every try to access the address directly through the company fails


      In example the rich face code for zip


      <s:decorate id="nameBuildingField" template="layout/edit.xhtml">
                          <ui:define name="label">ZIP</ui:define>
                          <h:inputText id="nameBuilding" size="45" maxlength="45"
                              value="#{companyHome.instance.address.zip}">
                          </h:inputText>
                      </s:decorate>


      resultet in


      javax.el.PropertyNotFoundException: /CompanyEdit.xhtml @63,60 value="#{companyHome.instance.address.nameBuilding}": Target Unreachable, 'address' returned null on 'ch.bemar.creditfriend.model.Company'
      



      when I try to save the form.


      How can I solve this problem to create a company and the first subrecord for address?


      Thank you for your help


      Regards
      Ben