Topic
7 replies Latest Post - ‏2013-01-28T15:49:38Z by paoloc
paoloc
paoloc
520 Posts
ACCEPTED ANSWER

Pinned topic Typeahead no longer usable

‏2013-01-11T09:04:42Z |
After ondblclick (or onclick or onchange or .. any other function on Quick Edit) in an typeahead field the program spops with the error:

(application.StateManagerImpl 199 ) ID duplicate component 'form1:tableEx6:_id8' find in view.
11-gen-2013 9.53.47 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
Throwable occurred: java.lang.IllegalStateException: ID componente duplicato 'form1:tableEx6:_id8' trovato nella vista.
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:201)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
at com.sun.faces.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:97)
at com.ibm.faces.application.DevelopmentStateManager.saveSerializedView(DevelopmentStateManager.java:33)
at com.ibm.faces.renderkit.html_extended.ScriptCollectorRenderer.handleStateAjax(ScriptCollectorRenderer.java:365)
at com.ibm.faces.renderkit.html_extended.ScriptCollectorRenderer.encodeEnd(ScriptCollectorRenderer.java:149)
at com.ibm.faces.renderkit.DefaultAjaxRenderer.encodeEnd(DefaultAjaxRenderer.java:83)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:645)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:568)
at com.ibm.faces.taglib.html_extended.ScriptCollectorTag.doEndTag(ScriptCollectorTag.java:128)
at org.apache.jsp.spazioDiLavoro3_jsp._jspx_meth_hx_005fscriptCollector_005f0(spazioDiLavoro3_jsp.java:866)
at org.apache.jsp.spazioDiLavoro3_jsp._jspx_meth_f_005fview_005f0(spazioDiLavoro3_jsp.java:800)
at org.apache.jsp.spazioDiLavoro3_jsp._jspService(spazioDiLavoro3_jsp.java:756)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.ibm.faces.context.AjaxExternalContext.dispatch(AjaxExternalContext.java:129)
at com.ibm.faces.context.AjaxExternalContext.dispatch(AjaxExternalContext.java:109)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:736)

