2 Replies Latest reply: May 13, 2013 4:02 AM by vinaykumar2 RSS

    passing lov index instead of actual value

    Tshifhiwa
      hi i have a situation where am passing value from lov to inputtext the problem is,when i make selection in lov and what to pass that value to another inputtext am geting lov index instead of actual value
      <af:selectOneChoice value="#{bindings.Branch.inputValue}"
                                    required="#{bindings.Branch.hints.mandatory}"
                                    shortDesc="#{bindings.Branch.hints.tooltip}"
                                    id="soc10"
                                    simple="true" autoSubmit="true"
                                    valueChangeListener="#{pageFlowScope.InternalUserBean.changeBrachListener}">
                  <f:selectItems value="#{bindings.Branch.items}" id="si15"/>
                </af:selectOneChoice>
      
          public void changeBrachListener(ValueChangeEvent valueChangeEvent) {
                  // get the binding container
                  BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                  // get an ADF attributevalue from the ADF page definitions
                  AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("Branchcode");
                  String user = (String)valueChangeEvent.getNewValue();
                  attr.setInputValue(user);
                  System.out.println("branch " +user) ;                             
                  // PPR refresh a jsf component
                  UIComponent ui = (UIComponent)valueChangeEvent.getSource();
                  AdfFacesContext.getCurrentInstance().addPartialTarget(ui.getParent());
              }
      
      am geting this error
      Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
           at view.InternalBean.changeBrachListener(InternalBean.java:961)
           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 org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
           ... 43 more
      <XmlErrorHandler> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
      javax.servlet.ServletException: java.lang.Integer cannot be cast to java.lang.String
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
           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.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: java.lang.Integer cannot be cast to java.lang.String
           at view.InternalBean.changeBrachListener(InternalBean.java:961)
           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 org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
           at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
           at org.apache.myfaces.trinidad.component.UIXEditableValue.broadcast(UIXEditableValue.java:214)
           at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:430)
           at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           ... 36 more
      
      because in this line   String user = (String)valueChangeEvent.getNewValue();
      am geting interger of lov index instead of actual value