4 Replies Latest reply on Jan 16, 2011 6:59 AM by pouria kazemi

    persist method overriding

    pouria kazemi Newbie

      Hi experts
      I have a problem with overriding persist built in method which i  access that by extending from EntityHome.
      I have 3 xhtml page which we name them A B C.page A is a page that shows the data of fields of  table A .from page A we go to page B which we want to data entering for  table B and in page B we have an Id field from page A and table B  has a foreign key from table  A. in page C we show both table A and B fields.
      now i cannot persist my page B.xhtml and does any body know how to do?
      thanx

        • 1. Re: persist method overriding
          omid pourhadi Apprentice

          Hi,
          would you please provide more information including your stack trace
          and how to persist ,.....

          • 2. Re: persist method overriding
            pouria kazemi Newbie

            thanx for your attention


            foreign key from table B is primary key of table A and when table B is persisting should automatically persist this column.and why we need this column?cause when we go to page C foreign key of table B is the navigation key to show the content of table B in page C.but i dont know how to write and i have  no stack trace.

            • 3. Re: persist method overriding
              omid pourhadi Apprentice

              b.xhtml



              <s:button action="#{bHome.persistB}" actionListener="#{bHome.setA}" 
              value="Set A And persistB" />



              BHome.java




              @Name("bHome")
              public class BHome extends EntityHome {
              
              @Begin(join=true,FlushMode=Manual)
              public void setA(){
                 getInstance.setA(selectedA) //wherever it comes from
              }
              
              @End 
              public String persistB(){
               super.persist();
              }
              
              }



              As a piece of cake ...!
              if you need more help take a look at seam examples





              • 4. Re: persist method overriding
                pouria kazemi Newbie

                you know your peace of cake was very useful



                i really appreciate


                i solved it finally.when it got final face(final release) i'll show the details.
                and another thing is that i found something about Adempiere in your site.
                i found a pdf named Adempiere by Bayu Cahya Pamungkas and i want to know how to run Adempiere
                let me know if u know sth about how to install it


                Thanks in advance


                Pouria