All page elements are created with drag and drop from Enhanced Faces Components.
Any idea?
paoloc
Updated on 2013-01-28T15:49:38Z at 2013-01-28T15:49:38Z by paoloc
  • SystemAdmin
    SystemAdmin
    6195 Posts
    ACCEPTED ANSWER

    Re: Typeahead no longer usable

    ‏2013-01-11T13:27:11Z  in response to paoloc
    In my experience, duplicate component ids are tricky and they are related to different lifecycles of JSP and JSF. You are probably using JSF 1.1 and while the co-existence of JSP and JSF has been improved in JSF 1.2, it won't help you in solving the issue. Also, judging by the name of the duplicate component form1:tableEx6:_id8 it is a component for which the id has been generated automatically to a dynamically created component; hence, entering an id manually might not be possible.

    We have been able to resolve issues of this kind by finding the component causing the issue and enclosing it in an <hx:jspPanel> component, but those issues were not related to AJAX.

    As a side note, we ended up using jQuery for typeahead as we found it more customisable than the default typeahead component.
    • paoloc
      paoloc
      520 Posts
      ACCEPTED ANSWER

      Re: Typeahead no longer usable

      ‏2013-01-11T14:47:02Z  in response to SystemAdmin
      Thanks TuukkaIlomäki!
      Here the inserted istructions:

      <td><h:panelGroup styleClass="panelGroup"id="group4">
      <h:inputText styleClass="inputText" id="text84" value="#{spazioDiLavoro3.cercaUtente}" binding="#{spazioDiLavoro3.cercaUtente_Ref}">
      <hx:inputHelperTypeahead id="typeahead1" styleClass="inputText_Typeahead"
      value="#{spazioDiLavoro3._typeaheadMapper}"></hx:inputHelperTypeahead>
      <hx:behavior event="onchange" id="behavior11" behaviorAction="get" targetAction="listaScaffali" onActionFunction="return func_78(this, event);"></hx:behavior>
      </h:inputText>
      </h:panelGroup></td>

      And this is the content of func_78 (that calls an AJAX request):

      function func_78(thisObj, thisEvent) {
      //use 'thisObj' to refer directly to this component instead of keyword 'this'
      //use 'thisEvent' to refer to the event generated instead of keyword 'event'
      document.getElementById("form1:campocodiceutente1").value=jQuery(thisObj).val();
      document.getElementById("form1:ajaxTypeReq").value='caricaCartelle';
      }
      but the same problem persist!

      paoloc
    • paoloc
      paoloc
      520 Posts
      ACCEPTED ANSWER

      Re: Typeahead no longer usable

      ‏2013-01-11T15:00:48Z  in response to SystemAdmin
      I changed
      <td><h:panelGroup styleClass="panelGroup"id="group4">
      <h:inputText styleClass="inputText" id="text84" value="#{spazioDiLavoro3.cercaUtente}" binding="#{spazioDiLavoro3.cercaUtente_Ref}">
      <hx:inputHelperTypeahead id="typeahead1" styleClass="inputText_Typeahead"
      value="#{spazioDiLavoro3._typeaheadMapper}"></hx:inputHelperTypeahead>
      <hx:behavior event="onchange" id="behavior11" behaviorAction="get" targetAction="listaScaffali" onActionFunction="return func_78(this, event);"></hx:behavior>
      </h:inputText>
      </h:panelGroup></td>

      with:

      <td><hx:jspPanel id="jspPanel1">
      <h:inputText styleClass="inputText" id="text84" value="#{spazioDiLavoro3.cercaUtente}" binding="#{spazioDiLavoro3.cercaUtente_Ref}">
      <hx:inputHelperTypeahead id="typeahead1" styleClass="inputText_Typeahead"
      value="#{spazioDiLavoro3._typeaheadMapper}"></hx:inputHelperTypeahead>
      <hx:behavior event="onchange" id="behavior11" behaviorAction="get"
      targetAction="listaScaffali" onActionFunction="return func_79(this, event);"></hx:behavior>
      </h:inputText>
      </hx:jspPanel></td>

      func_79 is the same as func_78

      but with same result

      paoloc
      • SystemAdmin
        SystemAdmin
        6195 Posts
        ACCEPTED ANSWER

        Re: Typeahead no longer usable

        ‏2013-01-14T06:51:15Z  in response to paoloc
        I cannot spot an error in the code you pasted. You might try having the hx:jspPanel tag a little higher in the component tree, but not seeing the full page code it is difficult to say anything more specific.

        One possibility is that html and jsf tags are mixed inappropriately. In order to debug that, I would try creating a minimal page (by deleting code) that still shows the defect and then examine how the tags are nested (and, if they are correct, then open a PMR).
  • SystemAdmin
    SystemAdmin
    6195 Posts
    ACCEPTED ANSWER

    Re: Typeahead no longer usable

    ‏2013-01-15T09:15:10Z  in response to paoloc
    Hi paoloc,

    Which version of RBD are you using?
    I would appreciate it if you can provide a small completed sample, so that we can recreate it and then look into it deeply.
    • paoloc
      paoloc
      520 Posts
      ACCEPTED ANSWER

      Re: Typeahead no longer usable

      ‏2013-01-22T12:31:12Z  in response to SystemAdmin
      Hi Peng,
      I use RBD 8.5 (and 8.0)
      Hi Peng,
      the jsf that is in error is very complex.
      I can send You the jsf for now perhaps you can understand the nature of the error
      in the same jsf is the error:
      In the Image01 you can se this error on the top.
      I have clicked the button "Cancella selezionati".
      In the same submenu I have the link to call the same function and this works well.
      The error "Errore di conversione" means "Error in conversion" and i cannot find any message in console.
      For the Typeahead no longer usable see Image02.
      The are a typeahead filed showing two users.When I dblclick on the selected user see image03 whth the error "duplicate component form1:_id23".This fied was created with drag and drop from the Palette.
      I send both jsp and egl to You.
      paoloc
    • paoloc
      paoloc
      520 Posts
      ACCEPTED ANSWER

      Re: Typeahead no longer usable

      ‏2013-01-28T15:49:38Z  in response to SystemAdmin
      Hi Peng,
      any update to this problem?
      paoloc