Re: T4: From the client side, how do you programmatically update a component?
Hi, you you can do following: -your component should implement the interface IDirect -create a link: public ILink getLink(){ return getDirectService().getLink(false, new DirectServiceParameter(this)); } - and pass the url of the link as a parameter to your Script Map params = new HashMap(); params.put(url, getLink().getURL()); PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, params); - call the url in your script script input-symbol key=url required=yes / body unique foo =function(){ tapestry.bind(${url}, ); } /unique /body /script - update the components in you trigger() method: public void trigger(IRequestCycle cycle){ getRequestCycle().getResponseBuilder().updateComponent(COMPONENT_ID) } Hope this helps On Dec 2, 2007 12:24 AM, Kalle Korhonen [EMAIL PROTECTED] wrote: No - I want to trigger the update programmatically via Javascript, not from a user's click. Kalle On 12/1/07, Ulrich Stärk [EMAIL PROTECTED] wrote: I can't follow you. You want a component to update itself asynchronously upon a user's click on a DirectLink? Why don't you just use DirectLink's updateComponents parameter with async=true? Uli Kalle Korhonen schrieb: I have a use case where I need to click on a directllink to updatecomponents with async=true or do an equivalent action in Javascript. I know I can do tapestry.bind('span [EMAIL PROTECTED]/') and it makes some sense, but looks rather ugly. Any cleaner way to accomplish this? Kalle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: outputRaw and bbcode
Hi, I'd like to know know if there is a component that can display BBCode text in the correct html format? i tried outputRaw and seems I'm wrong, any ideas? Thanks. A.C. -- View this message in context: http://www.nabble.com/T5%3A-outputRaw-and-bbcode-tf4935074.html#a14125808 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5 book
Emmanuel Sowah wrote: I read somewhere on the net that there is a Tap 5 book in the works. Where can I get drafts of this work in progress and when would it be released? The book is available in pre-order here : http://www.packtpub.com/tapestry-5/book -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Got the ioc working in a test with tapestry-hibernate
Hi, Dan. I want to same thing which you did. Could you let me know the details? So I have some test cases in which I actually need a working hibernate session so I'm having my tests start up an ioc registry. This took a bit of digging to figure out but I got it working. Here's a minimal test case that I used to prove that it worked: public void testTest() throws Exception { RegistryBuilder builder = new RegistryBuilder(); builder.add(TapestryModule.class); builder.add(HibernateModule.class); builder.add(InternalTestModule.class); builder.add(AppModule.class); Registry registry = builder.build(); // mode can be anything here registry.getService(Alias.class).setMode(test); // ... loads one of my services to make sure it works } The biggest trick was contributing my own internal test module so that I could override ApplicationDefaults in order to provide the correct root application package which is needed by tapestry-hibernate during configuration. Whew. public final class InternalTestModule { public static void contributeAliasOverrides(ConfigurationAliasContribution config) { ApplicationGlobalsImpl globals = new ApplicationGlobalsImpl(); globals.store(your.root.package); config.add(AliasContribution.create(ApplicationGlobals.class, globals)); } } But it seems to be loading fine now and I can use the hibernate stuff in my tests without a problem. There is more that's need as far as thread cleanup and shutting down the registry but this is what's needed to get it at least running. -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Got the ioc working in a test with tapestry-hibernate
you shold also call registry.performRegistryStartup(); after Registry registry = builder.build(); in the end just call : registry.shutdown(); Davor Hrg On Jun 14, 2007 4:01 PM, Dan Adams [EMAIL PROTECTED] wrote: So I have some test cases in which I actually need a working hibernate session so I'm having my tests start up an ioc registry. This took a bit of digging to figure out but I got it working. Here's a minimal test case that I used to prove that it worked: public void testTest() throws Exception { RegistryBuilder builder = new RegistryBuilder(); builder.add(TapestryModule.class); builder.add(HibernateModule.class); builder.add(InternalTestModule.class); builder.add(AppModule.class); Registry registry = builder.build(); // mode can be anything here registry.getService(Alias.class).setMode(test); // ... loads one of my services to make sure it works } The biggest trick was contributing my own internal test module so that I could override ApplicationDefaults in order to provide the correct root application package which is needed by tapestry-hibernate during configuration. Whew. public final class InternalTestModule { public static void contributeAliasOverrides(ConfigurationAliasContribution config) { ApplicationGlobalsImpl globals = new ApplicationGlobalsImpl(); globals.store(your.root.package); config.add(AliasContribution.create(ApplicationGlobals.class, globals)); } } But it seems to be loading fine now and I can use the hibernate stuff in my tests without a problem. There is more that's need as far as thread cleanup and shutting down the registry but this is what's needed to get it at least running. -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Problem with url-pattern in web.xml
Hello everybody, I am new to tapestry and I am using Tapestry core 5.0.5. I integrated Tapestry 5 with spring and hibernate. I configured my application's web.xml as below - -spring-app configuration is here- !-- Tapestry 5 context and filters -- context-param param-nametapestry.app-package/param-name param-valuecom.myproject/param-value /context-param - some other filters here - filter filter-nametapestryFilter/filter-name filter-classorg.apache.tapestry.spring.TapestrySpringFilter/filter-class /filter filter-mapping filter-nametapestryFilter/filter-name url-pattern/*/url-pattern /filter-mapping listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener - hibernate listener- This works perfect with all Tapestry related pages. At certain operation in my application when a file is uploaded from jsp page by using servlet it generates output with .htm which fires a Tapestry Page not found exception. I doesn't understand why? I tried to change url-pattern to - /package/* , this solves my problem of uploading and all tapestry action requests are successfully handled but all Tapestry pages are displayed with - [Error] - like icons in front of every Tapestry component on that page. I doesn't understand why? Can anybody tell me why this is happening. I am trying solution for this from last 2-3 days. Any help is appreciated. :) Thanks in advance. ;) From, Ritesh S. -- View this message in context: http://www.nabble.com/T5%3A-Problem-with-%3Curl-pattern%3E-in-web.xml-tf4936246.html#a14129132 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T3: session length
Hello, Is there a way in T3 to make your session last until the browser is closed? Thanks, --James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: session length
No, I don't think so. E. On Dec 3, 2007 3:00 PM, James Sherwood [EMAIL PROTECTED] wrote: Hello, Is there a way in T3 to make your session last until the browser is closed? Thanks, --James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL race condition(s) (?)
I've also noticed more OGNL getProperty(null, property) exceptions while upgrading from 4 to 4.1. For instance, previously this would work: lt;tr jwcid=@For source=ognl:myObj.myCollection value=ognl:tempObj id=ognl:'uniquerow' + tempObj.idgt; nbsp;nbsp;... lt;/trgt; But now it appears the tempObj isn't instantiated until after the rendering of the component has begun, so I have to do this instead: lt;span jwcid=@For source=ognl:myObj.myCollection value=ognl:tempObj renderTag=falsegt; lt;tr id=ognl:'uniquerow' + tempObj.idgt; ... lt;/trgt; lt;/spangt; Not quite the same problem, just confirming that there is some OGNL breakage in the tap4-4.1 transition. -- View this message in context: http://www.nabble.com/OGNL-race-condition%28s%29-%28-%29-tf4898454.html#a14132762 Sent from the Tapestry - User mailing list archive at Nabble.com.
RE: PropertySelection binding bug T-4.1.3 ?
Well today I am going to scope out the usage of a supplemental getValue() abstract method and see what that does to the mix. I had hopes that it is not needed but thats my only route. I remain confused about the status of inherited bindings, how to use if any and whether they remain applicable anymore and how they are suppose to be used. getValue() applies as an inherited binding. Also, supplementing a redirect (two parameters for virtually one) for a parameter just doesn't feel good. I will post status on this when finished. Best regards Ken in nashua From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: PropertySelection binding bug T-4.1.3 ?Date: Thu, 29 Nov 2007 15:39:12 -0500 Well so much for possible bug/jira issue... Is there a working sample that exercises PropertySelection bindings as documented in T-4.1.3 that I can operate. I mean a sample that you have confirmed is currently operating the way it should. Likewise I will produce a sample to try and present this as a bug.Thanks for trying.Best regards Ken in nashua From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: PropertySelection binding bug T-4.1.3 ?Date: Thu, 29 Nov 2007 15:21:58 -0500 This is what I receive when I uncomment the binding in the jwc file [ +/- ] Exception: A binding for parameter 'value' of component Home/galleryWidget.tableSizeSelect in the template for Home/galleryWidget conflicts with an existing binding in the specification. org.apache.hivemind.ApplicationRuntimeException A binding for parameter 'value' of component Home/galleryWidget.tableSizeSelect in the template for Home/galleryWidget conflicts with an existing binding in the specification. It has to be in one place not both. Are you implying I need to define a getValue method in my java file? I always thought I could leverage the inherited binding automatically.Any further thoughts?Best regards Ken in nashua From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: PropertySelection binding bug T-4.1.3 ?Date: Thu, 29 Nov 2007 14:40:25 -0500 If you want I can zip up the whole trails project and get that to you. I would think at this point it would be helpful to have a running trails runtime for these special instances, for fun and probably for that nasty bug that comes along. Trails would provide you that extra special real world regression. Connect and share in new ways with Windows Live. Connect now! Connect and share in new ways with Windows Live. Connect now! You keep typing, we keep giving. Download Messenger and join the i’m Initiative now. Join in! _ Your smile counts. The more smiles you share, the more we donate. Join in. www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline
Re: T5: Select's model
I put mine into a selection package, like com.servprise.manager.selection. These classes are not auto-enhanced, so I provide necessary ASOs and services through the constructor as demonstrated in my example. On 12/2/07 9:18 PM, in article [EMAIL PROTECTED], Angelo Chen [EMAIL PROTECTED] wrote: Hi, This works, question now is, where to put this class? I put it under components, it works until I inject the hibernate service: @Inject private Session _session; public CountrySelectModel() { } _session is always null, any idea? thanks. -- Kevin Menard Servprise International, Inc. Remote reboot power control for network equipment www.servprise.com +1 508.892.3823 x308 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 - Stream source output to text file
Could anyone give me any pointers or directions on how to stream the html output that Tapestry generates out to a text file, which would be stored in a specific directory outside the Tapestry project? I would also like to be able to do the same with assets such as css and javascript files, though this would be less important, and more of a convenience. Any hints and suggestions are appreciated. Thanks much.patrick -- View this message in context: http://www.nabble.com/T5---Stream-source-output-to-text-file-tf4937616.html#a14133292 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help wanted. Running T5 on Tomcat
Hi, I m currently evaluating T5 as a framework. I am new in tapestry. Fot that purpose I wrote a small test application that runs fine in jetty application server. Wedo however use tomcat 5.5 as the standard application server in our project and we must stick to this decision due to external dependencies. What is the recommended way of integrating T5 into tomcat 5.5 and has anyone experience with such a setup? Thanks in advance, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - Stream source output to text file
I don't know if this can be done, although it would be great! It would open the doors for sending Tapestry generated html emails, which others have asked about. Also it would be easier to do rigorous html code testing/profiling, since it's outside the browser. On Dec 3, 2007 11:41 AM, patrick whalen [EMAIL PROTECTED] wrote: Could anyone give me any pointers or directions on how to stream the html output that Tapestry generates out to a text file, which would be stored in a specific directory outside the Tapestry project? I would also like to be able to do the same with assets such as css and javascript files, though this would be less important, and more of a convenience. Any hints and suggestions are appreciated. Thanks much.patrick -- View this message in context: http://www.nabble.com/T5---Stream-source-output-to-text-file-tf4937616.html#a14133292 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to access component properties inside of a page
Hi there! I want to access the property selectedBlockID of a component called GraphicalTabPanel inside of a page that includes this component. The method getComponent() returns an IComponent. GraphicalTabPanel panel = this.getComponent(GraphicalTabPanel ); and I can not cast it to GraphicalTabPanel which extends BaseComponent - but it does not implement IComponent. Thought this should be something simple? Thanks! Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4: From the client side, how do you programmatically update a component?
Yeap, thanks Igor. I like the idea of calling the script with a parameter, but overall a bit much compared to the one-liner on the client side, as ugly as it may be. Adding such a component to the contrib lib or tacos might make sense though. I'd think others might have similar needs. Kalle On 12/3/07, Igor Drobiazko [EMAIL PROTECTED] wrote: Hi, you you can do following: -your component should implement the interface IDirect -create a link: public ILink getLink(){ return getDirectService().getLink(false, new DirectServiceParameter(this)); } - and pass the url of the link as a parameter to your Script Map params = new HashMap(); params.put(url, getLink().getURL()); PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, params); - call the url in your script script input-symbol key=url required=yes / body unique foo =function(){ tapestry.bind(${url}, ); } /unique /body /script - update the components in you trigger() method: public void trigger(IRequestCycle cycle){ getRequestCycle().getResponseBuilder().updateComponent(COMPONENT_ID) } Hope this helps On Dec 2, 2007 12:24 AM, Kalle Korhonen [EMAIL PROTECTED] wrote: No - I want to trigger the update programmatically via Javascript, not from a user's click. Kalle On 12/1/07, Ulrich Stärk [EMAIL PROTECTED] wrote: I can't follow you. You want a component to update itself asynchronously upon a user's click on a DirectLink? Why don't you just use DirectLink's updateComponents parameter with async=true? Uli Kalle Korhonen schrieb: I have a use case where I need to click on a directllink to updatecomponents with async=true or do an equivalent action in Javascript. I know I can do tapestry.bind('span [EMAIL PROTECTED]/') and it makes some sense, but looks rather ugly. Any cleaner way to accomplish this? Kalle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help wanted. Running T5 on Tomcat
Several people including myself are using Tomcat 5.5.x as our deployment app server. I also use it in development on my local workstation. I recommend searching the list for Tomcat (we're almost always talking about Tomcat 5.0+) I use Eclipse WTP with a Tomcat. With Tapestry 5+, It is suggested to use Maven to handle your jar dependencies. HLS recommends Mavan 2.0.5, but I use 2.0.6 with no problems. In order for Eclipse to pick up the jars referenced in your Maven POM, you need a classpath variable like this: M2_REPO C:/Documents and Settings/Username/.m2/repository You can start your application by running the Tapestry Archetype command from your workspace (in a console/cmd window) Also, whenever you update your POM/ update the libraries with Maven/start a new app, you'll want to execute this command from the directory of you project's POM (if you use WTP): mvn eclipse:eclipse -Dwtpversion=1.5 -U I don't use the LibCopy plugin, or any 3rd party Eclipse Maven plugin. I just let Maven regenerate the eclipse files as needed, using the above command. The -U tells maven to look for updates for libraries referenced in your POM, using the repositories listed in your POM. Maven is a real timesaver, except for particular libraries that don't publish to a public maven repository, like newer versions of iText, etc. There is a free Maven book online, which teaches you everything you'll ever need to know. On Dec 3, 2007 11:58 AM, Thomas Zenglein [EMAIL PROTECTED] wrote: Hi, I m currently evaluating T5 as a framework. I am new in tapestry. Fot that purpose I wrote a small test application that runs fine in jetty application server. Wedo however use tomcat 5.5 as the standard application server in our project and we must stick to this decision due to external dependencies. What is the recommended way of integrating T5 into tomcat 5.5 and has anyone experience with such a setup? Thanks in advance, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access component properties inside of a page
..sorry, just ignore this message GraphicalTabPanel panel = (GraphicalTabPanel)this.getComponent(tabPanel); lol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: session length
I suppose you could set session-timeout to 0 in your web.xml, but that's not recommended. -Filip James Sherwood skrev: Hello, Is there a way in T3 to make your session last until the browser is closed? Thanks, --James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Grid queries partial data
Hi, Does anyone know how to implement a Grid data source, or thru other ways, such that it will only query partial data from the database, depending on the page link user click on the Grid, and the rowsPerPage value set for the Grid? I just don't want to retrieve the whole list if I only need to display part of it. thx! Ronald -- View this message in context: http://www.nabble.com/T5%3A-Grid-queries-partial-data-tf4938419.html#a14135667 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - Stream source output to text file
I've done something like what you are asking in order to generate email messages. It's not pretty, and not well supported but it can be done... Here is the guts of the process: protected String getHtml(String page, String[] context, EmailContext emailContext) { Request request = _requestGlobals.getRequest(); Response response = _requestGlobals.getResponse(); // response wrapper stores everything written into a buffer EmailResponse emailResponse = new EmailResponse(_requestGlobals.getHTTPServletResponse()); _requestGlobals.store(request, emailResponse); // email context contains some parameters passed into the rendered page request.getSession(true).setAttribute(emailContext, emailContext); // pageRenderRequestHandler clears the environment... remember things to put back later (fragile)... Heartbeat heartbeat = _environment.peek(Heartbeat.class); FormSupport formSupport = _environment.peek(FormSupport.class); try { _pageRenderRequestHandler.handle(page, context); return emailResponse.toString(); } catch (Exception e) { _log.warn(Failed to send video external + e.getMessage()); } finally { // Hope no other env vars are stored :( _environment.push(Heartbeat.class, heartbeat); _environment.push(FormSupport.class, formSupport); // Always restore the response _requestGlobals.store(request, response); request.getSession(true).setAttribute(emailContext, null); } return null; } This code is used to generate the html version of all email messages sent by thedailytube.com Hope that helps, Josh On Dec 3, 2007 8:41 AM, patrick whalen [EMAIL PROTECTED] wrote: Could anyone give me any pointers or directions on how to stream the html output that Tapestry generates out to a text file, which would be stored in a specific directory outside the Tapestry project? I would also like to be able to do the same with assets such as css and javascript files, though this would be less important, and more of a convenience. Any hints and suggestions are appreciated. Thanks much.patrick -- View this message in context: http://www.nabble.com/T5---Stream-source-output-to-text-file-tf4937616.html#a14133292 Sent from the Tapestry - User mailing list archive at Nabble.comhttp://nabble.com/ . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.
Re: T5: Grid queries partial data
have a look for a simple hibernated grid datasource http://wiki.apache.org/tapestry/Tapestry5HibernateGridDatasource best regards S.Homburg ronaldlee schrieb: Hi, Does anyone know how to implement a Grid data source, or thru other ways, such that it will only query partial data from the database, depending on the page link user click on the Grid, and the rowsPerPage value set for the Grid? I just don't want to retrieve the whole list if I only need to display part of it. thx! Ronald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Add a button to BeanEditForm
Hi, is there an easy way of adding a button to a BeanEditForm? Just an additional Delete or Copy button? Maybe like you can influence how a specific property is displayed with a t:Parameter name=firstName.../t:Parameter inside the BeanEditForm. Thanks, Christoph Jäger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 - custom component validation
As usual, I'm sure I'm just missing something here... I can't quite figure how to do validation of a custom component. I basically want to do what is described here[0] about using onSuccess(), but in a component rather than a page. I basically have a PasswordForm component which itself has a form, and that needs to verify that the password and confirm password fields are equal. I'm able to do this validation in PasswordForm.onSuccess() without any trouble String onSuccess() { if (!password.equals(password2)) { log.error(Passwords don't match); form.recordError(Passwords don't match); return null; } } but how do I notify the containing page that there is an error? Currently, the page just moves right along after logging my error message. I've tried throwing a ValidationException from onSuccess(), but that ends up being displayed to the user with a stacktrace and all. I even looked at the standard Form component's onAction method and copied some stuff from there (specifically looking at _resources.triggerEvent(FAILURE, context, handler)) but that didn't help at all. I separately tried extending AbstractField and overriding processSubmission() as suggested in one post, but that didn't do much for me. Any suggestions would be much appreciated. [0]: http://tapestry.apache.org/tapestry5/tapestry-core/guide/validation.html -will - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Grid queries partial data
Very interesting thank you Sven Homburg a écrit : have a look for a simple hibernated grid datasource http://wiki.apache.org/tapestry/Tapestry5HibernateGridDatasource best regards S.Homburg ronaldlee schrieb: Hi, Does anyone know how to implement a Grid data source, or thru other ways, such that it will only query partial data from the database, depending on the page link user click on the Grid, and the rowsPerPage value set for the Grid? I just don't want to retrieve the whole list if I only need to display part of it. thx! Ronald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Courcy http://courcy.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Add a button to BeanEditForm
Currently, you would need to build your own Form, including an Errors component, a BeanEditor component, and you own Submit components. On Dec 3, 2007 12:18 PM, Christoph Jaeger [EMAIL PROTECTED] wrote: Hi, is there an easy way of adding a button to a BeanEditForm? Just an additional Delete or Copy button? Maybe like you can influence how a specific property is displayed with a t:Parameter name=firstName.../t:Parameter inside the BeanEditForm. Thanks, Christoph Jäger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4: replacing script asset in AbstractSubmit
Is it possible to globally replace the SubmitBindings.script file used by all the AbstractSubmit subclasses to wire up ajax events with my own version? I've got a script that imposes an overlay on top of the components being updated and prevents double-clicks. Right now, I can wire it up to each individual button with a @Script, but it would be cleaner if I could just replace the asset where the submit script is wired. That way it would be automatically applied to all ajax submits. I'd like to do this without hacking up my tapestry jar. It might be nice to disable or unwire non-ajax submit buttons when they're clicked as well, but I haven't tried implementing that yet. -Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Add a button to BeanEditForm
You can also do hackish things like: create your model via BeanModelSource, add a property for your button (something like: model.add(button,null)), then add the appropriate template markup to override the rendering of the button property (if you don't, tapestry will complain). Throw in a bit of css for styling, and it works. It's not beautiful, but I have a solution like this working for T5.0.5 (where BeanEditor isn't yet split from BeanEditForm). Cheers, Robert On Dec 3, 2007, at 12/33:21 PM , Howard Lewis Ship wrote: Currently, you would need to build your own Form, including an Errors component, a BeanEditor component, and you own Submit components. On Dec 3, 2007 12:18 PM, Christoph Jaeger [EMAIL PROTECTED] wrote: Hi, is there an easy way of adding a button to a BeanEditForm? Just an additional Delete or Copy button? Maybe like you can influence how a specific property is displayed with a t:Parameter name=firstName.../t:Parameter inside the BeanEditForm. Thanks, Christoph Jäger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - custom component validation
worked perfectly, thanks. see, I knew I was missing *something* :) -will On Dec 3, 2007, at 1:41 PM, Filip S. Adamsen wrote: Try moving your validation logic to onValidate. If any errors are added to the form in this method Tapestry won't call onSuccess but display the page again with your errors shown in the Errors component. -Filip Will Norris skrev: As usual, I'm sure I'm just missing something here... I can't quite figure how to do validation of a custom component. I basically want to do what is described here[0] about using onSuccess(), but in a component rather than a page. I basically have a PasswordForm component which itself has a form, and that needs to verify that the password and confirm password fields are equal. I'm able to do this validation in PasswordForm.onSuccess() without any trouble String onSuccess() { if (!password.equals(password2)) { log.error(Passwords don't match); form.recordError(Passwords don't match); return null; } } but how do I notify the containing page that there is an error? Currently, the page just moves right along after logging my error message. I've tried throwing a ValidationException from onSuccess(), but that ends up being displayed to the user with a stacktrace and all. I even looked at the standard Form component's onAction method and copied some stuff from there (specifically looking at _resources.triggerEvent(FAILURE, context, handler)) but that didn't help at all. I separately tried extending AbstractField and overriding processSubmission() as suggested in one post, but that didn't do much for me. Any suggestions would be much appreciated. [0]: http://tapestry.apache.org/tapestry5/tapestry-core/guide/validation.html -will - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - custom component validation
Try moving your validation logic to onValidate. If any errors are added to the form in this method Tapestry won't call onSuccess but display the page again with your errors shown in the Errors component. -Filip Will Norris skrev: As usual, I'm sure I'm just missing something here... I can't quite figure how to do validation of a custom component. I basically want to do what is described here[0] about using onSuccess(), but in a component rather than a page. I basically have a PasswordForm component which itself has a form, and that needs to verify that the password and confirm password fields are equal. I'm able to do this validation in PasswordForm.onSuccess() without any trouble String onSuccess() { if (!password.equals(password2)) { log.error(Passwords don't match); form.recordError(Passwords don't match); return null; } } but how do I notify the containing page that there is an error? Currently, the page just moves right along after logging my error message. I've tried throwing a ValidationException from onSuccess(), but that ends up being displayed to the user with a stacktrace and all. I even looked at the standard Form component's onAction method and copied some stuff from there (specifically looking at _resources.triggerEvent(FAILURE, context, handler)) but that didn't help at all. I separately tried extending AbstractField and overriding processSubmission() as suggested in one post, but that didn't do much for me. Any suggestions would be much appreciated. [0]: http://tapestry.apache.org/tapestry5/tapestry-core/guide/validation.html -will - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: outputRaw and bbcode
Maybe I got your question wrong, could you just create a component to escape special chars in your BBCode text. One choice is to use StringEscapeUtils in Jakarta Commons-Lang. Cheers, Jeffrey Ai Angelo Chen wrote: Hi, I'd like to know know if there is a component that can display BBCode text in the correct html format? i tried outputRaw and seems I'm wrong, any ideas? Thanks. A.C. -- View this message in context: http://www.nabble.com/T5%3A-outputRaw-and-bbcode-tf4935074.html#a14140274 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Personalizing page and component template
Anybody, any advice? jeffrey ai wrote: Hi Folks, We have a need to provide personalized page for different user groups, so I tweaked some T5 services to make it possible to use personalized template based on a request parameter. I would like put the general idea here in case you guys are interested. Also since I have change some T5 internal services, I am wondering whether I have missed something. Your advice are quite welcome. Basically, I decorated 2 T5 internal services -- ComponentTemplateSource and PagePool. * ComponentTemplateSource is responsible to look up templates, so I have changed it to request-aware and load template based on the user group. * PagePool is responsible to pool pages, so I have changed it to request-aware too and pool pages based on user group. Although I used T5 decorator facility to intercept calls to both services, it's not real decorating behavior as defined in GoF pattern. My decorators will handle all calls, they won't even pass calls to decoratees -- the original services. I am a little concerned whether my tweak would have some side effects. -- Code Snippet of my AppModule.java public ComponentTemplateSource decorateComponentTemplateSource( ClassComponentTemplateSource serviceInterface, Object delegate, String serviceId, Logger logger, TemplateParser parser, PageTemplateLocator locator, RequestGlobals requestGlobals ) { final MyComponentTemplateSourceImpl service = new MyComponentTemplateSourceImpl( parser, locator, requestGlobals ); _updateListenerHub.addUpdateListener( service ); return service; } public PagePool decoratePagePool( ClassPagePool serviceInterface, Object delegate, String serviceId, Logger logger, PageLoader pageLoader, ThreadLocale threadLocale, ComponentClassResolver resolver, RequestGlobals requestGlobals, ThreadString threadString, ComponentMessagesSource componentMessagesSource, ComponentTemplateSource componentTemplateSource ) { final MyPagePoolImpl service = new MyPagePoolImpl( logger, pageLoader, threadLocale, resolver, requestGlobals, threadString ); // This covers invalidations due to changes to classes pageLoader.addInvalidationListener( service ); // This covers invalidation due to changes to message catalogs (properties files) componentMessagesSource.addInvalidationListener( service ); // ... and this covers invalidations due to changes to templates componentTemplateSource.addInvalidationListener( service ); return service; } -- Thanks for any advice. Jeffrey Ai -- View this message in context: http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-tf4925841.html#a14140075 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: outputRaw and bbcode
hi jeffrey, thanks for the response, what I want to do is, the text has some bbcode , I'd like to convert that to html tags, then use outputRaw to display it, any existing components that can do that? jeffrey ai wrote: Maybe I got your question wrong, could you just create a component to escape special chars in your BBCode text. One choice is to use StringEscapeUtils in Jakarta Commons-Lang. Cheers, Jeffrey Ai Angelo Chen wrote: Hi, I'd like to know know if there is a component that can display BBCode text in the correct html format? i tried outputRaw and seems I'm wrong, any ideas? Thanks. A.C. -- View this message in context: http://www.nabble.com/T5%3A-outputRaw-and-bbcode-tf4935074.html#a14140282 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Grid queries partial data
Thanks! I can get it to work, kind of. I am encountering a situation where in the prepare function, the startIndex is greater than the endIndex... the way I get that is first get to the second page of the data (by clicking page 2), then do a new search to query new data, and for some reason the startIndex still return me the previous index (the first index of the second page), and since my second query returns number of entries less than the startIndex and therefore it happens (startIndex endIndex).. It may have something to do with the way I persist certain things.. need to investigate more. Ronald Sven Homburg wrote: have a look for a simple hibernated grid datasource http://wiki.apache.org/tapestry/Tapestry5HibernateGridDatasource best regards S.Homburg ronaldlee schrieb: Hi, Does anyone know how to implement a Grid data source, or thru other ways, such that it will only query partial data from the database, depending on the page link user click on the Grid, and the rowsPerPage value set for the Grid? I just don't want to retrieve the whole list if I only need to display part of it. thx! Ronald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/T5%3A-Grid-queries-partial-data-tf4938419.html#a14140390 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T4] Help converting InjectComponent annotation to page specification
Hi all, I'm a newbie at Tapestry and I'm reading Kent's book trying to get Tapestry to work with AJAX. In one of his examples, he has a customerCRUD.java class with the following annotation: @InjectComponent(customersLoop) public abstract ForBean getRow(); public String getRowClientId() { return getRow().getClientId(); } This method will return the HTML id for the current tr element generated from a For loop component. I am having issues getting this to work with my current project and I want to move annotation specification to page file specification. What is the equivalent page specification syntax for the above? From Tapestry's annotation reference: The InjectComponent annotation allows nested components to be injected as read-only properties. It is attached to an accessor method: @InjectComponent(inputUserName) public abstract TextField getUserInput(); This is functionally the same as providing the property attribute of the component element. So I tried the following: component id=customersLoop type=For property=row binding name=source value=customerEntries/ binding name=value value=customerEntry/ binding name=index value=idx/ /component property name=rowClientId initial-value=row.clientId/ THEN bean name=rowClientId class=java.util.String property=row.clientId/ and other variations without any luck. What am I doing wrong? TIA! -- View this message in context: http://www.nabble.com/-T4--Help-converting-InjectComponent-annotation-to-page-specification-tf4940334.html#a14142129 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - Stream source output to text file
It's not elegant, but you could use a command-line tool like wget. Andy On Mon, 2007-12-03 at 08:41 -0800, patrick whalen wrote: Could anyone give me any pointers or directions on how to stream the html output that Tapestry generates out to a text file, which would be stored in a specific directory outside the Tapestry project? I would also like to be able to do the same with assets such as css and javascript files, though this would be less important, and more of a convenience. Any hints and suggestions are appreciated. Thanks much.patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Grid queries partial data
Ronald, This is a bug in the Grid implementation. See http://issues.apache.org/jira/browse/TAPESTRY-1901 Thanks, Andy On Mon, 2007-12-03 at 15:09 -0800, ronaldlee wrote: Thanks! I can get it to work, kind of. I am encountering a situation where in the prepare function, the startIndex is greater than the endIndex... the way I get that is first get to the second page of the data (by clicking page 2), then do a new search to query new data, and for some reason the startIndex still return me the previous index (the first index of the second page), and since my second query returns number of entries less than the startIndex and therefore it happens (startIndex endIndex).. It may have something to do with the way I persist certain things.. need to investigate more. Ronald Sven Homburg wrote: have a look for a simple hibernated grid datasource http://wiki.apache.org/tapestry/Tapestry5HibernateGridDatasource best regards S.Homburg ronaldlee schrieb: Hi, Does anyone know how to implement a Grid data source, or thru other ways, such that it will only query partial data from the database, depending on the page link user click on the Grid, and the rowsPerPage value set for the Grid? I just don't want to retrieve the whole list if I only need to display part of it. thx! Ronald - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - Stream source output to text file
I guess the next step is to simulate the HTTP request and then grab the output from it. For generating html emails you wouldn't want to do any interaction through the web browser to initiate the page creation. Maybe the wget approach is a good angle of attack, but needs to be closer to the App Server. Perhaps there is a website load testing tool that simulates requests/allows variables to be set that could be run on the same or different application server. Totally independent of Tapestry, like wget. The response can then be cat'd to the emailing service/print ad/fax machine, etc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - Stream source output to text file
You could keep it all Java (closer to the App Server is a good idea) and use the Apache HTTPClient to make the HTTP request. http://jakarta.apache.org/httpcomponents/httpcomponents-client/index.html Christopher. On Dec 3, 2007 11:35 PM, Daniel Jue [EMAIL PROTECTED] wrote: I guess the next step is to simulate the HTTP request and then grab the output from it. For generating html emails you wouldn't want to do any interaction through the web browser to initiate the page creation. Maybe the wget approach is a good angle of attack, but needs to be closer to the App Server. Perhaps there is a website load testing tool that simulates requests/allows variables to be set that could be run on the same or different application server. Totally independent of Tapestry, like wget. The response can then be cat'd to the emailing service/print ad/fax machine, etc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]