1 Reply Latest reply on Sep 13, 2011 3:04 PM by Sascha Janz

    dynamic buttonIcon and Static Resource not found

    Sascha Janz Master

      i use richfaces 3.3.3

       

      i want to dynamically assing calender and combo box button icon, so i use a binding for this like

       

      <rich:comboBox buttonIcon="#{Page.imageurl}"

       

      where imageurl is an abosulte and valid url like

       

      http://192.166.100.50:8080/image/button1.jpg

       

      but the page does not render.

       

      instead i got an static resource not found exception.

       

      any hints what the problem is?

       

       

      i double checked the url, it's valid. if i use it only in browser url, i can see the image

        • 1. Re: dynamic buttonIcon and Static Resource not found
          Sascha Janz Master

          i tried to use a resourceresolver

           


          import java.net.MalformedURLException;
          import java.net.URL;

          import com.sun.facelets.impl.DefaultResourceResolver;
          import com.sun.facelets.impl.ResourceResolver;

          public class FileResourceResolver extends DefaultResourceResolver implements ResourceResolver
          {
              @Override
              public URL resolveUrl(String resource)
              {
               System.out.println("Resource= " + resource);
                  URL resourceUrl =null;
                      try {
              if (resource.startsWith("/Mandanten"))
              {
               return new URL("file", "",        "e:/Global" + resource);

              
              }
                else {
              resourceUrl = super.resolveUrl(resource);
                }
             } catch (MalformedURLException e) {

              e.printStackTrace();
             }
                  return resourceUrl;
              }
          }

           

           

          but this only works for xhtml

           

          any suggestions?