0 Replies Latest reply on Feb 23, 2010 1:29 PM by poschd

    Request parameters are null in seperate requests - any workarounds?

    poschd

      Hi!


      I have a problem when using @RequestParameter and RichFaces, specifically <rich:paint2D>. I pass a Seam component to <rich:paint2D> in order to have my image painted, but this JavaBean depends on a request parameter. It works perfectly fine to inject its value using @RequestParameter outside <rich:paint2D>, but in the other case it always returns a null value.


      I found out this happens because the browser requests external resource contents in a seperate request - without having any request parameters passed. I have spent hours and hours to find a nice solution on this issue, but I failed.


      How can I workaround this problem?


      I thought it might be possible to inject type from the PAGE context, but seperate requests have actually seperate PAGE contexts, don't they?


      Best Regards,
      Daniel


      <rich:paint2D id="facelayoutImg" alt="Facelayout" format="png"
              paint="#{facelayout.paint}" width="1082" height="616" data="#{someData}" />
      



      @Name("facelayout")
      @Scope(ScopeType.PAGE)
      public class FacelayoutPainterBean implements Serializable {
              @RequestParameter
              private String type;
      
              // ...
      
              @Create
              public void init() {
                      // do something with 'type'
              }
      
              public void paint(Graphics2D g2d, Object obj) {
                      // ...
              }
      
              // ...
      }