Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
As Taha indicated, you probable should use PageRenderLinkSource instead of LinkSource. Good luck! -- View this message in context: http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4632134.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
It works. Thanks, J. 2011/7/25 George Christman > opps my bad, try this > >import org.apache.tapestry5.Link; > >@Inject >private LinkSource linkSource; > >Link onActionFromModify(String contextId) { > Link link = linkSource.createPageRenderLinkWithContext(Index.class, > contextId); > return link; >} > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631991.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
opps my bad, try this import org.apache.tapestry5.Link; @Inject private LinkSource linkSource; Link onActionFromModify(String contextId) { Link link = linkSource.createPageRenderLinkWithContext(Index.class, contextId); return link; } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631991.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Hi Julien LinkSource is an internal serivce, you should use PageRenderLinkSource http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PageRenderLinkSource.html#createPageRenderLinkWithContext(java.lang.Class, java.lang.Object...) regards Taha On Tue, Jul 26, 2011 at 12:22 AM, Julien Martin wrote: > Hello George, > It seems this method does not exist... > See here: > http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/internal/services/LinkSource.html > Regards, > Julien. > > 2011/7/25 George Christman > >> I think something like this might do the trick. >> >> @Inject >> private LinkSource _linkSource; >> >> Class onActionFromModify(String contextId) { >> return linkSource.createPageRenderLinkWithContext(YourClass.class, >> contextId); >> } >> >> -- >> View this message in context: >> http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631914.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> - >> 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
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Hello George, It seems this method does not exist... See here: http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/internal/services/LinkSource.html Regards, Julien. 2011/7/25 George Christman > I think something like this might do the trick. > > @Inject > private LinkSource _linkSource; > > Class onActionFromModify(String contextId) { > return linkSource.createPageRenderLinkWithContext(YourClass.class, > contextId); > } > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631914.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
I think something like this might do the trick. @Inject private LinkSource _linkSource; Class onActionFromModify(String contextId) { return linkSource.createPageRenderLinkWithContext(YourClass.class, contextId); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631914.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Actually, I am not sure how to to it you way Igor. Here is what I tried: * @OnEvent(value = EventConstants.ACTION, component = "modify") Object modifyJobPosting() { return componentResources.createEventLink(EventConstants.ACTION, jobPosting); } * *modify2* However I know it does not make sense. Can you please help? Regards, Julien. 2011/7/25 Julien Martin > Thanks to both of you. > > @NilleHammer: it works with the page link. Thanks. > @Igor: if I want to follow your suggestion, can I still use an actionLink > or do I need an Eventlink instead? > > J. > > > 2011/7/25 nillehammer > >> Me again, I have a typo in the pagelink (damn copy and paste). The value >> for >> the context parameter must be "jobPosting" of course. >> >> - >> http://www.winfonet.eu >> -- >> View this message in context: >> http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631615.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Thanks to both of you. @NilleHammer: it works with the page link. Thanks. @Igor: if I want to follow your suggestion, can I still use an actionLink or do I need an Eventlink instead? J. 2011/7/25 nillehammer > Me again, I have a typo in the pagelink (damn copy and paste). The value > for > the context parameter must be "jobPosting" of course. > > - > http://www.winfonet.eu > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631615.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Me again, I have a typo in the pagelink (damn copy and paste). The value for the context parameter must be "jobPosting" of course. - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631615.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Returning page's class in a handler method you tell Tapestry where to navigate to, but yor target page needs a context. Just create a Link with context and return it instead of class. 25.07.2011, в 19:06, Julien Martin написал(а): Hello, I have a page that lists job postings (beans) as follows: Template: *http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter"> add="activate,modify" exclude="jobPostingValidationDate"> activate modify * Java: *package com.cheetah.web.pages.recruiters; import com.cheetah.domain.JobPosting; import com.cheetah.service.CheetahService; import org.apache.tapestry5.EventConstants; import org.apache.tapestry5.annotations.OnEvent; import org.apache.tapestry5.annotations.PageActivationContext; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import java.util.Date; import java.util.List; public class JobPostingsTable { @Property private List jobPostings; @PageActivationContext @Property private JobPosting jobPosting; @Property private Date date; @Inject private CheetahService service; @OnEvent(EventConstants.ACTIVATE) void loadJobPostings() { jobPostings = service.loadJobPostings(); } @OnEvent(EventConstants.ACTION) void activateJobPosting() { } @OnEvent(value = EventConstants.ACTION, component = "modify") Object modifyJobPosting() { return ModifyJobPosting.class; } }* However, when I click on the action link with t:id="modify", the job posting id is lost... and the ModifyJobPosting page is not able to display the bean. Template for ModifyJobPosting: *http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter"> * java for ModifyJobPosting: *public class ModifyJobPosting { @PageActivationContext @Property private JobPosting jobPosting; }* I must be missing something obvious about PageActivationContext usage. Can anyone please help? Regards, Julien. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Beginner needs help with PageActivationContext and page navigation in Tapestry
Hi Julien, to call your ModifyJobPosting page from JobPostingsTable page use a page link instead of an action link. The template would look like: modify This makes the method modifyJobPosting redundant. - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/Beginner-needs-help-with-PageActivationContext-and-page-navigation-in-Tapestry-tp4631566p4631593.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Beginner needs help with PageActivationContext and page navigation in Tapestry
Hello, I have a page that lists job postings (beans) as follows: Template: *http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter"> activate modify * Java: *package com.cheetah.web.pages.recruiters; import com.cheetah.domain.JobPosting; import com.cheetah.service.CheetahService; import org.apache.tapestry5.EventConstants; import org.apache.tapestry5.annotations.OnEvent; import org.apache.tapestry5.annotations.PageActivationContext; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import java.util.Date; import java.util.List; public class JobPostingsTable { @Property private List jobPostings; @PageActivationContext @Property private JobPosting jobPosting; @Property private Date date; @Inject private CheetahService service; @OnEvent(EventConstants.ACTIVATE) void loadJobPostings() { jobPostings = service.loadJobPostings(); } @OnEvent(EventConstants.ACTION) void activateJobPosting() { } @OnEvent(value = EventConstants.ACTION, component = "modify") Object modifyJobPosting() { return ModifyJobPosting.class; } }* However, when I click on the action link with t:id="modify", the job posting id is lost... and the ModifyJobPosting page is not able to display the bean. Template for ModifyJobPosting: *http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter"> * java for ModifyJobPosting: *public class ModifyJobPosting { @PageActivationContext @Property private JobPosting jobPosting; }* I must be missing something obvious about PageActivationContext usage. Can anyone please help? Regards, Julien.