Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JBoss Seam] - s:graphicImage problems with Sun JSF
 Impl

scott.stark@jboss.org

2007-06-14


I have few problems with seam's graphicImage component.
* NullPointerException due to getRenderType() != null
This is the encodeChildren method of UIComponentBase (Sun impl)

|   /**
|    * @throws NullPointerException {@(protected)}  
|    */
|   public void encodeChildren(FacesContext context) throws IOException {
|
|      if (context == null) {
|         throw new NullPointerException();
|      }
|      if (!isRendered()) {
|         return;
|      }
|      String rendererType = getRendererType();
|      if (rendererType != null) {
|         getRenderer(context).encodeChildren(context, this);
|      }
|
|   }
|
Here is the UIGraphicImage component :

|   @Override
|   protected Renderer getRenderer(FacesContext context)
|   {
|     return null;
|   }
|
But inherit a render type != null :

|   public HtmlGraphicImage() {
|      super();
|      setRendererType("javax.faces.Image");
|   }
|
My solution is easy : add a 0-arg constructor which disable the render type :

|   public UIGraphicImage() {
|    super();
|     setRendererType( null );
|   }
|
This is working now (I have the < img > tag in my page).

* Next problem : for some reason the DynamicImageResource doesnt get the same instance of DynamicImageStore, so the image is not found !
It's weird since the DynamicImageStore is a Session scope component.
=> I gave up at this point :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054355#4054355

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054355
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.