Re: problems with flash-integration

"Geoff Longman" <[email protected]>
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <011a01c28ef8$2beef770$1700a8c0@MOONBEAM>
Roberto,

I think you aren't seeing much response to your question as not many of us are Flash gurus.

Perhaps if you post more detail on your approach and what you are trying to accomplish, then you'll get
some good help.

Cheers,

Geoff
  ----- Original Message ----- 
  From: Roberto Saccon 
  To: [email protected] 
  Sent: Saturday, November 16, 2002 9:36 AM
  Subject: [Tapestry-developer] problems with flash-integration


  Hello Howard and community 

  First, thanks for all the efforts put into this great Web-Framework. 

  Second, I try to add a new dimension to it by creating a general flash-component. You might ask, what is that good for. Well, I have created a Flash-Texteditor with may features (for weblog-application). This is much easier to do in Flash than in DHTML/Flashscript and with FlashRemoting (propietary) or Apache XML-RPC the Editor can talk to a servlet and even do things lilke spell-checking. But here comes my problem. After studying for two days the Tapestry RequestCycle, my Flashcomponent was neither capable to store the URL nor to initialize propperly a ActionListener. 
  To handle that stuff in a simple servlet would be very easy, because the FlashClient simple puts an attributes into the HttpServletRequest, which is used as argument for invoking serverside-functions, and then puts the result back in the HttpServletRequest. So I created a very simple FlashComponent which just handles the HTML-Tage for embeding the flash-object and I put all the Logic into the servlet by overiding the doService-Method in the ApplicationServlet, see my codefragments commented es flash-ugly-hack-1 and flash-ugly-hack-2.
  Obviously, this is NOT how components should be created. But how can I create a real Component with a listener which is triggered when I "submit" form the flashclient ? I tried to modify the Link- and Form-Componentts,  but without success. Any help is highly appreciated.

  regards
  Roberto


  abstract public class FlashApplicationServlet extends ApplicationServlet
  {
  ...
  ...
  protected void doService(HttpServletRequest request, HttpServletResponse response)
  throws IOException, ServletException
  {
    //flash-ugly-hack-1
    boolean flashRequest = false;
    String flashParameter0 = null; 
    Object o = request.getAttribute("FLASH.PARAMS");
    if ( o != null)
    {
      flashRequest = true;
      List args = (List) o;
      flashParameter0 = (String) args.get(0);
    }

    RequestContext context = null;
    try
      { 
        // Create a context from the various bits and pieces.

        context = new RequestContext(((ApplicationServlet) this), request, response);
        // The subclass provides the engine.
        IEngine engine = getEngine(context);

        // flash-ugly-hack-2
        if (flashRequest)
        { 
          String result = flashParameter0 + ((Visit) engine.getVisit()).getUser().getEmail();
          request.setAttribute("FLASH.RESULT", result); 
        }
  .......
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.