Thanks Jash.
The directory is like below, 

JPKC   (The application name, when it is packaged, the name is jpkc.war)
  | -- VideoPlayer.tml
  | --apply
  |       | -- VideoList.tml

Now, when user click a link in VideoList, a new VideoPlayer page should be
opened using the js I pasted in blow thread.

I know I can use OpenWindow('/jpkc/VideoPlayer/' + id); to open it.  But
sometime, I maybe change the jpkc.war to aaaa.war. If I do that, I must
change js to OpenWindow('/aaaa/VideoPlayer/' + id).
If I can use related path in js, the issue will disappear.

Thanks
Stony



-----Original Message-----
From: Josh Canfield [mailto:joshcanfi...@gmail.com] 
Sent: Wednesday, December 22, 2010 1:56 PM
To: Tapestry users
Subject: Re: js open a page in new window.

> How can I identify the page VideoPlayer?   "/VideoPlayer " means root
> context, "VideoPlayer " means current folder VideoPlayer page. Both of
them
> are not what I expected.

Your application is deployed in the VideoPlayer context? If that is
the case everything after VideoPlayer is what's in your page package.

So if you have com.whatever.app.pages.VideoPlayer and your servlet
context is VideoPlayer then you access "/VideoPlayer/VideoPlayer",
which isn't very pretty. If you are the only app in the container
consider deploying as ROOT.war, or whatever your container does to
deploy your app to / instead of /VideoPlayer

If I've mis-understood then could you give more information about how
your app is configured?

Josh


On Tue, Dec 21, 2010 at 9:34 PM, Stony Zhang
<zhangyon...@cyberobject.com.cn> wrote:
> I encounter a problem about how to open a page in a new window by js. In
the
> following js, the function play() will be called when user click a window,
>
> And then try to open VidioPlayer page in a new window, the id will be
> captured in VideoPlayer.java (  onActivate(int id)    ).
>
> Now my question is,
>
> How can I identify the page VideoPlayer?   "/VideoPlayer " means root
> context, "VideoPlayer " means current folder VideoPlayer page. Both of
them
> are not what I expected.
>
>
>
> function OpenWindow(openurl)
>
> {
>
>
>
>         var paramet =
>
'toolbar=no,width=520,height=440,location=no,status=no,scrollbars=no,menubar
> =no,resizable=no';
>
>
>
>         newWindow = window.open(openurl, "jdzcnnet", paramet);
>
>
>
>         newWindow.focus();
>
>
>
> }
>
>
>
> function play(id)
>
> {
>
>         OpenWindow('/VideoPlayer/' + id);
>
>
>
> }
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to