Sorry, I can't make it work, following is a test class, i intended to open a
home page inside a pop pop window, what I got is, a blank pop up window,
then the home page behind it, anything I miss here? thanks,
public class TestPage {
Object onActionFromLaunch(String msg, String msg2) {
return Home.class;
}
}
< a t:type="actionlink" t:id="launch" context="['123', 'abc']"
target="myPage"
onclick="window.open('','hello','width=640,height=470');"
>pop up< /a>
oakstair wrote:
>
> Hi!
>
> No thats the name we asssign the browser window.
>
> I'm not a javascript guy but see
> http://www.javascript-coder.com/window-popup/javascript-window-open.phtml....
>
> The empty first parameter is the relative href which means we addresses
> the
> same page we are on.
>
> In my case that is Games.java which contains an activate method as below
> which is long and complicated but in the end it
> returns either an URL since I am redirecting to an external page. But I
> also
> have a case where I am just returning an
> tapestry page.
>
> Hope that helps! T5 rocks!
>
> /Gunnar
>
>
> public Object onAction(String gameCode, boolean testMode) {
> // -- Needed in all onActivate() until we fix a transparent access
> control system. --
> Object obj = super.onActivate();
> if (null != obj)
> return obj;
>
> log.info("User " + getUser() + " is about to launch game " +
> gameCode + ". (test=" + testMode + ")");
>
> String url = (testMode) ? TESTURL : PRODURL;
>
> // -- Create CasinoSession and launch game --
> CasinoSession cs = new CasinoSession();
> cs.setCreatedAt(new Date());
> cs.setGame(gameCode);
> cs.setToken(UUID.randomUUID().toString());
> cs.setUpdatedAt(new Date());
> cs.setUser(getUser());
> casinoDao.save(cs);
>
> // -- Add some url params. --
> url += "&game=" + gameCode;
> url += "&language=en"; // TODO: Use user's preferred language
> url += "&sessionid=" + cs.getToken();
>
> try {
> log.debug(LOGPRE + "Launch URL=[" + url + "]");
> return new URL(url);
> } catch (MalformedURLException e) {
> log.error("Bad url: " + url);
> return Index.class;
> }
>
> }
>
>
> 2009/10/2 Angelo Chen <[email protected]>
>
>>
>> thanks, so casino is a t5 page, now how to pass a parameter to the page?
>>
>>
>> oakstair wrote:
>> >
>> > Hi!
>> >
>> > Not sure if it helps but this worked for me ...
>> >
>> > <t:actionlink t:id="launch" style="background-image: none"
>> > context="[game.code, true]" target="casino"
>> >
>> > onclick="window.open('','casino','width=640,height=470');">
>> > ${gameImagePath}
>> > </t:actionlink>
>> >
>> > I..e. an action link and then return the page you want to open up from
>> > your
>> > action method.
>> >
>> > Gunnar
>> >
>> > 2009/10/2 Benny Law <[email protected]>
>> >
>> >> This may not be the best solution, but you could create an empty (and
>> >> invisible) pagelink like page='mypage'>
>> >> and reference its href with $('mylink').href when opening the popup.
>> You
>> >> might also want to consider using simulated popups like Prototype
>> Window
>> >> (
>> >> http://prototype-window.xilinus.com).
>> >>
>> >> Benny
>> >>
>> >> On Fri, Oct 2, 2009 at 12:10 AM, Angelo Chen <
>> [email protected]
>> >> >wrote:
>> >>
>> >> >
>> >> > Hi,
>> >> > I use following to open a pagelink page in another window:
>> >> >
>> >> > details
>> >> >
>> >> > Now I'd like to make it a popup, so I'm thinking of using:
>> >> >
>> >> > window.open(href, windowname,
>> 'width=400,height=200,scrollbars=yes');
>> >> >
>> >> > now, how to specify the pagelink in href field of window.open?
>> >> >
>> >> > Thanks
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>> http://www.nabble.com/t5%3A-popup-window-and-pagelink-tp25710259p25710259.html
>> >> > Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [email protected]
>> >> > For additional commands, e-mail: [email protected]
>> >> >
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
>> > Allévägen 2A, 132 42 Saltsjö-Boo
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-popup-window-and-pagelink-tp25710259p25711181.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>
>
--
View this message in context:
http://www.nabble.com/t5%3A-popup-window-and-pagelink-tp25710259p25712270.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]