Tapestry 5 in Action book
Hi guys, Is tapestry5 in action book ready yet? I really need it [?] . I am very willing to buy it as it is from the author if it is not yet available in Manning. Kindly let me know if its possible to buy a copy directly from the author via say paypal. Kind regards. Josh.
Re: T5.2: Javascript document.getElementById() after zone update
It is changing indeed. So I guess I will try using getElementsByClassName( 'i-can-constant')[0] instead. Thanks. - Original Message - From: Taha Hafeez tawus.tapes...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Sunday, March 6, 2011 4:50:07 AM Subject: Re: T5.2: Javascript document.getElementById() after zone update Hi When you click 'View Source Code' in a browser, it shows you the html loaded first time the page was loaded and does not show the dom changes done using ajax. If you want to see the latest dom, install firebug on firefox(chrome has a very similar one by default) and enable it by clicking on the bug icon on the status bar. Also, how are using getting the element id of select in your javascript ? regards Taha On Sun, Mar 6, 2011 at 10:02 AM, Josh Canfield joshcanfi...@gmail.comwrote: If it's in the zone then the id is probably changing. How are you determining that its staying the same? Try using a class instead of id? On Mar 5, 2011 6:45 PM, Sérgio Esteves sergio.este...@xpand-it.com wrote: Hi all, At the end of a zone block, I call a JS function which tries to get an element (that is also inside the zone) by calling document.getElementById('componentSelectId'). The first time the page loads and the zone is rendered everything works as it should. Although, when I update the zone, by changing the value of a select component, the JS gets executed, but document.getElementById('componentSelectId') returns null. Looking at the page source on the web browser I can see that the element is there with the very same id. Anybody can tell what is going on here? Thanks.
Re: Exception starting filter test
Just a guess, but normally the filter is named app instead of app1. The filter name affects the name of the app module class Tapestry looks for. See http://tapestry.apache.org/configuration.html On Sat, Mar 5, 2011 at 12:46 AM, raj1jaiswal raj1jais...@yahoo.co.in wrote: http://tapestry.1045711.n5.nabble.com/file/n3410456/web.xml web.xml Hi, I have attached web.xml. Thanks Raj jaiswal -- View this message in context: http://tapestry.1045711.n5.nabble.com/Exception-starting-filter-test-tp3407524p3410456.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: Invoke method after page is loaded; when method finishes, redirect to another page
Thanks all for the tips! I must admit I looked into all your suggestions and links, but wasn't able to get my head around them. But I managed to come up with the workaround. Since I'm using JQuery Tapestry module, I was able to display ajax loader icon and appropriate text on the form submit. This code will actually be invoked before the form submit. script $(#keywordsForm).submit(function () { $(#loadingText).html('img src=${context:images/ajax-loader.gif} / Please wait.'); }); /script Thanks anyway, I appreciate it! Best, Nikola Email: nikola.mili...@gmail.com URL: nikola.milikic.info On Fri, Mar 4, 2011 at 4:41 PM, Kalle Korhonen kalle.o.korho...@gmail.comwrote: You don't need multiple pages for it, you can just do it all in one page if you don't mind some ajax (no scripting needed). ProgressiveDisplay is ideal for this ( http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html ). Kalle On Fri, Mar 4, 2011 at 4:37 AM, LLTYK ll...@mailinator.com wrote: Use a meta refresh (it'll probably have to be in the tag somehow). Or javascript, to hit the same url. @Inject private ComponentResources componentResources; @OnEvent(calculate) ResultPage calculate() { } public String getCalculateUrl() { return componentResources.createEventLink(calculate).toString(); } -- View this message in context: http://tapestry-users.832.n2.nabble.com/Invoke-method-after-page-is-loaded-when-method-finishes-redirect-to-another-page-tp6088155p6088324.html Sent from the Tapestry Users 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
null property
Hi all, I'm new to Tapestry, and I have a problem with a simple Login form. When in the OnSubmit callback of the form, the login and pasword fields are empty. Could someone help me at least understand why? Here is my loginForm class: public class LoginForm { @Persist(PersistenceConstants.FLASH) private String loginMessage; @Property private String loginEmail; @Property private String loginPassword; @Component private Form loginForm; @Inject private Authenticator authenticator; public Object onActionFromLoginForm() { try { authenticator.login(loginEmail, loginPassword); return Index.class; } catch (AuthenticationException ex) { setLoginMessage(Invalid user name or password.); } return null; } public void setLoginMessage(String loginMessage) { this.loginMessage = loginMessage; } public String getLoginMessage() { if (loginMessage != null) { return loginMessage; } else { return ; } } } here is the loginForm template ${loginMessage} -- View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411636.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: null property
Sorry for double posting. But this time, the formatting should be ok Hi all, I'm new to Tapestry, and I have a problem with a simple Login form. When in the OnSubmit callback of the form, the login and pasword fields are empty. Could someone help me at least understand why? Here is my loginForm class: vdelanno wrote: public class LoginForm { @Persist(PersistenceConstants.FLASH) private String loginMessage; @Property private String loginEmail; @Property private String loginPassword; @Component private Form loginForm; @Inject private Authenticator authenticator; public Object onActionFromLoginForm() { try { authenticator.login(loginEmail, loginPassword); return Index.class; } catch (AuthenticationException ex) { setLoginMessage(Invalid user name or password.); } return null; } public void setLoginMessage(String loginMessage) { this.loginMessage = loginMessage; } public String getLoginMessage() { if (loginMessage != null) { return loginMessage; } else { return ; } } } here is the loginForm template vdelanno wrote: ${loginMessage} -- View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411646.html Sent from the Tapestry - User mailing list archive at Nabble.com.
Re: null property
Hi If you want the values to be retained accross pages , Use @Persist annotation on the pages @Property @Persist private String loginEmail; @Property @Persist private String loginPassword; kind regards.
Re: null property
Thqnks for the reply But I donùt want them to be available accross pages, just from the Form submit handler. RIght now, in the onActionFromLoginForm, loginPassword and loginEmail are null, whatever the value I enter in the input. Am I wrong? I shouldnùt have to persist the values just to use them in the submit handler -- View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411708.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: null property
Look at the docs for form. You don't want to catch action, you probably want success or validate On Mar 6, 2011 12:04 PM, vdelanno vincent.delan...@gmail.com wrote: Thqnks for the reply But I donùt want them to be available accross pages, just from the Form submit handler. RIght now, in the onActionFromLoginForm, loginPassword and loginEmail are null, whatever the value I enter in the input. Am I wrong? I shouldnùt have to persist the values just to use them in the submit handler -- View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411708.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
waitForPage / onDOMLoaded hybrid
Hi all, i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Kind of how Tapestry.waitForPage works, except that if the page has not loaded, instead of showing a dialog, it would register it for invoking once the page is loaded. so in psuedo: function(callback) { if(Tapestry.pageLoaded) invoke(callback); else Tapestry.onDOMLoaded(callback); } 2 questions: a) is this functionality already available? where? b) would the above approach be fool-proof? ie would there be a case where Tapestry.pageLoaded == false and Tapestry.onDOMLoaded would still not invoke the callback? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
In lieu of a better (tapestry provided) solution, this is what i'm using. It seems to work, but I can see the need to make the callbacks parameterised in the future (which currently isn't supported by Tapestry.onDOMLoaded) function callWhenPageLoaded(callback) { if (typeof(Tapestry) == undefined) throw(callWhenPageLoaded called too early); if (Tapestry.pageLoaded) callback.call(this); else Tapestry.onDOMLoaded(callback); } If something like this doesn't exist in tapestry already, I think it should. p. On 7/03/2011 9:44 AM, Paul Stanton wrote: Hi all, i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Kind of how Tapestry.waitForPage works, except that if the page has not loaded, instead of showing a dialog, it would register it for invoking once the page is loaded. so in psuedo: function(callback) { if(Tapestry.pageLoaded) invoke(callback); else Tapestry.onDOMLoaded(callback); } 2 questions: a) is this functionality already available? where? b) would the above approach be fool-proof? ie would there be a case where Tapestry.pageLoaded == false and Tapestry.onDOMLoaded would still not invoke the callback? thanks, p. - 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: waitForPage / onDOMLoaded hybrid
On Sun, 06 Mar 2011 19:44:09 -0300, Paul Stanton p...@mapshed.com.au wrote: Hi all, Hi! i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Have you tried adding the call to this function using RenderSupport.addScript()? It seems to do exactly what you need. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: null property
On Sun, 06 Mar 2011 17:04:02 -0300, vdelanno vincent.delan...@gmail.com wrote: Thqnks for the reply But I donùt want them to be available accross pages, just from the Form submit handler. @Persist doesn't make values available accross pages. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: null property
Even if email is Annotated with persist, the value in the onSuccess is null. But the value is effectively stored for the next display. I don't expect to have to store the password with a Persist annotation anyway. Even if I copy paste this page: http://tapestry.apache.org/input-validation.html I have the same problem. Would somebody have a solution? -- View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411824.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: null property
On Sun, 06 Mar 2011 20:39:20 -0300, vdelanno vincent.delan...@gmail.com wrote: Even if email is Annotated with persist, the value in the onSuccess is null. But the value is effectively stored for the next display. I don't expect to have to store the password with a Persist annotation anyway. How are you checking if the fields are null? Debugging doesn't always show the current field values due to the way Tapestry transforms page and component classes. This will be fixed when not in production mode in T5.3. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
seems to work, but I can see the need to make the callbacks parameterised in the future (which currently isn't supported by Tapestry.onDOMLoaded) Callbacks are closures, why do you need parameters? If something like this doesn't exist in tapestry already, I think it should. I don't think we need to replicate functionality provided by javascript libraries. Josh On Sun, Mar 6, 2011 at 3:12 PM, Paul Stanton p...@mapshed.com.au wrote: In lieu of a better (tapestry provided) solution, this is what i'm using. It seems to work, but I can see the need to make the callbacks parameterised in the future (which currently isn't supported by Tapestry.onDOMLoaded) function callWhenPageLoaded(callback) { if (typeof(Tapestry) == undefined) throw(callWhenPageLoaded called too early); if (Tapestry.pageLoaded) callback.call(this); else Tapestry.onDOMLoaded(callback); } If something like this doesn't exist in tapestry already, I think it should. p. On 7/03/2011 9:44 AM, Paul Stanton wrote: Hi all, i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Kind of how Tapestry.waitForPage works, except that if the page has not loaded, instead of showing a dialog, it would register it for invoking once the page is loaded. so in psuedo: function(callback) { if(Tapestry.pageLoaded) invoke(callback); else Tapestry.onDOMLoaded(callback); } 2 questions: a) is this functionality already available? where? b) would the above approach be fool-proof? ie would there be a case where Tapestry.pageLoaded == false and Tapestry.onDOMLoaded would still not invoke the callback? thanks, p. - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
RenderSupport.addScript is server side, not client side. (right?) I need to do this from a JS and in another case from a TML. It's a complicated structure and not easy to re-model to suit. p. On 7/03/2011 10:38 AM, Thiago H. de Paula Figueiredo wrote: On Sun, 06 Mar 2011 19:44:09 -0300, Paul Stanton p...@mapshed.com.au wrote: Hi all, Hi! i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Have you tried adding the call to this function using RenderSupport.addScript()? It seems to do exactly what you need. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
I don't think we need to replicate functionality provided by javascript libraries. Tapestry provides onDOMLoaded and waitForPage .. the functionality I describe isn't provided by Tapestry or a javascript library (since the js lib would need to know about the Tapestry js api). I'm not sure what you mean by that statement Josh, I'm proposing a useful utility method inseparable from the tapestry js api so that other users don't have to write and embed the method themselves also. p. On 7/03/2011 10:44 AM, Josh Canfield wrote: seems to work, but I can see the need to make the callbacks parameterised in the future (which currently isn't supported by Tapestry.onDOMLoaded) Callbacks are closures, why do you need parameters? If something like this doesn't exist in tapestry already, I think it should. I don't think we need to replicate functionality provided by javascript libraries. Josh On Sun, Mar 6, 2011 at 3:12 PM, Paul Stantonp...@mapshed.com.au wrote: In lieu of a better (tapestry provided) solution, this is what i'm using. It seems to work, but I can see the need to make the callbacks parameterised in the future (which currently isn't supported by Tapestry.onDOMLoaded) function callWhenPageLoaded(callback) { if (typeof(Tapestry) == undefined) throw(callWhenPageLoaded called too early); if (Tapestry.pageLoaded) callback.call(this); else Tapestry.onDOMLoaded(callback); } If something like this doesn't exist in tapestry already, I think it should. p. On 7/03/2011 9:44 AM, Paul Stanton wrote: Hi all, i'm using tapestry 5.1.0.5 on this particular project. I'm not 100% sure this isn't already available, but before duplicating logic i thought I'd check... I need to be able to call a function at any point in the page state (ie before it's loaded, during loading, after load) but have it wait until tapestry.init has been called. Kind of how Tapestry.waitForPage works, except that if the page has not loaded, instead of showing a dialog, it would register it for invoking once the page is loaded. so in psuedo: function(callback) { if(Tapestry.pageLoaded) invoke(callback); else Tapestry.onDOMLoaded(callback); } 2 questions: a) is this functionality already available? where? b) would the above approach be fool-proof? ie would there be a case where Tapestry.pageLoaded == false and Tapestry.onDOMLoaded would still not invoke the callback? thanks, p. - 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 - 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: waitForPage / onDOMLoaded hybrid
On Sun, 06 Mar 2011 20:49:49 -0300, Paul Stanton p...@mapshed.com.au wrote: RenderSupport.addScript is server side, not client side. (right?) It's server side and generates client-side code. I need to do this from a JS and in another case from a TML. It's a complicated structure and not easy to re-model to suit. Just implement it as a mixin. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
I think it would be better to provide this without going back to the server. On 7/03/2011 10:54 AM, Thiago H. de Paula Figueiredo wrote: On Sun, 06 Mar 2011 20:49:49 -0300, Paul Stanton p...@mapshed.com.au wrote: RenderSupport.addScript is server side, not client side. (right?) It's server side and generates client-side code. I need to do this from a JS and in another case from a TML. It's a complicated structure and not easy to re-model to suit. Just implement it as a mixin. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: waitForPage / onDOMLoaded hybrid
On Sun, 06 Mar 2011 21:58:02 -0300, Paul Stanton p...@mapshed.com.au wrote: I think it would be better to provide this without going back to the server. It doesn't go back to the server. Anything added by RenderSupport.addScript() (JavaScriptSupport in T5.2.4) is added inside a JavaScript block inside body: Tapestry.onDOMLoaded(function() { ... // your JavaScript code added through addScript() here }); Check the source of any page generated by Tapestry and you'll find this as the last script element inside the body -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Exception starting filter test
Hi bobharner , Thanks for reply. Raj jaiswal MCA SCJP. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Exception-starting-filter-test-tp3407524p3411937.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: Exception starting filter test
hi bobharner , I have seen whatever link you sent to me.But there clearly mention you can take any name instead of app.anyway i changed it app1 to app as you said and run the application but i am still getting same exception. By convention, the filter name (filter-name) is almost always app, but you can use any name you want. Tapestry uses this to determine what module class name to look for . Please find solution, Thanks in Advance Raj Jaiswal MCA SCJP1.6 -- View this message in context: http://tapestry.1045711.n5.nabble.com/Exception-starting-filter-test-tp3407524p3411970.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