You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gerald Fernando <ge...@gmail.com> on 2009/08/19 13:25:53 UTC

swf into wicket page

Hello Friends,

Shall we have(embed) a swf in wicket component(Panel or in wicket page).
I have swf that shows chart for dynamic data.
i want to show my .swf file into wicket page or wicket panel
if possible please give me modal code.
I need urgent reply




-- 
Thanks&regards,
Gerald A

Re: swf into wicket page

Posted by Martijn Lindhout <ml...@jointeffort.nl>.
You should forget about Bedrijf and Video. You can see from the code that
the video being displayed depends on the Bedrijf (dutch for company) passed
in. You are free to remove that and pass in your own domain objects (or just
a String if you need / like).

2009/8/20 Gerald Fernando <ge...@gmail.com>

> Hi martijin i have write what u gave me but it shows that
>
> Bedrijf cannot be resolved to a type
> Video cannot be resolved to a type
>
> create a class fo rBedrijf and Video
> As i new to wicket i dont know how to write it
> please tell me how to do it.
>
> Thanks&Regards,
> Gerald A
>
>
> On Wed, Aug 19, 2009 at 5:01 PM, Martijn Lindhout
> <ml...@jointeffort.nl>wrote:
>
> > Here's how I did it:
> >
> > Java
> > public class VideoPlayer extends Panel {
> >
> >        public VideoPlayer(String id, final Bedrijf bedrijf, final Video
> > video) {
> >                super(id);
> >                add(new WebComponent("player"){
> >                        @Override
> >                        protected void onComponentTagBody(MarkupStream
> > markupStream,
> > ComponentTag openTag) {
> >                                String videoFile = "/static/" +
> > bedrijf.getProfiel().getId() +
> > "/videos/" + video.getNaam();
> >                                StringBuilder script = new StringBuilder(
> >                                        "var s1 = new
> > SWFObject('/static/jobiq/player.swf','ply','328','200','9','#FFFFFF');"
> > +
> >
> >  "s1.addParam('allowfullscreen','true');" +
> >
> >  "s1.addParam('allowscriptaccess','always');" +
> >                                        "s1.addParam('flashvars','file=" +
> > videoFile +
> > "&image=/static/player/preview.jpg');" +
> >                                        "s1.write('container');"
> >                                );
> >
> >                                replaceComponentTagBody(markupStream,
> > openTag, script);
> >                        }
> >                });
> >        }
> >
> > }
> >
> >
> > And the HTML
> >        <wicket:panel>
> >
> >        <div id="container"><a
> > href="http://www.macromedia.com/go/getflashplayer">Get the Flash
> > Player</a> to see this player.</div>
> >                <script type="text/javascript"
> > src="/static/player/swfobject.js"></script>
> >        <script wicket:id="player" type="text/javascript"></script>
> >        </wicket:panel>
> >
> > 2009/8/19 Gerald Fernando <ge...@gmail.com>:
> >  > Hello Friends,
> > >
> > > Shall we have(embed) a swf in wicket component(Panel or in wicket
> page).
> > > I have swf that shows chart for dynamic data.
> > > i want to show my .swf file into wicket page or wicket panel
> > > if possible please give me modal code.
> > > I need urgent reply
> > >
> > >
> > >
> > >
> > > --
> > > Thanks&regards,
> > > Gerald A
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Thanks&regards,
> Gerald A
>



-- 
Martijn Lindhout
* 06 - 18 47 25 29
* mlindhout@jointeffort.nl
* http://www.jointeffort.nl

Re: swf into wicket page

Posted by Gerald Fernando <ge...@gmail.com>.
Hi martijin i have write what u gave me but it shows that

Bedrijf cannot be resolved to a type
Video cannot be resolved to a type

create a class fo rBedrijf and Video
As i new to wicket i dont know how to write it
please tell me how to do it.

Thanks&Regards,
Gerald A


On Wed, Aug 19, 2009 at 5:01 PM, Martijn Lindhout
<ml...@jointeffort.nl>wrote:

> Here's how I did it:
>
> Java
> public class VideoPlayer extends Panel {
>
>        public VideoPlayer(String id, final Bedrijf bedrijf, final Video
> video) {
>                super(id);
>                add(new WebComponent("player"){
>                        @Override
>                        protected void onComponentTagBody(MarkupStream
> markupStream,
> ComponentTag openTag) {
>                                String videoFile = "/static/" +
> bedrijf.getProfiel().getId() +
> "/videos/" + video.getNaam();
>                                StringBuilder script = new StringBuilder(
>                                        "var s1 = new
> SWFObject('/static/jobiq/player.swf','ply','328','200','9','#FFFFFF');"
> +
>
>  "s1.addParam('allowfullscreen','true');" +
>
>  "s1.addParam('allowscriptaccess','always');" +
>                                        "s1.addParam('flashvars','file=" +
> videoFile +
> "&image=/static/player/preview.jpg');" +
>                                        "s1.write('container');"
>                                );
>
>                                replaceComponentTagBody(markupStream,
> openTag, script);
>                        }
>                });
>        }
>
> }
>
>
> And the HTML
>        <wicket:panel>
>
>        <div id="container"><a
> href="http://www.macromedia.com/go/getflashplayer">Get the Flash
> Player</a> to see this player.</div>
>                <script type="text/javascript"
> src="/static/player/swfobject.js"></script>
>        <script wicket:id="player" type="text/javascript"></script>
>        </wicket:panel>
>
> 2009/8/19 Gerald Fernando <ge...@gmail.com>:
>  > Hello Friends,
> >
> > Shall we have(embed) a swf in wicket component(Panel or in wicket page).
> > I have swf that shows chart for dynamic data.
> > i want to show my .swf file into wicket page or wicket panel
> > if possible please give me modal code.
> > I need urgent reply
> >
> >
> >
> >
> > --
> > Thanks&regards,
> > Gerald A
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Thanks&regards,
Gerald A

Re: swf into wicket page

Posted by Martijn Lindhout <ml...@jointeffort.nl>.
Here's how I did it:

Java
public class VideoPlayer extends Panel {

	public VideoPlayer(String id, final Bedrijf bedrijf, final Video video) {
		super(id);
		add(new WebComponent("player"){
			@Override
			protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
				String videoFile = "/static/" + bedrijf.getProfiel().getId() +
"/videos/" + video.getNaam();
				StringBuilder script = new StringBuilder(
					"var s1 = new
SWFObject('/static/jobiq/player.swf','ply','328','200','9','#FFFFFF');"
+
					"s1.addParam('allowfullscreen','true');" +
					"s1.addParam('allowscriptaccess','always');" +
					"s1.addParam('flashvars','file=" + videoFile +
"&image=/static/player/preview.jpg');" +
					"s1.write('container');"
				);

				replaceComponentTagBody(markupStream, openTag, script);
			}
		});
	}

}


And the HTML
        <wicket:panel>

        <div id="container"><a
href="http://www.macromedia.com/go/getflashplayer">Get the Flash
Player</a> to see this player.</div>
		<script type="text/javascript" src="/static/player/swfobject.js"></script>
        <script wicket:id="player" type="text/javascript"></script>
        </wicket:panel>

2009/8/19 Gerald Fernando <ge...@gmail.com>:
> Hello Friends,
>
> Shall we have(embed) a swf in wicket component(Panel or in wicket page).
> I have swf that shows chart for dynamic data.
> i want to show my .swf file into wicket page or wicket panel
> if possible please give me modal code.
> I need urgent reply
>
>
>
>
> --
> Thanks&regards,
> Gerald A
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org