0 Replies Latest reply on Nov 20, 2007 9:20 AM by Marc Kuiper

    a4j:support restore problem

    Marc Kuiper Newbie

      Hello,

      I'm trying to use ajaxsupport to fire an event on onblur on input fields on a dynamically generated form. This works (the event goes off), but during the rendering phase of the reply I get an IllegalArgumentException. It's a -very- long stack trace, so I'll just post the most important bits:

      SEVERE: Error Rendering View[/pages/mainPage_sligro.xhtml]
      javax.faces.FacesException: javax.el.ELException: java.lang.IllegalArgumentException: null
       at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1536)
       at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:453)
       at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:405)
       at com.sun.faces.renderkit.html_basic.TextRenderer.getEndTextToRender(TextRenderer.java:144)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:220)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:847)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:893)
       at com.tsf.client.components.form.TSFFormField.encodeAll(TSFFormField.java:72)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
      ......
      Caused by: javax.el.ELException: java.lang.IllegalArgumentException: null
       at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:73)
       at javax.faces.component.html.HtmlInputText.getOnblur(HtmlInputText.java:310)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1528)
       ... 104 more
      Caused by: java.lang.IllegalArgumentException: null
       at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:620)
       at org.ajax4jsf.component.EventValueBinding.getComponent(EventValueBinding.java:103)
       at org.ajax4jsf.component.EventValueBinding.getValue(EventValueBinding.java:91)
       at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:70)
       ... 110 more


      I think the problem is caused by the ajaxsupport component not being restored correctly. I tried debugging the saveState and restoreState of the parent component which showed me that on saveState the onBlur attribute is filled, but on restoreState it's become null. However, the ajaxsupport component is present (and is the same instance as the one in the savestate during the previous request).

      I'm hoping someone here might have some insight on what the problem might be. All of the JSF/RichFaces documentation I've found online so far don't include any java code for dynamically creating a component tree, so I've been trying to mimick the XML examples blindly. Maybe it's possible I'm missing something important there?

      Thanks for your help,

      Marc