3 Replies Latest reply on Jul 6, 2010 8:18 AM by Nick Belaevski

    Richfaces binding/lib problem

    Derk Dukker Novice

      Hi all,

       

      I need to bind the HtmlCalendar (<rich:calendar) to my java code, also see: http://seamframework.org/Community/DynamicFormFields#comment132498

       

      I use Jboss Tools with Maven2. In my EJB project the HTmlCalendar class is not available but when I add this to my ejb project it is:

       

      <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-ui</artifactId>
            <scope>provided</scope>
      </dependency>

       

      When I open my page I get a ClassNotFound which is obvious because I set the scope to provided. I know the War and EJB use different classloaders but how can I bind the HtmlCalendar class to the <rich:calendar>? Binding an HtmlInputText is not a problem because that one is in the API interface I guess, why isn't HtmlCalendar in it? I really need to have this.

       

      Regards,

       

      Derk

        • 1. Re: Richfaces binding/lib problem
          Nick Belaevski Master

          Derk,

           

          UI components should not be bound to EJB beans, use JSF managed beans or another WAR-scoped beans for that.

          1 of 1 people found this helpful
          • 2. Re: Richfaces binding/lib problem
            Derk Dukker Novice

            Hi Nick,

             

            Thanks for your answer. So in my EJB project I only have classes which are annotated by @Entity?

            How can I exchange data between de EJB and WAR project? Because if I annotate the classes in my WAR with @Name I get errors he can't find the classes. So I can't inject data between the 2 projects. I know that if you want your classes to be Seam components you will need to have the seam.properties in the project. It's now only in the EJB project, should that also be in the WAR project? If so why doesn't JBoss Tools creates this when you create a new project? I use Seam in combination with RichFaces.

             

            Regards,

             

            Derk

            • 3. Re: Richfaces binding/lib problem
              Nick Belaevski Master

              Yes, put seam.properties into WAR module and bind components there. Inject beans from EJB module into WAR beans or use lookup via Components class.