2 Replies Latest reply on Jul 25, 2012 10:05 AM by Rui Albuquerque

    Converter for list within list

    Rui Albuquerque Newbie

      Hi. So i'm using rich:pickList, and i want to aces a list within an object wich in a list in my bean. (just to be clear bean: has list of objects asr. asr: has list of objects card)

       

      And i want to be able to acces one of the lists within the list my source list.

       

      Anyone know how to do that(the getAsObject method?

       

      My current method is:     

       

      public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {

       

           ASR5k asr = getUpperTrayBean(arg0).asrSingle;

       

           for (Cards card : asrSingle.getCards()){

                 if (card.getSlot().equals(arg2)) {

                         return card;          

                }

            }

           return null;

      }

        • 1. Re: Converter for list within list
          Rui Albuquerque Newbie

          Also, asrSingle is an instance of the object that contains the card list. It was previously selected.

           

           

          By the way, the error i'm getting is:

           

          java.lang.NullPointerException
          at pt.ptinovacao.hardware.temperature.CardsConverter.getAsObject(Unknown Source)
          at org.richfaces.renderkit.SelectManyHelper.getConvertedValue(SelectManyHelper.java:324)
          at org.richfaces.renderkit.SelectManyRendererBase.getConvertedValue(SelectManyRendererBase.java:108)
          at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1030)
          at javax.faces.component.UIInput.validate(UIInput.java:960)
          at javax.faces.component.UIInput.executeValidate(UIInput.java:1233)
          at javax.faces.component.UIInput.processValidators(UIInput.java:698)
          at javax.faces.component.UIForm.processValidators(UIForm.java:253)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
          at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1172)
          at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
          at java.lang.Thread.run(Thread.java:722)

          • 2. Re: Converter for list within list
            Rui Albuquerque Newbie

            Went arround. Problem Solved.