10 Replies Latest reply on Aug 9, 2011 3:27 PM by locked

    'Select' Component Not Available For Selection?

    locked

      I am using Richfaces 3.3.3, but in the components list through rich: I do not get the option to select the 'Select' component.

      I have even downloaded RichFaces 4.0 but it still isn't an option.

       

      Rich Selection.jpg

       

      I have the following JAR Files: -

      • richfaces-api-3.3.3.Final.jar
      • richfaces-impl-3.3.3.Final.jar
      • richfaces-impl-jsf2-3.3.3.Final.jar
      • richfaces-ui-3.3.3.Final.jar

       

       

      Why is the 'Select' component not available to me?

        • 1. Re: 'Select' Component Not Available For Selection?
          snaker

          if you use rich:select (you have write it) although the eclipse or netbeans or another program not show it, the rich:select will work perflecly

           

          The problem is in the help of eclipse or netbeans, it could be because it is not updated, but i dont know the reason

          • 2. Re: 'Select' Component Not Available For Selection?
            locked

            Hi Kike Gil

             

                 I will look at updating my Netbeans and see if that fixes it being displayed as an option.

             

                 I will also just try writing it and see if it works as desired.

             

             

            Thanks, much appreciated.

            • 3. Re: 'Select' Component Not Available For Selection?
              snaker

              I fixed updated jbosstools, if it help you, great!

              • 4. Re: 'Select' Component Not Available For Selection?
                locked

                I upgraded Netbeans to 7.0 and it still does not see the 'Select' component in the list

                 

                If I manually write the code and try and run it, I get the following error: -

                 

                          PWC6142: No tag "select" defined in tag library imported with prefix "rich"

                 

                 

                The TAG library I am referencing is

                          <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

                 

                I guess its not seeing it in the JAR files.

                 

                 

                • 5. Re: 'Select' Component Not Available For Selection?
                  nbelaevski

                  Hi,

                   

                  rich:select is not in 3.3.x, it's only in 4.x - are you using this version?

                  1 of 1 people found this helpful
                  • 6. Re: 'Select' Component Not Available For Selection?
                    locked

                    Hi Nick,

                     

                    I have downloaded and using RF 4.x using Netbeans 7.0, but the 'rich' tag library is not recognised neither is the a4j tag library.

                     

                    I have downloaded Eclipse and referenced the RF 4.x and it sees the 'rich' and 'a4j' tag libraries and I am able to find the 'select' component.

                     

                    Could it be a problem in Netbeans 7.0 or is it a problem in the RF 4.x?

                     

                    I have attempted to use the 'select' component and Eclipse does not render it on a page, to the right of 'Select User: ' should be the 'select' component, but it is not rendered.  In fact I tried to render a few rich components and none of them rendered???

                     

                    select missing.jpg

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                     

                    <!

                    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:rich="http://richfaces.org/rich"

                     

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

                     

                    <

                    ui:composition template="/WEB-INF/templates/basicTemplete.xhtml"

                    >

                     

                    <ui:define name="content">

                     

                     

                    <h:form>

                     

                     

                         <h:panelGrid columns="2">

                     

                         <h:outputText value="Select User: "></h:outputText>

                     

                     

                        <rich:select enableManualInput="true"

                     

                        disabled="false"

                     

                        showButton="true"  

                     

                        defaultLabel="Start Typing"  

                     

                        value="#{loginBean.name}"

                     

                        id="selectId">

                     

                        <f:selectItem itemLabel="Harry" itemValue="Harry"/>

                     

                      <f:selectItem itemLabel="Bob" itemValue="Bob"/>

                     

                    </rich:select>

                     

                    </h:panelGrid>

                     

                     

                     

                     

                    <h:panelGrid columns="2">

                     

                    <h:outputText value="Name"></h:outputText>

                     

                    <h:inputText value="#{loginBean.name}"></h:inputText>

                     

                    <h:outputText value="Password"></h:outputText>

                     

                    <h:inputSecret value="#{loginBean.password}"></h:inputSecret>

                     

                    </h:panelGrid>

                     

                    <h:commandButton value="Login" action="login"></h:commandButton>

                     

                    </h:form>

                     

                    </ui:define>

                    </

                    ui:composition

                    >

                    </

                    html

                    >

                     

                     

                     

                     

                     

                    • 7. Re: 'Select' Component Not Available For Selection?
                      ilya_shaikovsky

                      1) it's not netbeans but our problem.. B.t.w. should be corrected in latest 4.0.1 snapshot I believe. We just have some taglib entries missed.

                       

                      2)  what do you mean Eclipse do not renders.. Built-in Visual editor? Or built-in browser? Try just oped the page in some browser app - should be ok. http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=inplaceSelect&skin=blueSky

                      http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=select&skin=blueSky

                      1 of 1 people found this helpful
                      • 8. Re: 'Select' Component Not Available For Selection?
                        locked

                        Hi Ilya,

                         

                        1) Thanks for the update, yes I thought I'd read somewhere about some tag issues in RF release 4.0.  When will RF 4.0.1 be available?

                         

                        2) When I say Eclipse does not render it, I mean when I select run it to show me the working version in a in-line brower, the richfaces components are not shown on the page at all.  Even the older components if I try and use those, they are not shown either.  Just the standard <h> components are. 

                         

                        If I copy the code from http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=select&skin=blueSky and alter the second example to use just <f:selectItem> items instead of coming from a back end bean for ease. 

                         

                        This is what I see:-

                         

                        SelectExample.jpg

                         

                        Notice all the richface components are not visible/rendered?

                         

                        Perhaps I need to deploy the WAR file to a remote Application Server and see if they are rendered there.

                         

                         

                        Thanks again for the update.

                         

                         

                         

                         

                        • 9. Re: 'Select' Component Not Available For Selection?
                          ilya_shaikovsky

                          no you do not need. it will not make any difference. you need to check how JSF servlet configured in your app. I believe your URL should be .../login.jsf probably.

                           

                          besides keep in mind that your tempalte should encode valid html strucutre and use h:body and h:head tags instead of plain HTML ones. In other case JSF resources will not be loaded,.

                          • 10. Re: 'Select' Component Not Available For Selection?
                            locked

                            Hi Ilya, Nick

                             

                            I have since deployed using Eclipse and I have found I can invoke a *.xhtml and have it render some random data:

                             

                                 <h:inputText value="#{sayHello.subject}"/><br/>

                             

                             

                            And this is populated from a back end bean. 

                             

                             

                            As you can see the <h: tags get rendered, so this is being processed by the JSF servlet.

                             

                            Working.jpg

                             

                             

                            Now if I try to work with RichFaces 4.0 in a XHTML format

                             

                            However I still have a problem with RichFaces 4, yet in my xhtml file I am able to be prompted to select the RichFaces tags I want to use.

                             

                            XHTML.JPG

                             

                            I have checked my JSF configuration

                             

                             

                            web.xml

                            ===========

                             

                            <?xml version="1.0" encoding="UTF-8"?>

                            <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

                            <display-name>MyJSF</display-name>

                             

                            <context-param>

                            <param-name>javax.faces.PROJECT_STAGE</param-name>

                            <param-value>Development</param-value>

                            </context-param>

                             

                            <context-param>

                            <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>

                            <param-value>false</param-value>

                            </context-param>

                            <display-name>rich</display-name>

                             

                            <servlet>

                            <servlet-name>Faces Servlet</servlet-name>

                            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                            <load-on-startup>1</load-on-startup>

                            </servlet>

                            <servlet-mapping>

                            <servlet-name>Faces Servlet</servlet-name>

                            <url-pattern>/faces/*</url-pattern>

                            </servlet-mapping>

                             

                            <context-param>

                            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                            <param-value>.xhtml</param-value>

                            </context-param>

                             

                            <context-param>

                            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                            <param-value>.jsp</param-value>

                            </context-param>

                             

                             

                            <session-config>

                            <session-timeout>30</session-timeout>

                            </session-config>

                            <welcome-file-list>

                            <welcome-file>faces/Login.xhtml</welcome-file>

                            </welcome-file-list>

                            <context-param>

                            <param-name>org.richfaces.SKIN</param-name>

                            <param-value>darkX</param-value>

                            </context-param>

                             

                            <context-param>

                            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

                            <param-value>server</param-value>

                            </context-param>

                            <context-param>

                            <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>

                            <param-value>true</param-value>

                            </context-param>

                             

                            <context-param>

                            <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

                            <param-value>com.sun.facelets.FaceletViewHandler</param-value>

                            </context-param>

                            </web-app>

                             

                             

                            The only thing I don't have is in faces_config.xml and if I add it it indicates it can't find it

                             

                             

                            "Cannot find fully qualified class: com.sun.facelets.FaceletViewHandler"

                             

                                     <application>

                                <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

                              </application>

                             

                            The xhtml page itself contains the following, but it still won't render the RichFaces components.  This is becoming very frustrating.

                             

                            I am using some templates of sort


                            Login.xhtml
                            ===========

                            <?xml version="1.0" encoding="ISO-8859-1" ?> 
                            <!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:h="http://java.sun.com/jsf/html"   
                              xmlns:f="http://java.sun.com/jsf/core"   
                              xmlns:ui="http://java.sun.com/jsf/facelets"   
                              xmlns:a4j="http://richfaces.org/a4j"   
                              xmlns:rich="http://richfaces.org/rich">
                             
                              <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />  
                               <title>Example</title>
                              </head>
                             
                              <h:body>
                               <f:view>    
                                <h:form>

                                 <div id="header">
                                     <ui:insert name="header">
                                         <ui:include src="/Header.xhtml"/>
                                     </ui:insert>
                                 </div>
                                
                                 <div id="content">
                                     <ui:insert name="content">
                                      <ui:include src="/LoginContent.xhtml"/>
                                     </ui:insert>
                                
                                 </div>
                                
                                 <div id="footer">
                                     <ui:insert name="footer">
                                         <ui:include src="Footer.xhtml"/>
                                     </ui:insert>
                                 </div>
                                </h:form>
                               </f:view>
                              </h:body>
                            </html>

                             

                            Header.xhtml
                            ============

                            <?xml version="1.0" encoding="ISO-8859-1" ?>
                            <!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:h="http://java.sun.com/jsf/html"   
                              xmlns:f="http://java.sun.com/jsf/core"   
                              xmlns:ui="http://java.sun.com/jsf/facelets"   
                              xmlns:a4j="http://richfaces.org/a4j"   
                              xmlns:rich="http://richfaces.org/rich">
                            <h:body>
                            <div style="width:100%;font-size:36px;line-height:48px;background-color:navy;color:white">My Facelet Application Header</div>
                            </h:body>
                            </html>


                            LoginContent.xhtml
                            ===============

                            <?xml version="1.0" encoding="ISO-8859-1" ?> 
                            <!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:h="http://java.sun.com/jsf/html"   
                              xmlns:f="http://java.sun.com/jsf/core"   
                              xmlns:ui="http://java.sun.com/jsf/facelets"   
                              xmlns:a4j="http://richfaces.org/a4j"   
                              xmlns:rich="http://richfaces.org/rich">
                             
                              <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />  
                               <title>Example</title>
                              </head>
                             
                              <h:body>
                               <f:subview id="hello">    
                                <h:form>

                                 <p>In the next example you can manually enter values, and any invalid entries are not allowed.</p>          
                                
                                 <rich:panel style="width:220px;">            
                                  <f:facet name="header">                
                                   <h:outputText value="Select with manual input"></h:outputText>            
                                  </f:facet>
                                 
                                                
                                   
                                  <rich:select  enableManualInput="true"               
                                      defaultLabel="start typing for select">                
                                    <f:selectItem itemValue="Alex" itemLabel="Alex" />                
                                    <f:selectItem itemValue="Bob" itemLabel="Bob" />                
                                    <f:selectItem itemValue="Carl" itemLabel="Carl" />                
                                    <f:selectItem itemValue="Daniel" itemLabel="Daniel" />                
                                    <f:selectItem itemValue="Elvis" itemLabel="Elvis" />             
                                  </rich:select>        
                                  </rich:panel>
                                </h:form>
                               </f:subview>     
                              </h:body>
                            </html>

                             

                            Footer.xhtml
                            =================

                            <?xml version="1.0" encoding="ISO-8859-1" ?>
                            <!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:h="http://java.sun.com/jsf/html"   
                              xmlns:f="http://java.sun.com/jsf/core"   
                              xmlns:ui="http://java.sun.com/jsf/facelets"   
                              xmlns:a4j="http://richfaces.org/a4j"   
                              xmlns:rich="http://richfaces.org/rich">
                            <h:head>
                            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
                            <title>Footer</title>
                            </h:head>
                            <h:body>
                            <div style="background-color:navy;width:100%;color:white">This is our footer</div>
                            </h:body>
                            </html>

                             

                             

                             

                             

                             

                            I have read that using JSF2.0 <f:view> is not manditory.

                             

                            Is there anything else in my configuration that could be wrong?

                             

                            Also checked the following link, and I have removed VIEW_HANDLERS and I guess com.sun.facelets.FaceletViewHandler is not required in faces-config.xml either as a result of the migration steps

                             

                            http://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-Upgrading