10 Replies Latest reply on Jan 21, 2013 12:42 PM by JerryJacobs

    how to create inputtext cascanding LOV

    JerryJacobs
      hi how can one refresh cascanding lov my use case is i have <af:selectOneChoice which list the name of provience and i have <af:inputText which list city using <af:autoSuggestBehavior base on the provience i selected and i have subub in <af:inputText listing surbub using <af:autoSuggestBehavior it list based on the city i have select ,at the moment when i select provience and go to city it list only one value in the list but if i type 2 letters of exisisting cityit list, even if there is more than one values in database,the subub also list the same values ,and another thing is if i change the selection of provience and go and select another province and what to select another city and anothe subub it list the previous city name and previous suburb name it does not change according to new provience selection.the first city i choose when the page load its the only one displaying all the time,even if i restart the application,my problem is my <af:inputText does not list more than one values it always list one value if is city it only list one city if its subub it only list one subub,how can i refresh two inputtext so it can display values according to currently provience selected lov and display all values not only the first one selected .am in jdeveloper 11.1.1.6.0

      Here's the scenario

      1. i have 3 views witch are ProvienceVO,CityVo,SububVo they where created from theire entity
      2. ProvienceVO it list the provience name
      3. CityVo it list cityname and citycode,it got view criteria which got cityname and provience they all use operator start with,i did not use parameter in the query,i only use parameter in my view criteria
      4. i got sububVO it list subub name it releate to cityvo using citycode,i also have view criteria which pass parameter subub and use operator startwith
      5.in my application module i got two method which list the two views cityvo,subub based on the provience selected
      6 in my bean class i got a method which listen which city,subub is selected it also pass the currently selected provience to city
      7. I have wired all the LOVs correctly and it is working properly in ADF BC tester.

      for example where it does not work
      1 select provience in the list,but when i go to my inputtext it does not list values according to first lov selection.
      2 select provience in the first list, but when i what to make selection in second lov i only get one values even if there is more values from database,this happen in city lov
      3. select provience in the first list,select city,but when i come to select subub inputtext it only list one values it does not change even if i try to search other surbub it always return same surbubname value
      4.if i type n in the inputtext it does not list available name Which start with n e.g for new york it only find new york if i type new than it will display new york ,after i type atleast 3 letters

      Here's the code snippet of jspx:
      <td width="53%" height="26">
                            <af:selectOneChoice
                                                label="#{bindings.ProvinceViewVO1.label}"
                                                required="#{bindings.ProvinceViewVO1.hints.mandatory}"
                                                shortDesc="#{bindings.ProvinceViewVO1.hints.tooltip}"
                                                id="soc4" simple="true"
                                                value="#{pageFlowScope.orgDetailsBean.addressBean.province}"
                                                autoSubmit="true">
                              
                                             
                                              <af:forEach items="#{bindings.ProvinceViewVO1.iteratorBinding.allRowsInRange}"
                                        var="row">
                              <af:selectItem id="tipltco2" label="#{row.provincename}"
                                             value="#{row.provincecode}"/>
                            </af:forEach>
                            </af:selectOneChoice>
                          </td>
                        </tr><tr>
                          <td width="47%" height="19">
                            <af:outputLabel value="City" id="ol11"
                                            showRequired="true"/>
                          </td>
                          <td width="53%" height="19">
                           
                              <af:inputText label="#{bindings.Cityname.hints.label}" columns="20"
                                              maximumLength="#{bindings.Cityname.hints.precision}"
                                              shortDesc="#{bindings.Cityname.hints.tooltip}"
                                              id="itc4" simple="true"
                                            value="#{pageFlowScope.orgDetailsBean.addressBean.city}"
                                            partialTriggers="soc4"
                                            valueChangeListener="#{pageFlowScope.addressbean.subValue}"
                                            autoSubmit="true">
                                  <af:autoSuggestBehavior suggestedItems="#{pageFlowScope.addressbean.getSuggestedCities}"/>
                            </af:inputText>
                          </td>
                        </tr><tr>
                          <td width="47%">
                            <af:outputLabel value="Suburb" id="ol14"
                                            showRequired="true"/>
                          </td>
                          <td width="53%">
                             <af:inputText label="#{bindings.Suburb.hints.label}" columns="20"
                                              maximumLength="#{bindings.Suburb.hints.precision}"
                                              shortDesc="#{bindings.Suburb.hints.tooltip}"
                                              id="itcs4" simple="true"
                                           value="#{pageFlowScope.orgDetailsBean.addressBean.suburb}"
                                           valueChangeListener="#{pageFlowScope.addressbean.sububValue}"
                                           partialTriggers="itc4" autoSubmit="true">
                                  <af:autoSuggestBehavior suggestedItems="#{pageFlowScope.addressbean.getSuggestedsbub}"/>
                                </af:inputText>
                          </td>
      I hope I have explained this well. If it's not clear please let me know.
      Has anyone come across this scenario or know how to resolve this
      Edited by: adf0994 on 2013/01/17 2:56 PM

      Edited by: adf0994 on 2013/01/17 3:12 PM

      Edited by: adf0994 on 2013/01/17 3:20 PM

      Edited by: adf0994 on 2013/01/17 3:38 PM

      Edited by: adf0994 on 2013/01/17 3:48 PM
        • 1. Re: how to create inputtext cascanding LOV
          Arunkumar Ramamoorthy-Oracle
          Hi,

          See if this helps : https://blogs.oracle.com/aramamoo/entry/how_to_create_cascading_depending

          -Arun
          • 2. Re: how to create inputtext cascanding LOV
            JerryJacobs
            hi when i do my <af:autoSuggestBehavior am geting this error
            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 oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:194)
                 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 oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:147)
                 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.oncitySuggest(AddressBean.java:357)
                 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)
                 ... 78 more
            
            the error is in this line     
            //re-query the list based on the new bind variable values
                hierBinding.executeQuery();
            am using the above sample
            
            this is the method am geting error
               public List onProvienceSuggest(String searchProvienceName) {
               ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
            
               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("ProvinceViewVO");
            
            
               //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("Provincecode"),
               (String)rw.getAttribute("Provincename")));
               }
            Edited by: adf009 on 2013/01/21 12:12 PM

            Edited by: adf009 on 2013/01/21 12:18 PM

            Edited by: adf009 on 2013/01/21 12:45 PM
            • 3. Re: how to create inputtext cascanding LOV
              Arunkumar Ramamoorthy-Oracle
              Hi,

              Make sure the tree binding name you've given is valid
              JUCtrlHierBinding hierBinding = (JUCtrlHierBinding) bindings.get("CountryView1");
              -Arun
              • 4. Re: how to create inputtext cascanding LOV
                JerryJacobs
                ok now am geting this error
                javax.el.ELException: java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding
                     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 oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:194)
                     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 oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:147)
                     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.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding
                     at onProvienceSuggest(AddressBean.java:319)
                     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)
                     ... 78 more
                 in this line  JUCtrlHierBinding hierBinding = (JUCtrlHierBinding) bindings.get("ProvinceViewVO1");
                Edited by: adf009 on 2013/01/21 12:50 PM

                Edited by: adf009 on 2013/01/21 12:50 PM
                • 5. Re: how to create inputtext cascanding LOV
                  Arunkumar Ramamoorthy-Oracle
                  User,

                  The exception stack clearly mentions that you cannot cast a list binding to a tree binding.
                  javax.el.ELException: java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding
                  Make sure the binding you have ("ProvinceViewVO1") is a tree binding and not a list binding

                  -Arun
                  • 6. Re: how to create inputtext cascanding LOV
                    JerryJacobs
                    this is my method which binding are you talking about
                    <af:inputText value="#{pageFlowScope.orgDetailsBean.addressBean.province}"
                                                                             simple="true"
                                                                             required="#{bindings.Provincename.hints.mandatory}"
                                                                             columns="20"
                                                                             maximumLength="#{bindings.Provincename.hints.precision}"
                                                                             shortDesc="#{bindings.Provincename.hints.tooltip}"
                                                                             id="it19">
                                            <f:validator binding="#{bindings.Provincename.validator}"/>
                                            <af:autoSuggestBehavior suggestedItems="#{pageFlowScope.addressbean.onProvienceSuggest}"/>
                                          </af:inputText>
                    
                       public List onProvienceSuggest(String searchProvienceName) {
                       ArrayList<SelectItem> selectItems = new ArrayList<SelectItem>();
                    
                       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("Provincecode"),
                       (String)rw.getAttribute("Provincename")));
                       }
                    
                       return selectItems;
                       }
                    
                    and this is how the view define in my model
                    <ViewUsage
                        Name="ProvinceViewVO1"
                        ViewObjectName="model.lov.views.ProvinceViewVO">
                        <ViewCriteriaUsage
                          Name="ProvinceViewVOCriteria"
                          FullName="model.lov.views.ProvinceViewVO.ProvinceViewVOCriteria"/>
                      </ViewUsage>
                    
                    where do i check which binding i have used
                    Edited by: adf009 on 2013/01/21 1:14 PM

                    Edited by: adf009 on 2013/01/21 1:15 PM

                    Edited by: adf009 on 2013/01/21 1:16 PM
                    • 7. Re: how to create inputtext cascanding LOV
                      Arunkumar Ramamoorthy-Oracle
                      In your pagedef, check if "ProvinceViewVO1" is a tree binding or list binding. You need to use tree binding.
                      • 8. Re: how to create inputtext cascanding LOV
                        JerryJacobs
                        ok now i can list my provience but when i select the value it return provicecode not provience name it does list provicename but but when i select it show provincecode in inputtext .but when i select city list am geting this error
                        Caused by: java.lang.NullPointerException
                             atoncitySuggest(AddressBean.java:363)
                             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)
                        
                        which is on line 
                         for (JUCtrlValueBindingRef displayData : displayDataList){
                        
                        and i also see this in my log error
                        DCBindingContainer> <cacheException> [2708] * * * BindingContainer caching EXCEPTION:oracle.jbo.JboException
                        <DCBindingContainer> <cacheException> [2709] groovy.lang.MissingMethodException: No signature of method: AppModuleImpl.getCurrentProvienceId() is applicable for argument types: () values: []
                             at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
                             at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
                             at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
                             at bc4j.provience.gs.run(bc4j.provience.gs.groovy:1)
                             at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:1380)
                             at oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1448)
                             at oracle.jbo.ExprEval.evaluate(ExprEval.java:1191)
                             at oracle.jbo.ExprEval.evaluate(ExprEval.java:1168)
                             at oracle.jbo.common.VariableImpl.evaluateTransientExpression(VariableImpl.java:1687)
                             at oracle.jbo.common.VariableValueManagerImpl.accessValue(VariableValueManagerImpl.java:152)
                             at oracle.jbo.common.VariableManagerImpl.getValueRaw(VariableManagerImpl.java:508)
                             at oracle.jbo.common.VariableValueManagerImpl.getVariableValueRaw(VariableValueManagerImpl.java:254)
                             at oracle.jbo.server.ViewRowSetImpl.getWhereClauseParamsFromVars(ViewRowSetImpl.java:4699)
                             at oracle.jbo.server.ViewRowSetImpl.getParameters(ViewRowSetImpl.java:6375)
                             at oracle.jbo.server.ViewRowSetImpl.getRowFilter(ViewRowSetImpl.java:629)
                             at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1111)
                             at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1060)
                             at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2810)
                             at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2787)
                             at oracle.jbo.server.ViewRowSetIteratorImpl.getAllRowsInRangeInternal(ViewRowSetIteratorImpl.java:2173)
                             at oracle.jbo.server.ViewRowSetIteratorImpl.getAllRowsInRange(ViewRowSetIteratorImpl.java:2220)
                             at oracle.jbo.server.ViewRowSetImpl.getAllRowsInRange(ViewRowSetImpl.java:3062)
                             at oracle.jbo.server.ViewObjectImpl.getAllRowsInRange(ViewObjectImpl.java:11202)
                             at oracle.adf.model.binding.DCIteratorBinding.getAllRowsInRange(DCIteratorBinding.java:2345)
                             at oracle.adf.model.binding.DCControlBinding.getAllRowsInRange(DCControlBinding.java:446)
                             at oracle.jbo.uicli.binding.JUCtrlRangeBinding.getRangeSet(JUCtrlRangeBinding.java:300)
                             at uam.cadastre.gov.za.AddressBean.oncitySuggest(AddressBean.java:361)
                             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.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 oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:194)
                             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 oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:147)
                             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)
                        but i have added <Method
                              Name="getCurrentcitycode">
                              <Return
                                Type="java.lang.String"/>
                            </Method> in my client interface
                        <Method
                              Name="getCurrentProvienceCode">
                              <Return
                                Type="java.lang.String"/>
                            </Method>
                        
                        and this is my added view in AM 
                        <ViewUsage
                            Name="CityViewLOV1"
                            ViewObjectName="model.lov.views.CityViewLOV">
                            <ViewCriteriaUsage
                              Name="CityViewLOVCriteria"
                              FullName="lov.views.CityViewLOV.CityViewLOVCriteria"/>
                            <ParameterMap>
                              <PIMap Variable="provience">
                                <TransientExpression><![CDATA[adf.object.applicationModule.getCurrentProvienceId()]]></TransientExpression>
                              </PIMap>
                            </ParameterMap>
                          </ViewUsage>
                        Edited by: adf009 on 2013/01/21 2:20 PM

                        Edited by: adf009 on 2013/01/21 2:21 PM
                        • 9. Re: how to create inputtext cascanding LOV
                          Arunkumar Ramamoorthy-Oracle
                          User,

                          I would recommend you to run your application in debug mode, set the breakpoints in the code to check what is happening.

                          -Arun

                          Hint : Exception shows the method name as AppModuleImpl.getCurrentProvienceId(), but looks like your AM has a method with the name getCurrentProvienceCode
                          • 10. Re: how to create inputtext cascanding LOV
                            JerryJacobs
                            sorry my mistake suppose to use getCurrentProvienceCode,hi thanks is working now,is it possile to do the same using <af:selectOneChoice and <af:inputText autosuggestand. how can i store proviencecode in database instead of proviencename but displaying proviencename in lov
                            the below code dispaly provincecode but when i select it return proviencename,and store empty value in databse
                               public List onProvienceSuggest(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("Provincecode")));
                               }
                            
                            if i use code below
                               for (JUCtrlValueBindingRef displayData : displayDataList){
                               Row rw = displayData.getRow();
                               //populate the SelectItem list
                               selectItems.add(new SelectItem(   
                               (String)rw.getAttribute("Provincecode"),
                               (String)rw.getAttribute("Provincename")));
                               }
                            
                            it display proviencename but it return proviencecode in inpuutext,which i don't what ,i that to return proviencename but save  proviencecode in database
                            Edited by: adf009 on 2013/01/21 3:22 PM

                            Edited by: adf009 on 2013/01/21 3:23 PM

                            Edited by: adf009 on 2013/01/21 3:34 PM

                            Edited by: adf009 on 2013/01/21 3:41 PM