6 Replies Latest reply on Jul 2, 2009 2:51 PM by Ahmet temiz

    problem with creating  MediaOutput in javabean

    Ahmet temiz Novice

      hello

      I tried to create MediaOutput component in javabean, bu nothing was seen

      here is the code;


      MediaOutput myMedia = new MediaOutput ();

      String style = "width:600px ; height:450px ; border=1px";
      myMedia.setStyle(style);
      myMedia.setCacheable(false);
      myMedia.setId("foto2");

      ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();

      ELContext elContext = FacesContext.getCurrentInstance().getELContext();

      MethodExpression mediaMethodExpression = expressionFactory.createMethodExpression(elContext,
      "#{haritaBean1.drawFoto}",
      null,
      new Class[] {OutputStream.class,Object.class} );

      myMedia.setCreateContentExpression(mediaMethodExpression);
      myMedia.setCacheable(false);

      children.add(myMedia); // a PanelGrid component.

      how can I solve this problem ?

      regards