10 Replies Latest reply on Apr 16, 2007 6:46 AM by Pete Muir

    <h:selectManyListbox>  Creating problem

    Mahesh Shinde Newbie

      Hi

      I used <h:selectManyListbox> in the JSF and I am able to see list of groups in the list box. But when I select one or more than one groups I am not able to get those values in the seam - Ejbs Action class.

      E.g JSF Code

      <h:selectManyListbox value="#{register.gruppen}" id="gruppen">
      <si:selectItems value="#{groupValues}" var="groups" label="#{groups.name}" config="#{mySelectItemsConfig}" />
      <si:convertEntity entityClass="de.bonprix.vip20.model.entity.Gruppe"/>
      </h:selectManyListbox>

      E.g EJb Code to get values of selected group.

      @In(required = false)
      @Out(required = false)
      private List gruppen;

      .... setter and getter method.

      I am tried by giving String[] instead of List also.

      when I submit the page I am getting gruppen null.

      Please Suggest!.

        • 1. Re: <h:selectManyListbox>  Creating problem
          Pete Muir Master

          You should use the s:selectItems and s:convertEntity in Seam 1.2.1

          • 2. Re: <h:selectManyListbox>  Creating problem
            sdf Newbie

            i'm ussing s:selectItems and s:convertEntity with seam 1.2.1
            i get a list of entities converted perfectly but the selected entity does get not into the context or anything, is there anything else i'm missing.
            by the way i'm also using facelets, ajax4fs and richfaces.

            mi bean looks like this

            @Name("typeHome")
            @Stateful
            @PerNestedConversation
            public class TypeHome extends EntityHome<Type> implements TypeHomeInterface {
            
             @In(required = false)
             @Out(required = false)
             private Type type;


            and mi xhtml:



            <h:selectOneMenu value="#{type.group}" >
             <s:selectItems value="#{groups}" var="group" label="#{group.name}" noSelectionLabel="Please Select..."/>
             <s:convertEntity />
             </h:selectOneMenu>




            • 3. Re: <h:selectManyListbox>  Creating problem
              Pete Muir Master

              Make sure you have an h:messages component on the page to give you any JSF errors that occur

              • 4. Re: <h:selectManyListbox>  Creating problem
                Lee Hualiang Newbie

                 

                Make sure you have an h:messages component on the page to give you any JSF errors that occur

                I cannot get nothing also ,and the ejb action which bound to command button cannot be exeuted.I have an h:messages component on the page to give my any JSF errors that occur,but no any message showed ! if I remove h:selectOneMenu component , then I could get other info on the page!

                • 5. Re: <h:selectManyListbox>  Creating problem
                  Mahesh Shinde Newbie

                  Hi Petemuir,

                  Thank you for Immediate reply. I did what you said but I am getting exception like...
                  No tag "convertEntity" defined in tag library imported with prefix "s"
                  And Now I am using Seam 1.2.1

                  Do I need to take selectItem.jar and selectItems-ui.jar again. If I don't have correct version Please tell me...

                  Thanx in advance.


                  • 6. Re: <h:selectManyListbox>  Creating problem
                    Pete Muir Master

                    Post the stack trace

                    • 7. Re: <h:selectManyListbox>  Creating problem
                      Mahesh Shinde Newbie


                      Error:

                      17:57:58,928 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
                      javax.faces.FacesException: /editUsers.jsp(51,8) No tag "convertEntity" defined in tag library imported with prefix "s"
                      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:435)
                      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
                      at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
                      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                      at java.lang.Thread.run(Thread.java:595)
                      Caused by: org.apache.jasper.JasperException: /editUsers.jsp(51,8) No tag "convertEntity" defined in tag library imported with prefix "s"
                      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
                      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
                      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:196)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1317)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
                      at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
                      at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
                      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
                      at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
                      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
                      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
                      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
                      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
                      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
                      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
                      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
                      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
                      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
                      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
                      ... 23 more



                      EditUsers.jsp

                      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
                      <%@ page contentType="text/html;charset=windows-1252"%>
                      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
                      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
                      <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>

                      <f:view>


                      <meta http-equiv="Content-Type"
                      content="text/html; charset=windows-1252" />
                      assign


                      body {
                      background-color: #ffffff;
                      }
                      a:link { color: #003194; }



                      <h:form>
                      <h:panelGrid columns="1">
                      <h:panelGrid columns="1">
                      <h:outputLabel value="">
                      <f:verbatim>
                      <span lang="DE"
                      style='font-size:12.0pt;font-family: Arial;mso-fareast-font-family:"Times New Roman";mso-ansi-language:DE; mso-fareast-language:DE;mso-bidi-language:AR-SA'>
                      Benutzer anlegen/&auml;ndern
                      </f:verbatim>
                      </h:outputLabel>
                      </h:panelGrid>
                      <h:panelGrid columns="1">
                      <h:outputLabel value="Vorname" for="vorname" />
                      <h:inputText id="vorname" value="#{benutzer.vorname}" />
                      </h:panelGrid>
                      <h:panelGrid columns="1">
                      <f:verbatim>


                      <h:outputLabel value="Gruppen" for="gruppen" />
                      <h:selectManyListbox value="#{benutzer.gruppen}" id="gruppen">
                      <s:selectItems value="#{groupValues}" var="groups"
                      label="#{groups.name}" />
                      <s:convertEntity entityClass="de.bonprix.vip20.model.entity.Gruppe" />
                      </h:selectManyListbox>
                       
                       


                      </f:verbatim>
                      </h:panelGrid>
                      <h:panelGrid columns="2">
                      <h:commandButton value="Save" action="#{register.registerAction}" />
                      <h:commandButton value="commandButton2" />
                      </h:panelGrid>
                      </h:panelGrid>
                      </h:form>


                      </f:view>



                      • 8. Re: <h:selectManyListbox>  Creating problem
                        Pete Muir Master

                        Looks like the JSP tag for s:convertEntity is missing. Put an issue in JIRA to remind me to add it

                        • 9. Re: <h:selectManyListbox>  Creating problem
                          Mahesh Shinde Newbie

                          Hi petemuir,

                          Thank you for quick reply.

                          I have created Issue for s:convertEntity.

                          For time being will you please tell me which tag-class is being used for s:convertEnitity so that I will make changes in the taglib.tld locally thus I will start work. Then Once you upload new version I will take latest.

                          Thanx in advance.

                          • 10. Re: <h:selectManyListbox>  Creating problem
                            Pete Muir Master

                            The tag class doesn't exist. You need to create one add add to the tld.