You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Argo Vilberg <wi...@gmail.com> on 2011/01/11 12:58:41 UTC
Tapestry5 and pop-up parameters
hi,
How to add parameters into Tapetstry page java object if i open page with
javascript pop-up windows ?
Argo
Re: Tapestry5 and pop-up parameters
Posted by Taha Hafeez <ta...@gmail.com>.
Hi
Another way
<a t:type='pageLink' t:page='SomePageToPopup' id='myPopup'>Popup</a>
<script>
document.getElementById("myPopup").onclick = function(event){
event = event || window.event;
event.stopPropagation();
window.open(document.getElementById("myPopup").href);
};
</script>
Obviously it is better to put your code in a separate js and to use
prototype rather than plain javascript!!
regards
Taha
On Tue, Jan 11, 2011 at 8:35 PM, Josh Canfield <jo...@gmail.com>wrote:
> There isn't much information in your request so I'm not going to write
> a book guessing every possible thing you might be talking about.
>
> If you know the parameters that you want to pass when you are
> rendering the page that opens the popup then you can use something
> like:
> @Inject
> PageRenderLinkSource linkSource;
>
> public String getPopupLink() {
> return linkSource.createPageRenderLinkWithContext(pagename, param1,
> param2); // to create the link
> }
>
> <script>
> window.open('${popuplink}');
> </script>
>
> I haven't compiled/run this code so please forgive typos etc.
>
> Josh
>
> On Tue, Jan 11, 2011 at 3:58 AM, Argo Vilberg <wi...@gmail.com> wrote:
> > hi,
> >
> > How to add parameters into Tapetstry page java object if i open page with
> > javascript pop-up windows ?
> >
> >
> > Argo
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Tapestry5 and pop-up parameters
Posted by Josh Canfield <jo...@gmail.com>.
> And if i use so then Sign.class is some as priavte Sign sign.
> WHY ?
@InjectPage grabs the page from a request level cache. This means that
no matter how many times or in how many components you inject a page
you get the same instance for the entire request (within the same
thread). When the PageRenderLinkSource grabs the page via its class it
is getting the same instance you injected in your
page/component/service.
It's important to remember that each time you call
createPageRenderLink, without a context or setting override to true,
the page you are referring to is passivated (onPassivate() is called).
This means that you get a link to the page that represents it's
current state. This is also true when you use the <t:pagelink>
component in your templates, not binding a context attribute tells the
page to passivate.
> And why i cant use just
> return linkSource.createPageRenderLink(sign);
Considering how @InjectPage works I'm guessing that the API isn't
there because it doesn't add value.
Josh
On Wed, Jan 12, 2011 at 10:45 AM, Argo Vilberg <wi...@gmail.com> wrote:
> Thank you this works...
>
> Sorry i am stupid in java advance class usage,
> but what abaout strange behaviour
>
>
> @InjectPage
> private Sign sign;
>
>
> sign.setReturnPage("Failid");
> sign.setSeisund("FAILID");
> return linkSource.createPageRenderLink(Sign.class);
>
> And if i use so then Sign.class is some as priavte Sign sign.
> WHY ?
>
> And why i cant use just
> return linkSource.createPageRenderLink(sign);
>
> [javac]
> G:\digileping\arendus5_1_0_5\digileping\src\ee\softpro\pages\Failid.java:486:
> cannot find symbol
> [javac] symbol : method createPageRenderLink(ee.softpro.pages.Sign)
> [javac] location: interface
> org.apache.tapestry5.services.PageRenderLinkSource
> [javac] return linkSource.createPageRenderLink(sign);
>
> i got error.
>
>
> Argo
> 2011/1/11 Josh Canfield <jo...@gmail.com>
>
>> There isn't much information in your request so I'm not going to write
>> a book guessing every possible thing you might be talking about.
>>
>> If you know the parameters that you want to pass when you are
>> rendering the page that opens the popup then you can use something
>> like:
>> @Inject
>> PageRenderLinkSource linkSource;
>>
>> public String getPopupLink() {
>> return linkSource.createPageRenderLinkWithContext(pagename, param1,
>> param2); // to create the link
>> }
>>
>> <script>
>> window.open('${popuplink}');
>> </script>
>>
>> I haven't compiled/run this code so please forgive typos etc.
>>
>> Josh
>>
>> On Tue, Jan 11, 2011 at 3:58 AM, Argo Vilberg <wi...@gmail.com> wrote:
>> > hi,
>> >
>> > How to add parameters into Tapetstry page java object if i open page with
>> > javascript pop-up windows ?
>> >
>> >
>> > Argo
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry5 and pop-up parameters
Posted by Argo Vilberg <wi...@gmail.com>.
Thank you this works...
Sorry i am stupid in java advance class usage,
but what abaout strange behaviour
@InjectPage
private Sign sign;
sign.setReturnPage("Failid");
sign.setSeisund("FAILID");
return linkSource.createPageRenderLink(Sign.class);
And if i use so then Sign.class is some as priavte Sign sign.
WHY ?
And why i cant use just
return linkSource.createPageRenderLink(sign);
[javac]
G:\digileping\arendus5_1_0_5\digileping\src\ee\softpro\pages\Failid.java:486:
cannot find symbol
[javac] symbol : method createPageRenderLink(ee.softpro.pages.Sign)
[javac] location: interface
org.apache.tapestry5.services.PageRenderLinkSource
[javac] return linkSource.createPageRenderLink(sign);
i got error.
Argo
2011/1/11 Josh Canfield <jo...@gmail.com>
> There isn't much information in your request so I'm not going to write
> a book guessing every possible thing you might be talking about.
>
> If you know the parameters that you want to pass when you are
> rendering the page that opens the popup then you can use something
> like:
> @Inject
> PageRenderLinkSource linkSource;
>
> public String getPopupLink() {
> return linkSource.createPageRenderLinkWithContext(pagename, param1,
> param2); // to create the link
> }
>
> <script>
> window.open('${popuplink}');
> </script>
>
> I haven't compiled/run this code so please forgive typos etc.
>
> Josh
>
> On Tue, Jan 11, 2011 at 3:58 AM, Argo Vilberg <wi...@gmail.com> wrote:
> > hi,
> >
> > How to add parameters into Tapetstry page java object if i open page with
> > javascript pop-up windows ?
> >
> >
> > Argo
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Tapestry5 and pop-up parameters
Posted by Josh Canfield <jo...@gmail.com>.
There isn't much information in your request so I'm not going to write
a book guessing every possible thing you might be talking about.
If you know the parameters that you want to pass when you are
rendering the page that opens the popup then you can use something
like:
@Inject
PageRenderLinkSource linkSource;
public String getPopupLink() {
return linkSource.createPageRenderLinkWithContext(pagename, param1,
param2); // to create the link
}
<script>
window.open('${popuplink}');
</script>
I haven't compiled/run this code so please forgive typos etc.
Josh
On Tue, Jan 11, 2011 at 3:58 AM, Argo Vilberg <wi...@gmail.com> wrote:
> hi,
>
> How to add parameters into Tapetstry page java object if i open page with
> javascript pop-up windows ?
>
>
> Argo
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org