5 Replies Latest reply on Jan 5, 2012 6:55 PM by jonathanb

    rich:select not showing value

    jonathanb

      I have

       

      <h:outputLabel for="paymenttype">Payment Type:</h:outputLabel>

      <rich:select  id="paymenttype" value="#{journeyCRUD.journey.paymentType}">

      <f:selectItem itemValue="CASH" itemLabel="Cash" />

      <f:selectItem itemValue="ACCOUNT" itemLabel="Account" />

      <f:selectItem itemValue="CARD" itemLabel="Card" />

      </rich:select>

       

      <h:outputLabel for="pt">Payment Type:</h:outputLabel>

      <h:outputText id="pt" value="#{journeyCRUD.journey.paymentType}"/>

       

      and the page correctly saves the selected value but does not display it in the rich:select. The value is correctly displayed in the h:outputText below.

       

      The paymentType property is an enum:


      public enum PaymentType {CASH, ACCOUNT, CARD }
      private PaymentType paymentType;

      public PaymentType getPaymentType() {

          return paymentType;

      }

      public void setPaymentType(PaymentType paymentType) {

          this.paymentType = paymentType;

      }

       

      I am using 4.0.0.Final

       

      Any help would be much appreciated.

        • 1. Re: rich:select not showing value
          snaker

          try to include <a4j:ajax event="change"/> inside rich:select

          • 2. Re: rich:select not showing value
            snaker

            sorry, try this better

             

             

            <a4j:ajax event="change" execute="@form"

            />

             

             

            • 3. Re: rich:select not showing value
              jonathanb

              Thanks Kike, but that doesnt seem to be my problem which looks broader.

               

              It also seems my commandLinks arent working either. In the code below, the button works but the link causes a javascript error:

              Uncaught ReferenceError: mojarra is not defined.

               

              I also have some startup warnings and my jars below. Im lost but I wonder do I have a project setup problem.

               

              Any suggestions would be a great help!

               

              XHTML

               

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

              <html xmlns="http://www.w3.org/1999/xhtml"

                        xmlns:ui="http://java.sun.com/jsf/facelets"

                        xmlns:h="http://java.sun.com/jsf/html"

                  xmlns:f="http://java.sun.com/jsf/core"

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

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

               

               

              <f:view>

              <h:head>

              </h:head>

              <h:body>

               

                        <h:form id="myform" name="myform">

                                            <h:commandButton id="button" value="Button" action="#{myBean.action}"/>

                                            <h:commandLink id="link" action="#{myBean.action}">

                                                      Link

                                            </h:commandLink>

                                            </h:form>

               

               

              </h:body>

              </f:view>

              </html>

               

              Generated HTML

               

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

              <html xmlns="http://www.w3.org/1999/xhtml">

              <head><link type="text/css" rel="stylesheet" href="/dispatch/rfRes/skinning.ecss.jsf?db=eAHL6rC8BQAEkAIG" />

              </head><body>

              <form id="myform" name="myform" method="post" action="/dispatch/testlink.jsf" enctype="application/x-www-form-urlencoded">

              <input type="hidden" name="myform" value="myform" />

              <input id="myform:button" type="submit" name="myform:button" value="Button" />

              <script type="text/javascript" src="/dispatch/javax.faces.resource/jsf.js.jsf?ln=javax.faces"></script>

              <a id="myform:link" href="#" onclick="mojarra.jsfcljs(document.getElementById('myform'),{'myform:link':'myform:link'},'');return false">

                              Link

                          </a><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-306546322051528219:6175134548975416569" autocomplete="off" />

              </form></body>

              </html>

               

              Startup warnings

               

              I also have these startup warnings, I dont know if theyre connected (or anything to worry about)

               

              WARNING: WEB9052: Unable to load class org.richfaces.renderkit.OrderingComponentRendererBase$1, reason: java.lang.ClassNotFoundException: org.richfaces.renderkit.OrderingComponentRendererBase$1

              WARNING: WEB9052: Unable to load class org.richfaces.component.UIOrderingBaseComponent$2, reason: java.lang.ClassNotFoundException: org.richfaces.component.UIOrderingBaseComponent$2

              WARNING: WEB9052: Unable to load class org.richfaces.converter.BaseTreeConverter, reason: java.lang.ClassNotFoundException: org.richfaces.converter.BaseTreeConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.IntegerColorConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.IntegerColorConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.LongColorConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.LongColorConverter

              WARNING: WEB9052: Unable to load class org.richfaces.converter.TreeAdaptorRowKeyConverter, reason: java.lang.ClassNotFoundException: org.richfaces.converter.TreeAdaptorRowKeyConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.rowkey.ScrollableDataTableRowKeyConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.rowkey.ScrollableDataTableRowKeyConverter

              WARNING: WEB9052: Unable to load class org.richfaces.converter.TreeRowKeyConverter, reason: java.lang.ClassNotFoundException: org.richfaces.converter.TreeRowKeyConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.selection.ClientSelectionConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.selection.ClientSelectionConverter

              WARNING: WEB9052: Unable to load class org.richfaces.converter.TreeAdaptorIntegerRowKeyConverter, reason: java.lang.ClassNotFoundException: org.richfaces.converter.TreeAdaptorIntegerRowKeyConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.seamtext.DefaultSeamTextConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.seamtext.DefaultSeamTextConverter

              WARNING: WEB9052: Unable to load class org.richfaces.convert.AWTColorConverter, reason: java.lang.ClassNotFoundException: org.richfaces.convert.AWTColorConverter

              WARNING: WEB9052: Unable to load class org.richfaces.component.UITree$2, reason: java.lang.ClassNotFoundException: org.richfaces.component.UITree$2

               

              INFO: Initializing Mojarra 2.1.0 (FCS 2.1.0-b11) for context '/dispatch'

               

              INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

               

              INFO: Selected fallback cache factory

              INFO: Creating LRUMap cache instance using parameters: {javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.validateXml=true, com.sun.faces.forceLoadConfiguration=true}

              INFO: Creating LRUMap cache instance of 512 items capacity

               

              INFO: RichFaces Core Implementation by JBoss, a division of Red Hat, Inc., version v.4.0.0.Final SVN r.22269

               

              Jars

               

              cssparser-0.9.5.jar

              guava-r09.jar

              icu4j-3.4.4.jar

              richfaces-components-api-4.0.0.Final.jar

              richfaces-components-ui-4.0.0.Final.jar

              richfaces-core-api-4.0.0.Final.jar

              richfaces-core-impl-4.0.0.Final.jar

              sac-1.3.jar

              • 4. Re: rich:select not showing value
                snaker

                You need the mojarra:

                 

                jsf-api-2.0.3-b03.jar

                jsf-impl-2.0.3-b03.jar

                 

                And i have also but i don't remember his function:

                 

                jstl-1.2.jar

                ehcache-1.6.0.jar

                 

                However, your warnings are very extrange, i think your libraries (richfaces final) aren't loading

                 

                 

                try include mojarra

                 

                1 of 1 people found this helpful
                • 5. Re: rich:select not showing value
                  jonathanb

                  I did finally work this out, though I had to resort to discarding my project and rebuilding it based on one of the richfaces sample projects. I had aligned the jars before this to no avail. I think it must have been something in one of the xml config files.

                   

                  Thanks for your help.