Re: Form and session
2010/6/24 Josh Canfield joshcanfi...@gmail.com Yes, this is a problem. I believe there is already a jira filed but can't search right now. I had a workaround for 5.1.18 but doesn't work in current versions... Yes, I found it: https://issues.apache.org/jira/browse/TAP5-979 Fixed in 5.2. I hope it will be released soon. Thanks Lukasz
Re: Wanted: example of AJAX in a client-side validator
That's a shame. See what you think of the solution I will post shortly. Similar, or a different tack? On 24/06/2010, at 3:08 AM, Howard Lewis Ship wrote: I have some examples of fields that check that a user name or email address is unique, but its too tied into the rest of my apps code to break out easily. On Thu, Jun 17, 2010 at 6:20 PM, Geoff Callender geoff.callender.jumpst...@gmail.com wrote: Hi all, I'd like to add an example or two to JumpStart of AJAX in a client-side validator but I don't have any handy. If you have a simple example of this that you'd like to throw into the mix then please post it here or, if you prefer, mail it to me directly. I figure there may be more than one way of implementing this, so the more solutions the better! Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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: Wanted: example of AJAX in a client-side validator
I've knocked up a solution, a reusable mixin called AjaxValidate. It's loosely based on Inge's ZoneUpdater and OnEvent (many thanks, Inge). Please post suggestions on how to improve it! Example of usage: input t:type=TextField t:id=firstName t:validate=required, maxlength=10 t:mixins=ajaxValidate size=10/ ...and in your page or component: Object onAjaxValidateFromFirstName() { String firstName = _request.getParameter(param); try { validateFirstName(firstName); return new JSONObject(); } catch (Exception e) { return new JSONObject().put(error, e.getMessage()); } } Here's the mixin - AjaxValidate.java: @IncludeJavaScriptLibrary(ajax_validate.js) public class AjaxValidate { // Parameters @Parameter(defaultPrefix = BindingConstants.LITERAL, value = default) private String prefix; // Useful bits and pieces @Inject private ComponentResources resources; @Environmental private RenderSupport renderSupport; /** * The element we attach ourselves to */ @InjectContainer private ClientElement element; // The code void afterRender() { String listenerURI = resources.createEventLink(ajaxValidate).toAbsoluteURI(); String elementId = element.getClientId(); JSONObject spec = new JSONObject(); spec.put(listenerURI, listenerURI); spec.put(elementId, elementId); renderSupport.addScript(%sAjaxValidate = new AjaxValidate(%s), prefix, spec.toString()); } } ajax_validate.js: function addRequestParameter(name, value, url) { if (url.indexOf('?') 0) { url += '?' } else { url += ''; } value = escape(value); url += name + '=' + value; return url; } var AjaxValidate = Class.create({ initialize : function(spec) { this.element = $(spec.elementId); this.listenerURI = spec.listenerURI; // After client-side validators have completed normally we asynchronously validate in the server. this.element.observe(Tapestry.FIELD_VALIDATE_EVENT, this.asyncValidateInServer.bindAsEventListener(this)); }, asyncValidateInServer : function() { var value = this.element.value; var listenerURIWithParam = this.listenerURI; if (value) { listenerURIWithParam = addRequestParameter('param', value, this.listenerURI); } new Ajax.Request(listenerURIWithParam, { method: 'get', onFailure: function(t) { alert('Error communication with the server: ' + t.responseText.stripTags()); }, onException: function(t, exception) { alert('Error communication with the server: ' + exception.message); }, onSuccess: function(t) { if (t.responseJSON.error) { this.element.showValidationMessage(t.responseJSON.error); } }.bind(this) }); } }); On 23/06/2010, at 8:08 PM, Geoff Callender wrote: Maybe it would be simpler to use a mixin, one that calls back to showValidationMessage()? Yes, please post it. On 23/06/2010, at 3:49 AM, Katia Aresti Gonzalez wrote: I have an example with a mixin ... it's in not very very simple, but i can simplify the mixin for your example... ^_^ 2010/6/20 Geoff Callender geoff.callender.jumpst...@gmail.com Surely someone has an example of this? On 18/06/2010, at 12:51 PM, Geoff Callender wrote: Thanks, Thiago, but it lacks AJAX. I'd like the validator to behave like any other client-side validator except that it asks the server to help, eg. to validate that a name has not already been used. Geoff On 18/06/2010, at 12:24 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 17 Jun 2010 22:20:45 -0300, Geoff Callender geoff.callender.jumpst...@gmail.com wrote: Hi all, Hi! This is an example of a RGB string validator that I created for my Tapestry courses (basic and advanced): public class RGBValidator extends AbstractValidatorVoid, String { final private static Pattern PATTERN = Pattern.compile([0-9A-Fa-f]{6}); final private RenderSupport renderSupport; final private Asset javascript; public RGBValidator( AssetSource assetSource, RenderSupport
Calling all Tapestry Developers
Hi all, I would just like to get the message out to all Tapestry developers and fans that we are recruiting for Java / Tapestry people to join our ever growing technical development team based in central London (Piccadilly Circus). We are Gamesys Ltd, an award winning online gaming company of which you can find out more about us at www.gamesys.co.uk We are looking for real technical enthusiasts who believe in Agile principles and quality coding. We offer an attractive package and a fun and exciting place to wortk. If you or anyone you know is interested in speaking to us then please send your details to h...@gamesys.co.uk Kind regards James -- View this message in context: http://old.nabble.com/Calling-all-Tapestry-Developers-tp28980738p28980738.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: decorateClientInfrastructure not called anymore
Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris
decorateClientInfrastructure not called anymore
Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: decorateClientInfrastructure not called anymore
Hi Which service are you trying to decorate ? 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com
Re: decorateClientInfrastructure not called anymore
oups i should read the title :) 2010/6/24 Christophe Cordenier christophe.corden...@gmail.com Hi Which service are you trying to decorate ? 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com
decorateClientInfrastructure not called anymore
Hi I tried to decorate ClientInfrastructure. With the old tapestry version it was called, then i changed only the tapestry version to 5.2.0-SNAPSHOT afterwards the method wasn't called anymore. Also i tried with the PageTemplateLocator public PageTemplateLocator decoratePageTemplateLocator(final PageTemplateLocator original) { System.out.println(decoratePageTemplateLocator); return null; } The message decoratePageTemplateLocator was never printed out. br chris On 24.06.2010, at 13:38, Christophe Cordenier wrote: Hi Which service are you trying to decorate ? 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com Christian Koller Sofwareentwickler net mobile Schweiz AG Seestrasse 45 CH ñ 8702 Zollikon Tel: + 41 (0) 44 918 99 99 Fax: + 41 (0) 44 918 99 98 Direkt: + 41 (0) 44 918 99 72 Mail: christian.kol...@net-m.ch Web: www.net-m.ch
Re: decorateClientInfrastructure not called anymore
Hi Are your services loaded ? Is your module class correctly loaded (see stack on startup) 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi I tried to decorate ClientInfrastructure. With the old tapestry version it was called, then i changed only the tapestry version to 5.2.0-SNAPSHOT afterwards the method wasn't called anymore. Also i tried with the PageTemplateLocator public PageTemplateLocator decoratePageTemplateLocator(final PageTemplateLocator original) { System.out.println(decoratePageTemplateLocator); return null; } The message decoratePageTemplateLocator was never printed out. br chris On 24.06.2010, at 13:38, Christophe Cordenier wrote: Hi Which service are you trying to decorate ? 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com Christian Koller Sofwareentwickler net mobile Schweiz AG Seestrasse 45 CH ñ 8702 Zollikon Tel: + 41 (0) 44 918 99 99 Fax: + 41 (0) 44 918 99 98 Direkt: + 41 (0) 44 918 99 72 Mail: christian.kol...@net-m.ch Web: www.net-m.ch -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com
decorateClientInfrastructure not called anymore
Hi 14:20:08.279 [main] INFO o.a.tapestry5.ioc.RegistryBuilder - Adding module definition for class net.netm.portals.tapestry.example.services.TapestryExampleModule 14:20:08.821 [main] INFO n.n.p.t.e.s.TapestryExampleModule - adding coercion thats what I see in the stack on startup. No errors or something. On 24.06.2010, at 14:06, Christophe Cordenier wrote: Hi Are your services loaded ? Is your module class correctly loaded (see stack on startup) 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi I tried to decorate ClientInfrastructure. With the old tapestry version it was called, then i changed only the tapestry version to 5.2.0-SNAPSHOT afterwards the method wasn't called anymore. Also i tried with the PageTemplateLocator public PageTemplateLocator decoratePageTemplateLocator(final PageTemplateLocator original) { System.out.println(decoratePageTemplateLocator); return null; } The message decoratePageTemplateLocator was never printed out. br chris On 24.06.2010, at 13:38, Christophe Cordenier wrote: Hi Which service are you trying to decorate ? 2010/6/24 Christian Koller christian.kol...@net-m.ch Hi kris Thank you for your response. I'll try out Advisors now. Still decoration isn't working for me. Has someone faced the same problem? thx chris On 24.06.2010, at 12:24, Kristian Marinkovic wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von:Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff:decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com Christian Koller Sofwareentwickler net mobile Schweiz AG Seestrasse 45 CH ñ 8702 Zollikon Tel: + 41 (0) 44 918 99 99 Fax: + 41 (0) 44 918 99 98 Direkt: + 41 (0) 44 918 99 72 Mail: christian.kol...@net-m.ch Web: www.net-m.ch -- Regards, Christophe Cordenier. Developer of wooki @wookicentral.com Christian Koller Sofwareentwickler net mobile Schweiz AG Seestrasse 45 CH ñ 8702 Zollikon Tel: + 41 (0) 44 918 99 99 Fax: + 41 (0) 44 918 99 98 Direkt: + 41 (0) 44 918 99 72 Mail: christian.kol...@net-m.ch Web: www.net-m.ch
Logging to file problem
Hi there, I'm struggling with logging in my appl. I'm able log my messages to Console but not able to write my messages to file. Strange is that messages are logged to file from Tapestry and Spring but my own messages are missing there. So in log file are only internal messages from Tapestry, Spring and so on. For logging in my pages I inject Logger service by @Inject, in my services I obtain logger like this: logger = org.slf4j.LoggerFactory.getLogger(this.getClass()); My log4j.properties: log4j.rootLogger=ALL, Console, FILE log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout log4j.appender.Console.layout.ConversionPattern=%d{ISO8601}-%c- %p --%m%n log4j.appender.FILE=org.apache.log4j.RollingFileAppender log4j.appender.FILE.append=true log4j.appender.FILE.MaxFileSize=1MB log4j.appender.FILE.MaxBackupIndex=5 log4j.appender.FILE.File=/home/libor/Temp/paWeb/log/paWeb.log log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601}-%-5p [%t] %c{2} - %m%n log4j.category.net.gmc=trace log4j.category.java.sql=warn #log4j.category.org.apache.tapestry5=warn #log4j.category.org.springframework=warn If I uncomment last two lines, logging to log file stoped, in console everything works great. Any ideas? Libor -- View this message in context: http://old.nabble.com/Logging-to-file-problem-tp28982316p28982316.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
BeanEditor Listener
Hi Everyone I want to know if there is a way that I can take an original bean object i.e. User which gets passed to component BeanEditForm, then when certain values are changed in the bean, the on Validate method will ONLY call the applicable validation methods for the fields values that have changed. In the case when you have a Cayenne DAO listener and work with the Object Context with a callback to determine which field's values have changed, however not so in the case of a bean. As I am obfuscating from DAO, is there a way that I can check which field values have changed in a Bean ? Many thanks Eldred
Layout Component
Dear listeners! I have a module with pages and components which is used by some other applications. Every application has its own style, defined in a layout component. Is there a possibility that this module can use the layout component of every other application at runtime? For better understanding see the example below: In the module I have following page definition: Module.tml div t:id=layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; Body Content/ /div Module.java public class Module{ @Component private Layout layout; ... } Layout.tml html xmlns=http://www.w3.org/1999/xhtml; xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; div header.../div body t:body / /body /html Now this module is used by different applications. Application 1 defines its own layout component and application 2 defines another layout component. Is there a way to override the LayoutComponent of the Module at runtime (delegate comes in my mind...), allthough the Module has no dependency on the other applications, but the other applications include the Module as a maven dependency. Best regards, Gerry -- View this message in context: http://old.nabble.com/Layout-Component-tp28983922p28983922.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: decorateClientInfrastructure not called anymore
Actually, decorators are used when you know, and compile time, what interface the service implements and you want to provide a specific object, implementing that interface, as the interceptor (the wrapper around the core service implementation). Advice is used when you want to dynamically analyze the service interface, whatever it is, adding ComponentMethodAdvice to individual methods. Making specific changes to a known interface is easier using decoration, such as extending a known existing service to add new features. On the other hand, wide-ranging concerns (such as logging or transaction management or security) can be handled best using advice. Unfortunately, they don't mix, due to the evolution of the underlying APIs (decoration was implemented first, advice came a couple of years later). The end result is that all decoration executes before any advice, with the core service implementation being at the end of the chain. On Thu, Jun 24, 2010 at 3:24 AM, Kristian Marinkovic kristian.marinko...@porsche.co.at wrote: Hi Christian, Advices have been introduced in 5.1 to replace decorators. please see: http://tapestry.apache.org/tapestry5.1/tapestry-ioc/advice.html the 5.2-SNAPSHOT documentation does not state that decorators are not supported anymore. the last time i was playing with 5.2 (some weeks ago) my decorators worked. g, kris Von: Christian Koller christian.kol...@net-m.ch An: users@tapestry.apache.org Datum: 23.06.2010 16:38 Betreff: decorateClientInfrastructure not called anymore Hello everyone Since we updated the version of tapestry from 5.1.0.5 to 5.2.0-SNAPSHOT the decorate methods in the module class are not called anymore. Is there a new concept to decorate a service or is it a bug? Please let me know if you know something. Thanks chris -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
You need to make sure that the form's zone parameter is set to the id and not just the t:id of the Zone. I started generating my own xml id's from a root name and the actual database id of the object I was about to use. I can't speak to mixing in the custom javascript, except that when the Ajax submit is working properly, the response should effectively clear the display:none that you just set before sending the request. Your response need's to indicate that the style of the form should be hidden - or don't even return a form, return some text to indicate it's been dealt with. If that is the case, then you won't need the custom javascript anyway. You might also want to consider setting the context of the form. I've bumped my head on problems with loop state and forms before, but it does depend what you are looping over. Nested loops can be fun. JB On Thu, Jun 24, 2010 at 12:52 AM, SakshiAgarwal sakshi.a...@gmail.comwrote: Hi, I did check this example, but it helped me only to some extent. The main problem in my case is: the structure of my TML file is like this: Loop Zone Form (defined photoZOne here) Submit the main problem is: counter value for first form does not function properly...it gives very unpredictable results..for rest of the subsequent forms ( from the loop) works properly... Any suggestions/advice ? http://old.nabble.com/file/p28978902/photos.tml photos.tml I hope I am clear in my problem stmt. Looking fwd for solution for my problem. regards sakshi P.S. The reason I use zone here is: I have 'reported catergory' attached to each photo. and if I disapprove I need to submit it with the reason i.e. 'reported category' that particular photo. So i can't submit the entire form( as it contains multiple photos). I also need to add java script in my code as I want to hide the photo as soon as i take action on it. (i.e. approve/disapprove) Looked at many examples but nothing works fine with everything in place, i.e. zone,loop,form,javascript all together Geoff Callender-2 wrote: Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.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 -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28978902.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 -- Jonathan Barker ITStrategic
Re: T5: Dashboard Application
Thanks for the feedback - I believe I have immplemented the strategy described using the ComponentSource method (as opposed to using blocks) in the previous thread. The problem I'm seeing is that I have a component that is rendered 3 times on a page with a different panel context An example of one of the sub-components contains a eventlink - i.e.: lt;a t:type=EventLink t:event=action t:context=item.namegt;Actionlt;/agt; If I just use a basic delegate using local blocks (the bad way) the component renders the link as follows: ./layout10.l10p1.panelview.modulesstatus.modulespanel:events/Item1;jsessionid=11958h6hgb6v0 ./layout10.l10p2.panelview.modulesstatus.modulespanel:events/Item1;jsessionid=11958h6hgb6v0 ./layout10.l10p3.panelview.modulesstatus.modulespanel:events/Item1;jsessionid=11958h6hgb6v0 The fact the page path is different means if I @Persist the context when the link is clicked the context is recovered and the component can perform the correct operation. If I contrast this with how the link is rendered if I use the suggested strategy: ./layout10.modulesstatuspanel.modulespanel:events/Item1;jsessionid=oltcn58w7mpt?t:cp=panels/panelcomponents ./layout10.modulesstatuspanel.modulespanel:events/Item1;jsessionid=oltcn58w7mpt?t:cp=panels/panelcomponents ./layout10.modulesstatuspanel.modulespanel:events/Item1;jsessionid=oltcn58w7mpt?t:cp=panels/panelcomponents All the links are identical and needless to say the effect is only the last component on the page actually functions when you click on the link. I've seen in other threads that using @Persist in components is a bad idea (which I can understand) but I'm at a loss to understand when a component is being reused and contains events that interact with it how to ensure the original context is somehow presented back to the component so it can interpret the event correctly. Any suggestions gratefully received, this really is vexing me. Regards, Scyta1e Thiago H. de Paula Figueiredo wrote: On Mon, 21 Jun 2010 16:06:38 -0300, Pierce Wetter pie...@paceap.com wrote: More broadly speaking has anyone managed to implement a dashboard style application (i.e.layouts/panels) and what is the correct pattern to use? I'm not a T5 expert, but I think you want to use a delegate. A very recent thread in this list has the solution for your problem: http://old.nabble.com/T5%3A-Using-the-strategy-pattern-with-components.-to28933790s302.html -- 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 -- View this message in context: http://old.nabble.com/T5%3A-Dashboard-Application-tp28949567p28986705.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
Accessing tapestry's hibernate instance from a quartz job
I have a T5 application connected to a database using hibernate working fine. To perform background operations on the database, I have a quartz scheduler servlet included in the same project that calls the background job as expected. I would like to get an instance of tapestry's hibernate session to access the database and reference the same entity objects. Is it possible to get an instance of tapestry's hibernate session from this quartz job? I have searched google and the mailing list but haven't found an answer to this yet. I know straight injection doesn't work. I have found a way to manually setup a second hibernate instance but that requires some duplicate settings and a set of hbm.xml files that aren't required by tapestry. Using this second way seems a lot of extra work and a maintenance nightmare if there is a way to get tapestry's hibernate instance.
Re: Accessing tapestry's hibernate instance from a quartz job
Well, within a single JVM, Tapestry IoC service proxies will serialize and de-serialize correctly. So, you can inject the Session into some code that creates a Quartz job, storing the Session in an instance variable. However, you'll miss out on a few things; you need a wrapper around executing Quartz jobs, one that invokes the PerThreadManager's cleanup() method. This makes sure per-thread object instances are properly discarded. I'll be doing some work in Quartz (w/ Hibernate) in the near future and I expect to spin off what I write into a tapx module, and a Tapestry module in the 5.3 timeframe. On Thu, Jun 24, 2010 at 2:31 PM, Stephen Hogarth shoga...@slb.com wrote: I have a T5 application connected to a database using hibernate working fine. To perform background operations on the database, I have a quartz scheduler servlet included in the same project that calls the background job as expected. I would like to get an instance of tapestry's hibernate session to access the database and reference the same entity objects. Is it possible to get an instance of tapestry's hibernate session from this quartz job? I have searched google and the mailing list but haven't found an answer to this yet. I know straight injection doesn't work. I have found a way to manually setup a second hibernate instance but that requires some duplicate settings and a set of hbm.xml files that aren't required by tapestry. Using this second way seems a lot of extra work and a maintenance nightmare if there is a way to get tapestry's hibernate instance. -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Accessing tapestry's hibernate instance from a quartz job
Chenillekit provides Quartz integration module - http://chenillekit.codehaus.org/chenillekit-quartz/index.html. Been using it for more than a year now. Kalle On Thu, Jun 24, 2010 at 7:32 PM, Howard Lewis Ship hls...@gmail.com wrote: Well, within a single JVM, Tapestry IoC service proxies will serialize and de-serialize correctly. So, you can inject the Session into some code that creates a Quartz job, storing the Session in an instance variable. However, you'll miss out on a few things; you need a wrapper around executing Quartz jobs, one that invokes the PerThreadManager's cleanup() method. This makes sure per-thread object instances are properly discarded. I'll be doing some work in Quartz (w/ Hibernate) in the near future and I expect to spin off what I write into a tapx module, and a Tapestry module in the 5.3 timeframe. On Thu, Jun 24, 2010 at 2:31 PM, Stephen Hogarth shoga...@slb.com wrote: I have a T5 application connected to a database using hibernate working fine. To perform background operations on the database, I have a quartz scheduler servlet included in the same project that calls the background job as expected. I would like to get an instance of tapestry's hibernate session to access the database and reference the same entity objects. Is it possible to get an instance of tapestry's hibernate session from this quartz job? I have searched google and the mailing list but haven't found an answer to this yet. I know straight injection doesn't work. I have found a way to manually setup a second hibernate instance but that requires some duplicate settings and a set of hbm.xml files that aren't required by tapestry. Using this second way seems a lot of extra work and a maintenance nightmare if there is a way to get tapestry's hibernate instance. -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Thanks a lot..now this works for me...I am so happy about it as I have been struggling through it since many days... my another doubt is - if i replace submit component with linksubmit; my javascript method onclick is not getting invoked... Whereas, if i use JSON or mixin my script is invoked only on page render. i.e when I open my Photo page(and that time, counter value is not even set, so no way to inform which form to hide) and it doesn't get called again on submitting the sub form. Any workaround for that ? Regards Sakshi Jonathan Barker wrote: You need to make sure that the form's zone parameter is set to the id and not just the t:id of the Zone. I started generating my own xml id's from a root name and the actual database id of the object I was about to use. I can't speak to mixing in the custom javascript, except that when the Ajax submit is working properly, the response should effectively clear the display:none that you just set before sending the request. Your response need's to indicate that the style of the form should be hidden - or don't even return a form, return some text to indicate it's been dealt with. If that is the case, then you won't need the custom javascript anyway. You might also want to consider setting the context of the form. I've bumped my head on problems with loop state and forms before, but it does depend what you are looping over. Nested loops can be fun. JB On Thu, Jun 24, 2010 at 12:52 AM, SakshiAgarwal sakshi.a...@gmail.comwrote: Hi, I did check this example, but it helped me only to some extent. The main problem in my case is: the structure of my TML file is like this: Loop Zone Form (defined photoZOne here) Submit the main problem is: counter value for first form does not function properly...it gives very unpredictable results..for rest of the subsequent forms ( from the loop) works properly... Any suggestions/advice ? http://old.nabble.com/file/p28978902/photos.tml photos.tml I hope I am clear in my problem stmt. Looking fwd for solution for my problem. regards sakshi P.S. The reason I use zone here is: I have 'reported catergory' attached to each photo. and if I disapprove I need to submit it with the reason i.e. 'reported category' that particular photo. So i can't submit the entire form( as it contains multiple photos). I also need to add java script in my code as I want to hide the photo as soon as i take action on it. (i.e. approve/disapprove) Looked at many examples but nothing works fine with everything in place, i.e. zone,loop,form,javascript all together Geoff Callender-2 wrote: Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.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 -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28978902.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 -- Jonathan Barker ITStrategic -- View this message in context: