5 Replies Latest reply on Oct 15, 2012 6:53 AM by bleathem

    How to use RichFaces Bootstrap with Seam?

    me-kell

      I'm trying to use RichFaces Bootstrap with Seam without success. Any hints how to?

       

      I'm using jboss-as-7.1.1.Final and jboss-seam-2.3.0.Final.

       

      I started with the blog example first testing richfaces as follows:

       

      in <jboss-seam-2.3.0.Final>\examples\blog\blog-web\src\main\webapp\template.xhtml, add to the html-element the namespace for richfaces

       

      xmlns:rich="http://richfaces.org/rich"

       

      and a richfaces accordion

       

      <h:form prependId="false">

        <rich:accordion>

          <rich:accordionItem header="xxx">xxx</rich:accordionItem>

          <rich:accordionItem header="yyy">yyy</rich:accordionItem>

          <rich:accordionItem header="zzz">zzz</rich:accordionItem>

        </rich:accordion>

      </h:form>

       

      it works fine.

       

      But when I try it with richfaces_bootstrap as follows:

       

      add to the html-element the namespace for richfaces

       

      xmlns:b="http://richfaces.org/sandbox/bootstrap"

       

      and a richfaces_bootstrap accordion

       

      <h:form prependId="false">

        <b:accordion id="accordion">

          <b:accordionGroup heading="xxx">xxx</b:accordionGroup>

          <b:accordionGroup heading="yyy">yyy</b:accordionGroup>

          <b:accordionGroup heading="zzz">zzz</b:accordionGroup>

        </b:accordion>

      </h:form>

       

      and the following dependency in <jboss-seam-2.3.0.Final>\examples\blog\blog-web\pom.xml

       

      <dependency>

        <groupId>org.richfaces.sandbox.ui.bootstrap</groupId>

        <artifactId>bootstrap-ui</artifactId>

        <version>4.3.0-SNAPSHOT</version>

      </dependency>

       

      then I get java.lang.NoClassDefFoundError: org/richfaces/bootstrap/ui/accordionGroup/AbstractAccordionGroup

        • 1. Re: How to use RichFaces Bootstrap with Seam?
          bleathem

          Interesting.  Can you post a sample project to github demonstrating the behavior?  If not, can you at least post your pom.xml?

          • 2. Re: How to use RichFaces Bootstrap with Seam?
            me-kell

            I created a sample project based on examples/blog see attached zip-file!

            here the description of the sample project:

            ######################################################################

            - extract jboss-seam-distribution-2.3.0.Final-src.zip

            - remove all but the following

                build/settings.xml

                examples/blog/*

            ----------------------------------------------------------------------

            commit

            ######################################################################

            set JAVA_HOME=<your-path-to>\jdk1.6.0_34

            set MAVEN_HOME=<your-path-to>\apache-maven-3.0.4

            set PATH=%MAVEN_HOME%\bin;%PATH%

            set SEAM_HOME=<your-path-to>\jboss-seam-2.3.0.Final

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean install

            ----------------------------------------------------------------------

            start jboss-as-7.1.1.Final server

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog\blog-ear

            mvn -s %SEAM_HOME%\build\settings.xml jboss-as:deploy

            ----------------------------------------------------------------------

            http://localhost:8080/seam-blog/

            ----------------------------------------------------------------------

            the blog example works as expected!

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean

            ----------------------------------------------------------------------

            commit

            ######################################################################

            add

                  xmlns:rich="http://richfaces.org/rich"

            and

                      <h:form prependId="false">

                        <rich:accordion>

                          <rich:accordionItem header="xxx">xxx</rich:accordionItem>

                          <rich:accordionItem header="yyy">yyy</rich:accordionItem>

                          <rich:accordionItem header="zzz">zzz</rich:accordionItem>

                        </rich:accordion>

                      </h:form>

             

            to %SEAM_HOME%\examples\blog\blog-web\src\main\webapp\template.xhtml

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean install

            ----------------------------------------------------------------------

            start jboss-as-7.1.1.Final server

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog\blog-ear

            mvn -s %SEAM_HOME%\build\settings.xml jboss-as:deploy

            ----------------------------------------------------------------------

            http://localhost:8080/seam-blog/

            ----------------------------------------------------------------------

            the example works as expected and the richfaces accordion is shown!

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean

            ----------------------------------------------------------------------

            commit

            ######################################################################

            add

                  xmlns:b="http://richfaces.org/sandbox/bootstrap"

            and

                      <h:form prependId="false">

                        <b:accordion id="accordion">

                          <b:accordionGroup heading="xxx">xxx</b:accordionGroup>

                          <b:accordionGroup heading="yyy">yyy</b:accordionGroup>

                          <b:accordionGroup heading="zzz">zzz</b:accordionGroup>

                        </b:accordion>

                      </h:form>

             

            to %SEAM_HOME%\examples\blog\blog-web\src\main\webapp\template.xhtml

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean install

            ----------------------------------------------------------------------

            start jboss-as-7.1.1.Final server

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog\blog-ear

            mvn -s %SEAM_HOME%\build\settings.xml jboss-as:deploy

            ----------------------------------------------------------------------

            http://localhost:8080/seam-blog/

            ----------------------------------------------------------------------

            at this point I do not know which dependencies are needed, and where to put them

            I've tried different scenarios, but no success:

              adding the jars to the lib directories

              adding dependency-elements to different poms

            I get a NoClassDefFoundError: org/richfaces/bootstrap/ui/accordionGroup/AbstractAccordionGroup

            ----------------------------------------------------------------------

            cd %SEAM_HOME%\examples\blog

            mvn -s %SEAM_HOME%\build\settings.xml clean

            ----------------------------------------------------------------------

            commit

            ######################################################################

            • 3. Re: How to use RichFaces Bootstrap with Seam?
              me-kell

              Hi Brian. Any idea what is wrong with the example project above?

              • 4. Re: How to use RichFaces Bootstrap with Seam?
                bleathem

                Sorry for not replying - I'm busy with JavaOne this week.  I'll be sure to address the issue of using the RichFaces Bootstrap components in custom applications next week.

                • 5. Re: How to use RichFaces Bootstrap with Seam?
                  bleathem

                  Have a look at the RichFaces Bootstrap Quickstart project:

                  https://github.com/richfaces/sandbox/tree/develop/bootstrap/quickstart

                   

                  As described in the blog post:

                  http://www.bleathem.ca/blog/2012/10/richfaces-bootstrap-quickstart.html

                   

                  While it doesn't address Seam 2.x integration directly, it should be enough to get you started.

                   

                  Brian