Return URL POST Redirection from onActivate
Hello everybody, I'm working on a web site using Tapestry 5.2.6. I need to simulate a POST form data to authenticated a client to another site. I'm trying to do it using the return URL from onActivate. Object onActivate(@RequestParameter(value=id, allowBlank=true ) String id) throws IOException { _idCrypt = id; return getUrl(); } private URL getUrl() throws IOException { String data = username=totopassword=titi; URL url = new URL(https://myurl/login;); HttpURLConnection connection = null; //Create connection connection = (HttpURLConnection)url.openConnection(); connection.setRequestMethod(POST); connection.setRequestProperty(Content-Type, application/x-www-form-urlencoded); connection.setRequestProperty(Content-Length, +Integer.toString(data.getBytes().length)); connection.setUseCaches (false); connection.setDoInput(true); connection.setDoOutput(true); //Send request DataOutputStream wr = new DataOutputStream (connection.getOutputStream ()); wr.writeBytes (data); wr.flush (); wr.close (); connection.getInputStream(); return connection.getURL(); } But it doesn't work, Tapestry redirect on my url (https://myurl/login), but no authenticated... Is it possible to simulate a POST redirection using an URL object and onActivate from Tapestry ? Thanks, Tom - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Hi! From an Object oriented aspect you are coupling components to particular pages, when I understand you correctly. This is for my personal opinion a wrong design. Can't you not just pass the additional info as parameter from your page to your component (as Taha suggested it)? Or are you displaying commen/shared info? Maybe tapestry's layout might be a solution for you? Jens Sent from my iPhone On 12.12.2012, at 06:00, Taha Siddiqi tawus.tapes...@gmail.com wrote: Hi Bogdan No sure if I understand you question correctly. From what I understand you can use block parameters or t:body/ regards Taha On Dec 12, 2012, at 10:22 AM, bogdan_cm wrote: Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.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: Return URL POST Redirection from onActivate
I think the most elegant way of handling this would be to handle a new component event result type called ExternalPost. Then you could return an ExternalPost instance from your onActivate() method. public class ExternalPost { private URL url; private String contentType; private MapString, String parameters; // getters and setters } public class ExternalPostResultProcessor implements ComponentEventResultProcessorExternalPost { public void processResultValue(ExternalPost externalPost) throws IOException { // do the actual post here } } AppModule.java === public void contributeComponentEventResultProcessor(MappedConfigurationClass, ComponentEventResultProcessor configuration) { configuration.addInstance(ExternalPost.class, ExternalPostResultProcessor.class); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Return-URL-POST-Redirection-from-onActivate-tp5718626p5718628.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: Return URL POST Redirection from onActivate
Do you want to do the POST from the client's browser or from the server? I think you want to do it from the client's browser. The server can only send a redirect to the client. A redirect causes a GET on the client. Another option is to send some javascript to the client so that it does a POST. Be very careful with this as you can easily send a password to the client in plain text which may raise some security concerns. I think you might want to rethink this. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Return-URL-POST-Redirection-from-onActivate-tp5718626p5718629.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: Return URL POST Redirection from onActivate
On Wed, 12 Dec 2012 06:33:10 -0200, TNO tno...@free.fr wrote: Hello everybody, Hi! I'm working on a web site using Tapestry 5.2.6. I need to simulate a POST form data to authenticated a client to another site. I'm trying to do it using the return URL from onActivate. That's a redirect, and, as far as I know, HTTP doesn't allow you to redirect and POST at the same time. If you really need to post something to an external server, you either create HTML form pointing to it or do it using JavaScript, as Lance suggested. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to sort Association column in Grid?
A simple (but slightly hacky) solution is to add a convenience getter to Employee public class Employee { private int id; private String employeeName; private Department department; public String getDepartmentName() { return department == null ? null : department.getName(); } } -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-sort-Association-column-in-Grid-tp5718569p5718631.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
Session Timeout in Tapestry
How can i set the Session Time out and redirect the user the login page, when a timeout occurs ? I know in JSF i could centrally handle the session state from faces config file. How can i do this in Tapestry ? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Session-Timeout-in-Tapestry-tp5718632.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: Component that displays additional containing Page markup
This may help: http://jumpstart.doublenegative.com.au/jumpstart/examples/component/combiningcomponents Cheers, Geoff On 12/12/2012, at 4:00 PM, Taha Siddiqi wrote: Hi Bogdan No sure if I understand you question correctly. From what I understand you can use block parameters or t:body/ regards Taha On Dec 12, 2012, at 10:22 AM, bogdan_cm wrote: Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.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: Session Timeout in Tapestry
Session timeout is handled at the servlet level using session-timeout parameter in web.xml On Dec 12, 2012, at 4:03 PM, mateen wrote: How can i set the Session Time out and redirect the user the login page, when a timeout occurs ? I know in JSF i could centrally handle the session state from faces config file. How can i do this in Tapestry ? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Session-Timeout-in-Tapestry-tp5718632.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: Session Timeout in Tapestry
On Wed, 12 Dec 2012 08:33:46 -0200, mateen matee...@gmail.com wrote: How can i set the Session Time out and redirect the user the login page, when a timeout occurs ? Setting the session time is a web.xml configuration, completely separated from Tapestry. Redirecting to the login page automatically can be done in a couple different ways. I'd recommend implementing a RequestFilter. I know in JSF i could centrally handle the session state from faces config file. How can i do this in Tapestry ? I guess few people in this mailing list know JSF, so asking how to do something from JSF in Tapestry won't help you get good answers. For example, now, what do you mean by centrally handling the session state? PS: faces-config.xml sucks very hard. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return URL POST Redirection from onActivate
Ok, thanks you, so it is not possible to redirect and post at same time Le 12/12/2012 11:07, Thiago H de Paula Figueiredo a écrit : On Wed, 12 Dec 2012 06:33:10 -0200, TNO tno...@free.fr wrote: Hello everybody, Hi! I'm working on a web site using Tapestry 5.2.6. I need to simulate a POST form data to authenticated a client to another site. I'm trying to do it using the return URL from onActivate. That's a redirect, and, as far as I know, HTTP doesn't allow you to redirect and POST at the same time. If you really need to post something to an external server, you either create HTML form pointing to it or do it using JavaScript, as Lance suggested. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return URL POST Redirection from onActivate
On Wed, 12 Dec 2012 09:03:38 -0200, TNO tno...@free.fr wrote: Ok, thanks you, so it is not possible to redirect and post at same time Nope. That's not a Tapestry limitation: that's an HTTP one. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Session Timeout in Tapestry
Could you show me how to write a request filter in Tapestry -- View this message in context: http://tapestry.1045711.n5.nabble.com/Session-Timeout-in-Tapestry-tp5718632p5718639.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: JQuery Dialog Popup in my tml file.
Hi, Do you use an dialoglink or dialogajaxlink components, which will open the dialog ? Have a look to the template snippet in the documentation page (tabs Example). Manu 2012/12/12 mateen matee...@gmail.com I have included the JQuery dialog found here http://tapestry5-jquery.com/components/docsjquerydialog . where does the DocsJQueryDialog come into practice. Its not referenced in the code ?Can someone show me how i can get a dialog to work in my tml file ? In the action link i want to show the popup ? t:zone t:id=searchTransactionZone id=searchTransactionZone div class=tableDv t:grid t:source=pickupQuotes t:row=selectedQuote t:rowsPerPage=5 t:inPlace=true t:pagerPosition=top add=action p:actionCell Process Teller /p:actionCell p:empty /p:empty /t:grid /div /t:zone t:jquery.dialog t:clientId=myDialog Dialog test! t:zone t:id=myZone id=myZone${count} t:form Try abcd :input t:type=TextField type=text t:id=goalName t:value=goalName t:mixins=jquery/Autocomplete/ /t:form /t:zone /t:jquery.dialog -- View this message in context: http://tapestry.1045711.n5.nabble.com/JQuery-Dialog-Popup-in-my-tml-file-tp5718638.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 -- Emmanuel DEMEY Ingénieur Etude et Développement ATOS Worldline +33 (0)6 47 47 42 02 demey.emman...@gmail.com http://emmanueldemey.fr/ Twitter : @EmmanuelDemey
Re: Session Timeout in Tapestry
For an example see http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/protectingpages Cheers, Geoff On 12/12/2012, at 11:01 PM, mateen wrote: Could you show me how to write a request filter in Tapestry -- View this message in context: http://tapestry.1045711.n5.nabble.com/Session-Timeout-in-Tapestry-tp5718632p5718639.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: JQuery Dialog Popup in my tml file.
I have had a look, i dont understand where the DocsJQueryDialog class comes into play ? Do we have to create a reference to it, in my parent tml java file or what ? I wanted the ajax link. The code is simple just dont understand where the DocsJQueryDialog class comes into play ? -- View this message in context: http://tapestry.1045711.n5.nabble.com/JQuery-Dialog-Popup-in-my-tml-file-tp5718638p5718642.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: Component that displays additional containing Page markup
Thank you both for replying. Now that I read it after a day, my question is not very clear. Here is a more to the point explanation. My custom component will take care of pagination. This means I need my component to wrap around a Loop in the main page. The Loop will be iterating over a List of results. The code I am hoping for is: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; -- tapestry Page t:myPaginationComponent params= (will tie pagination variables from page to component params) loop ... html that displays list entries /loop /t:myPaginationComponent /html I will explore the block suggestion. Thanks very much, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718645.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
required input elements displays error message before submit is pressed? (IE8)
This works fine in Chrome but in IE8 the required error message is displayed as soon as the page is displayed before the form is submitted? Any ideas what the issue is? Maybe I should just validate on the form submit, but I'd rather catch this on the client side. John form t:type=form t:id=form t:errors / t:label for=username style=width:100px;${message:label.name}/t:label input t:type=TextField t:id=username t:validate=required,minlength=3 size=30 / br / t:label for=password style=width:100px;${message:label.password}/t:label input t:type=PasswordField t:id=password t:validate=required,minlength=3 size=30 / br / t:if test=kaptchaRequired br / ${message:kaptchawarning} br / t:kaptchaimage t:id=kaptcha / br / t:kaptchafield image=kaptcha / br / /t:if br / input type=submit value=${message:button.login} / /form
Re: JQuery Dialog Popup in my tml file.
The DocsJQueryDialog class is the Documentation page you are visiting. 2012/12/12 mateen matee...@gmail.com I have had a look, i dont understand where the DocsJQueryDialog class comes into play ? Do we have to create a reference to it, in my parent tml java file or what ? I wanted the ajax link. The code is simple just dont understand where the DocsJQueryDialog class comes into play ? -- View this message in context: http://tapestry.1045711.n5.nabble.com/JQuery-Dialog-Popup-in-my-tml-file-tp5718638p5718642.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 -- Emmanuel DEMEY Ingénieur Etude et Développement ATOS Worldline +33 (0)6 47 47 42 02 demey.emman...@gmail.com http://emmanueldemey.fr/ Twitter : @EmmanuelDemey
RE: custom edit page not possible
correction I copied Edit.tml into a respective resources/org/tynamo/examples/hibernatesecurity/pages/edit/CoachEdit.tml I copied Edit.Java into a respective java/org/tynamo/examples/hibernatesecurity/pages/edit/CoachEdit.java I
Re: custom edit page not possible
On Wed, 12 Dec 2012 14:53:17 -0200, Ken in Nashua kcola...@live.com wrote: Folks, Hi! is there any unknown magic to creating a simple custom edit page? Absolutely no. I copied Edit.tml into a respective resources/org/tynamo/examples/hibernatesecurity/edit/CoachEdit.tml I copied Edit.Java into a respective java/org/tynamo/examples/hibernatesecurity/edit/CoachEdit.java I did not copy anything to webapp dir activate never gets called in CoachEdit.JAVA and so nothing gets setup properly and a slew of exceptions follow Please always post error message and stack traces when you mention then. If there are any other details undocumented that are required to get this going I would be greatful. I have no idea what you're trying to do. Are you trying to create a component library? What URL are you requesting? -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [5.3.6] A homepage instead of Index
Thanks a lot that was exactly what I needed. One drawback is that I can't inject a *PageRenderLinkSource* to generate the page's link automatically. Is there a way to overcome that ? On Wed, Dec 12, 2012 at 12:11 AM, Dusko Jovanovski dusk...@gmail.comwrote: Try overriding the SymbolConstants.START_PAGE_NAME symbol. On Tue, Dec 11, 2012 at 10:55 PM, Muhammad Gelbana m.gelb...@gmail.com wrote: I'm not sure if that's a usual requirement but here it is. I need to have another page as a default homepage instead of the Index page. I can do that by returning the page I need from an Index page method that handles @SetupRender or @OnEvent(value=EventConstants.Activate) events, I'm not quire sure at the moment but I'll look that up. The question is, can this be done without redirecting the user after visiting the Index page ? More like having the page I desire as the default home page instead of Index ? Also the tricky part is that I may have this page in a module (here is an idea about what I mean http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/ ). So when that module *isn't* in the classpath, the Index page will be displayed as usual. Thank you.
Upgrading selenium version
Hello all, I've been running into an issue with selenium and it has been suggested on stack overflow I try up dating the selenium version. Tapestry is currently running on 2.14.0 while 2.28.0 is the most current. I'm wondering if there is any plans to upgrade the version or if I have the ability on my end to run a different version? Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Upgrading-selenium-version-tp5718653.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: [5.3.6] A homepage instead of Index
On Wed, 12 Dec 2012 15:37:56 -0200, Muhammad Gelbana m.gelb...@gmail.com wrote: Thanks a lot that was exactly what I needed. One drawback is that I can't inject a *PageRenderLinkSource* to generate the page's link automatically. Actually, you can, but it will probably not generate a / URL. I haven't checked, though. Is there a way to overcome that ? Have you tried the LinkTransformer API? -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Upgrading selenium version
On Wed, 12 Dec 2012 15:49:51 -0200, George Christman gchrist...@cardaddy.com wrote: Hello all, I've been running into an issue with selenium and it has been suggested on stack overflow I try up dating the selenium version. Tapestry is currently running on 2.14.0 while 2.28.0 is the most current. I'm wondering if there is any plans to upgrade the version or if I have the ability on my end to run a different version? Just use Maven, Gradle or some other tool you're using and force the Selenium version you want. Tapestry isn't forcing you to use a given version, just pre-configured to use one. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Upgrading selenium version
Thanks Thiago, all set, wasn't aware you could easily override the versions. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Upgrading-selenium-version-tp5718653p5718656.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: [5.3.6] A homepage instead of Index
I think this methodhttp://tapestry.apache.org/5.3.6/apidocs/org/apache/tapestry5/services/linktransform/ComponentEventLinkTransformer.html#decodeComponentEventRequest(org.apache.tapestry5.services.Request) is the closest to what I need but I don't know how can I provide the appropriate *Request* object for it, to generate a *Link*. Thank you. On Wed, Dec 12, 2012 at 7:57 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: LinkTransformer
RE: custom edit page not possible
Well this doesnt work as designed/documented Customized tapestry-model templates If you don't customize anything, Tynamo uses default pages. In Tapestry, a component (a page is a component as well) is comprised of two parts: its template and a backing java class. There's a default page for each particular operation, such as: Add, Edit, List and Show. The archetype will put the Java page classes to src/main/java/groupid/pages and the corresponding templates to /src/main/webapp. The cool thing about this is that you can also customize the default look and feel of a page for an operation type. Most of the cases, however, you want to customize a page specific for a particular object. Tynamo makes decisions about what page to display based on which kind of page is needed and the class of the object(s) involved. It will first look for a page using Add, Edit, Show or List depending on the kind of page needed, prefixed with the unqualified-type name of the object. If it can't find a specific page for a given type, it will instead use the default Add, Edit, Show or List page, respectively. The following table gives some examples of how Tynamo figures out which page to use: Operation Class Look for page: If not found, use page: Edit org.tynamo.recipe.entities.Recipe org.tynamo.recipe.pages.edit.RecipeEdit org.tynamo.recipe.pages.Edit List com.foo.entities.Product com.foo.pages.list.ProductList com.foo.pages.List Add org.wwf.entities.Gazelle org.wwf.pages.add.GazzelleAdd org.wwf.pages.Add To start customizing a page, make a copy of the appropriate default page files and rename according the the table above. Most of the UI customization happens in the corresponding .tml template. Keep in mind that a Tapestry template is more or less just a html page with selected additional tags starting with t:some-tapestry-element that will be replaced by Tapestry components (which can be comprised of other templates and so forth). Read Tapestry's template guide for more comprehensive documentation. The typical customization needed for edit forms is that you want to render something else for a specific field but you are fine with other defaults. Property Editor Overrides are exactly for that purpose, see the linked documentation for exact examples. If we wanted to, we could replace the Form component entirely and create a new form from scratch using standard Tapestry components. activate handler is never invoked. I will generate a new project and try again but if I dont succeed I will file a jira ? Edit customization is what fails.
Re: [5.3.6] A homepage instead of Index
On Wed, 12 Dec 2012 20:05:51 -0200, Muhammad Gelbana m.gelb...@gmail.com wrote: I think this methodhttp://tapestry.apache.org/5.3.6/apidocs/org/apache/tapestry5/services/linktransform/ComponentEventLinkTransformer.html#decodeComponentEventRequest(org.apache.tapestry5.services.Request) is the closest to what I need but I don't know how can I provide the appropriate *Request* object for it, to generate a *Link*. Just inject it through Tapestryy-IoC. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: custom edit page not possible
You should have mentioned before that you're trying to use Tynamo default pages. We thought it was about regular Tapestry ones, not using Tynamo, so your question is not about Tapestry itself, but about a Tynamo feature. I've never used Tynamo, unfortunately, so I can't help you here. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [5.3.6] A homepage instead of Index
I'm contributing a url to the default start page: public static void contributeApplicationDefaults(MappedConfigurationString, Object configuration) { configuration.add(SymbolConstants.START_PAGE_NAME, my/page); } How can I have a request object to point to my page at this point ? On Thu, Dec 13, 2012 at 1:42 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 12 Dec 2012 20:05:51 -0200, Muhammad Gelbana m.gelb...@gmail.com wrote: I think this methodhttp://tapestry.apache.** org/5.3.6/apidocs/org/apache/**tapestry5/services/**linktransform/** ComponentEventLinkTransformer.**html#**decodeComponentEventRequest(** org.apache.tapestry5.services.**Request)http://tapestry.apache.org/5.3.6/apidocs/org/apache/tapestry5/services/linktransform/ComponentEventLinkTransformer.html#decodeComponentEventRequest(org.apache.tapestry5.services.Request) is the closest to what I need but I don't know how can I provide the appropriate *Request* object for it, to generate a *Link*. Just inject it through Tapestryy-IoC. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: clearing form fields when the user navigates away after loading values
http://tapestry.apache.org/persistent-page-data.html#PersistentPageData-ClearingPersistentFields The method *discardPersistentFieldChanges()* of *ComponentResources* will discard all persistent fields for the page, regardless of which strategy is used to store the property. This will not affect the page in memory, but takes effect for subsequent requests. On Thu, Dec 13, 2012 at 2:50 AM, John j...@quivinco.com wrote: I have a form that uses @Persist page fields. If the user navigates away from the page and then returns, the form i sof course still filled in because all the form fields are in the session. The required behaviour is for the pages persisted fields to be cleared whenever a user navigates to a page page. Obviously I don't want to lose the form values prior to the submit, so FLASH is no good and nor is clearing persisted fields during onActivate. So what do I do? John
RE: custom edit page not possible
Can anyone add to this module to make it a custom edit ? It is currently a custom edit as it sits in my build but I cannot get the activate handler to execute. And blue in the face @At(/{0}/{1}/edit) public class MyDomainObjectEdit { @Inject private ContextValueEncoder contextValueEncoder; @Inject private Messages messages; @Inject private PersistenceService persistenceService; @Inject private DescriptorService descriptorService; @Inject private PageRenderLinkSource pageRenderLinkSource; @Property(write = false) private Class beanType = MyDomainObject.class; @Property private Object bean; @OnEvent(EventConstants.ACTIVATE) Object activate(Class clazz, String id) { if (clazz == null) return Utils.new404(messages); this.bean = contextValueEncoder.toValue(clazz, id); this.beanType = clazz; if (bean == null) return Utils.new404(messages); return null; } @CleanupRender void cleanup() { bean = null; beanType = null; } /** * This tells Tapestry to put type id into the URL, making it * bookmarkable. */ @OnEvent(EventConstants.PASSIVATE) Object[] passivate() { return new Object[] { beanType, bean }; } @Log @CommitAfter @OnEvent(EventConstants.SUCCESS) Link success() { persistenceService.save(bean); return back(); } @OnEvent(cancel) Link back() { return pageRenderLinkSource.createPageRenderLinkWithContext(Show.class, beanType, bean); } public String getListAllLinkMessage() { return TynamoMessages.listAll(messages, beanType); } public String getTitle() { return TynamoMessages.edit(messages, beanType); } }
RE: custom edit page not possible
yikes,... sorry thiago... i thought I was replying into nother group while I got you on the line... tynamo is the better tapestry its the best code base on the planet and operated by the best developers in the world unfortunately, it lacks finish and polish and I am probably the only guy on the planet attempting to perform a custom edit page so I look like a ding dong trying to qa this thing at least I have an eye for the right stuff anyway, i would encourage you to check it out. it was invented by a benevolent engineer named chris nelson i cannot imagine building a web app without it's backing mirror capabilities chris handed it over to some open sourcee's in 2006 ... i actually was a committer to the earlier trails version it would be nice if his best intent was actualized trying to shake it out and not getting very far thanks for trying well maybe it is a tapestry problem... QUESTION: is there a way to specify an additional page directory for your tapestry app? My issue is the app does not know where to find the template... and all goes tohell
RE: custom edit page not possible
here is the actual error An unexpected application exception has occurred.java.lang.RuntimeExceptionPage edit/Coach did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. java/org.tynamo.examples.hibernatesecurity.pages.edit.CoachEdit.java resources/org.tynamo.examples.hibernatesecurity.pages.edit.CoachEdit.tml webapp/edit/CoachEdit.tml I tried locating the template in the two above places but it still does find it. according to tapestry docs, it is valid to locate pages beneath the pages dir and other folders beneath could a render phase method be tripping it up ? package org.tynamo.examples.hibernatesecurity.pages.edit; import org.apache.tapestry5.EventConstants; import org.apache.tapestry5.Link; import org.apache.tapestry5.annotations.CleanupRender; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.OnEvent; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.hibernate.annotations.CommitAfter; import org.apache.tapestry5.ioc.Messages; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.ContextValueEncoder; import org.apache.tapestry5.services.PageRenderLinkSource; import org.tynamo.examples.hibernatesecurity.model.Coach; import org.tynamo.examples.hibernatesecurity.pages.Show; import org.tynamo.routing.annotations.At; import org.tynamo.services.DescriptorService; import org.tynamo.services.PersistenceService; import org.tynamo.util.TynamoMessages; import org.tynamo.util.Utils; /** * Page for editing and updating objects. * * @note: * When extending this page for customization purposes, it's better to copy paste code than trying to use inheritance. * */ @At(value=/{0}/{1}/edit, order = before:Show) public class CoachEdit { @Inject private ContextValueEncoder contextValueEncoder; @Inject private Messages messages; @Inject private PersistenceService persistenceService; @Inject private DescriptorService descriptorService; @Inject private PageRenderLinkSource pageRenderLinkSource; @Property(write = false) private Class beanType = Coach.class; @Property private Object bean; @OnEvent(EventConstants.ACTIVATE) Object activate(Class clazz, String id) { if (clazz == null) return Utils.new404(messages); this.bean = contextValueEncoder.toValue(clazz, id); this.beanType = clazz; if (bean == null) return Utils.new404(messages); return null; } @CleanupRender void cleanup() { bean = null; beanType = null; } /** * This tells Tapestry to put type id into the URL, making it bookmarkable. */ @OnEvent(EventConstants.PASSIVATE) Object[] passivate() { return new Object[]{beanType, bean}; } @Log @CommitAfter @OnEvent(EventConstants.SUCCESS) Link success() { persistenceService.save(bean); return back(); } @OnEvent(cancel) Link back() { return pageRenderLinkSource.createPageRenderLinkWithContext(Show.class, beanType, bean); } public String getListAllLinkMessage() { return TynamoMessages.listAll(messages, beanType); } public String getTitle() { return TynamoMessages.edit(messages, beanType); } }
RE: custom edit page not possible
The problem with my webapp is it keeps going into my resources dir for templates instead of the webapp context dir for templates. There has been some back and forth about this in the past and I am not sure what the canonical way is. It seems components can live in the webapp context dir fine. Thiago, would you know how to configure tapestry to look in one or the other or both directories ? being the resources dir versus the webapp context dir ? Thanks
Re: Component that displays additional containing Page markup
Hi Bogdan! Any reason why you can not use tapestry's grid component? Jens Sent from my iPhone On 12.12.2012, at 15:43, bogdan_cm bogdan.iva...@rbccm.com wrote: Thank you both for replying. Now that I read it after a day, my question is not very clear. Here is a more to the point explanation. My custom component will take care of pagination. This means I need my component to wrap around a Loop in the main page. The Loop will be iterating over a List of results. The code I am hoping for is: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; -- tapestry Page t:myPaginationComponent params= (will tie pagination variables from page to component params) loop ... html that displays list entries /loop /t:myPaginationComponent /html I will explore the block suggestion. Thanks very much, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718645.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