Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Although Wicket does not provide a Flash component right out of the box, it isn't hard at all to make one using some markup and a Resource.  Given a byte array representing a Flash movie, all that is required is to be able to stream this back is a resource with the appropriate markup around it.  The general idea is that you want to make some Component class (component) extending WebMarkupComponent and implementing IResourceListener  so that it can be displayed as a component and return a flash movie as a resource to the resource stream.

When You you have such a class made, there are a couple of things to do. 

...

Code Block
public void onResourceRequested() {
        getRequestCycle().setRequestTarget(new IRequestTarget() {
            public void respond(RequestCycle requestCycle) {
                requestCycle.getResponse()getOutputStream().write(getFlashBytesgetFlashByteArray());
            }
        });
    }

You may override onComponentTag to dynamically output the height and width of the Flash movie

...