2 Replies Latest reply: Jul 5, 2013 10:58 AM by Tshifhiwa RSS

    geting npe when autoSuggest in iputtext

    Tshifhiwa

      hi am having NPE WHEN DOING :autoSuggest IN INPUTTEXT

      am in jdeveloper

      this is how i did my autosuggest

      <af:inputText value="#{bindings.Province1.inputValue}"

                                  label="#{bindings.Province1.hints.label}"

                                  required="#{bindings.Province1.hints.mandatory}"

                                  columns="20"

                                  maximumLength="#{bindings.Province1.hints.precision}"

                                  shortDesc="#{bindings.Province1.hints.tooltip}"

                                  id="it17">

                      <f:validator binding="#{bindings.Province1.validator}"/>

                      <af:autoSuggestBehavior suggestedItems="#{pageFlowScope.addressbean.onProvienceSuggestupd}"/>

                    </af:inputText>

       

      public List onProvienceSuggestupd(String searchProvienceName) {
      ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
      searchProvienceName = searchProvienceName.toUpperCase();
      System.out.println(searchProvienceName);
      //get access to the binding context and binding container at runtime
      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      //set the bind variable value that is used to filter the View Object
      //query of the suggest list. The View Object instance has a View
      //Criteria assigned
      OperationBinding setVariable = (OperationBinding) bindings.get("setBind_provience");
      setVariable.getParamsMap().put("value", searchProvienceName);
      setVariable.execute();
      //the data in the suggest list is queried by a tree binding.
      JUCtrlHierBinding hierBinding = (JUCtrlHierBinding) bindings.get("ProvinceViewVO1");

       

       

      //re-query the list based on the new bind variable values
      hierBinding.executeQuery();

       

      //The rangeSet, the list of queries entries, is of type
      //JUCtrlValueBndingRef.
      List<JUCtrlValueBindingRef> displayDataList = hierBinding.getRangeSet();

       

      for (JUCtrlValueBindingRef displayData : displayDataList){
      Row rw = displayData.getRow();
      //populate the SelectItem list
      selectItems.add(new SelectItem(
      (String)rw.getAttribute("Provincename"),
      (String)rw.getAttribute("Provincename"),
      (String)rw.getAttribute("Provincecode"))
      //
      );
      }

       

      return selectItems;

      }

       

      am geting error in this line

      hierBinding.executeQuery();

       

      javax.el.ELException: java.lang.NullPointerException

          at com.sun.el.parser.AstValue.invoke(Unknown Source)

          at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)

          at oracle.adfinternal.view.faces.el.InternalELObject.autoSuggest(InternalELObject.java:173)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at com.sun.el.parser.AstValue.invoke(Unknown Source)

          at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)

          at oracle.adf.view.rich.event.ClientListenerSet.invokeCustomEventListeners(ClientListenerSet.java:176)

          at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$DeliverClientEvent.invokeContextCallback(LifecycleImpl.java:1621)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1410)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:1380)

          at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:555)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1330)

          at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1424)

          at oracle.adf.view.rich.component.rich.RichDocument.invokeOnComponent(RichDocument.java:168)

          at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)

          at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)

          at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeCustomEvents(LifecycleImpl.java:582)

          at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:456)

          at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

          at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)

          at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

          at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)

          at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)

          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)

          at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)

          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)

          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)

          at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)

          at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)

          at java.security.AccessController.doPrivileged(Native Method)

          at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)

          at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)

          at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)

          at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)

          at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)

          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)

          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

          at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)

          at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)

          at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)

          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

          at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

      Caused by: java.lang.NullPointerException

          at AddressBean.onProvienceSuggestupd(AddressBean.java:371)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          ... 76 more