Re: Returning a file attachment and a page together in a request
Em Sat, 27 Jun 2009 23:00:42 -0300, Raghu Yegavakota escreveu: I am a newbie to Tapestry and have a question: Welcome! :) I am able to do (1) using StreamResponse but not sure how to solve (2)- send a Page response back and a file as an attachment. To redirect the user to a page (Login, for example), just return a page instance (got through @InjectPage) or the page class instance (Login.class) in the onActivate() method instead of the StreamResponse. As far as I know, you can't return a page and an attachment in the same request. Using Javascript (window.location = "...";) in the returned page, you can instruct the user's browser to make another request (in this case, a file as an attachment). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Returning a file attachment and a page together in a request
I am a newbie to Tapestry and have a question: I have a downloads page that displays a list of files to the user. When the user clicks on any file link I need to do one of two things: 1) If the user is logged in, I need to send the selected file as an attachment to the browser 2) If the user is not logged in, I need to display the Login page. One the user is successfully logged in, I need to display the downloads page and also send the selected file as an attachment. I am able to do (1) using StreamResponse but not sure how to solve (2)- send a Page response back and a file as an attachment. Any help is greatly appreciated. Thanks, Raghu.
Re: T5 ajax examples
See "Ajax & JavaScript" in "User Guide" pane on this page: http://tapestry.apache.org/tapestry5.1/ On Sun, Jun 28, 2009 at 12:10 AM, haipeng du wrote: > What is the good reference for ajax in T5? I did not find any good > documentation from T5 website. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5 ajax examples
What is the good reference for ajax in T5? I did not find any good documentation from T5 website. Thanks. -- Haipeng Du Salt Lake City
Re: gridtable with hashmap
Hi Gutemberg, Grid needs a collection as its source parameter. HashMap (i.e. the Map-Interface) is no collection itsself, but provides two methods to get the collections "Collection values()" or "Set> entrySet()". Use one of those as source for Grid. One sidenote, HashMap does not garantuee the order of its elements. I.e. the order might be different on every iteration. That might not look very good to your users. You should consider switching the implementation to LinkedHashMap or even change the interface to SortedMap and use its implementation TreeMap. Regards, nillehammer == http://www.winfonet.eu - original Nachricht Betreff: gridtable with hashmap Gesendet: Fr, 26. Jun 2009 Von: Gutemberg Albuquerque Da Silva > somebody knows to make one gridtable with one hashmap? > > thanks. > > -- > Gutemberg Albuquerque Da Silva > --- original Nachricht Ende - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 6: Famous last words?
Em Sat, 27 Jun 2009 05:34:09 -0300, Piero Sartini escreveu: I expect the T5 IOC to live well beyond the web framework portion. T5 IoC is very powerful. Yes it is. And it's a pleasure to use. But at this point I am not so sure if Tapestry IoC is the best answer to flexibility. Take a look at Struts2 - they are able to switch their DI implementation by configuration. I would agree if Tapestry-IoC wasn't flexible enough to support integration with other IoC/DI frameworks, but it is. Hint: take a look at the T-IoC' ModuleDef interface and how it's used in tapestry-spring. This brings them a lot of possibilities and integrations with third party frameworks / products that I do not see for tapestry. Could you give us some examples of what possibilities and integrations with third-party frameworks or products that you do not see for Tapestry? One could argument that this is a much more flexible approach than relying on one DI container. I don't think so. Look at how Spring is supported in Tapestry: it's absolutely transparent. When I need some Spring bean in my page, component, mixin or service, it is injected as if it was a Tapestry-IoC defined bean (service). My projects are built with Tapestry and transactions are handled by Spring-TX. In the future, when the Tapestry project will have it's own transaction support, my only changes my project will need are changing the Spring's @Transactional annotation for the corresponding Tapestry-TX annotations (which I guess will be the EJB 3 ones). Anything that needs my services/beans will not change. Tapestry very flexible architecture needs an IoC framework. Otherwise, it would lose a lot of power, simplicity, convention over configuration and -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 change grid column header label
Em Sat, 27 Jun 2009 00:28:50 -0300, haipeng du escreveu: How could I change label for grid header and keep the sorting function. The easiest way is?: if you property is named xxx, add xxx-label=Desired label to your app.properties. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5.1.x: IOC only app
Em Fri, 26 Jun 2009 20:40:20 -0300, Angelo Chen escreveu: Hi, Hello! is there any easier way now to create IOC only app in 5.1.x? or still the same as the one documented in wiki? Thanks Easier than in the wiki? It should work in T5.1 just as T5. I don't recall any backward-incompatible changes from 5.0.18 to 5.1. I just think the line registry.performRegistryStartup(); is not needed now. I have a small T-IoC 5.1-only application that works without that line. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: matriz
There are a few more maths related utilities on http://lombok.demon.co.uk/mathToolkit/app Shing --- On Fri, 26/6/09, Igor Drobiazko wrote: > From: Igor Drobiazko > Subject: Re: matriz > To: "Tapestry users" > Date: Friday, 26 June, 2009, 2:28 PM > Very nice component. Where have you > been when I had my math lectures? :) > Do you have more? > > On Thu, Jun 25, 2009 at 10:19 PM, Shing Hing Man > wrote: > > > > > I have written a component to input a matrix. > > The following page has an example to input a square > matrix. (The component > > can input a non-square matrix as well.) > > > > http://lombok.demon.co.uk/mathToolkit/algebra/linear/eigenvalue > > > > > > If you like, I can email you the component source > files. > > > > Shing > > > > > > --- On Thu, 25/6/09, Gutemberg Albuquerque Da Silva > > > wrote: > > > > > From: Gutemberg Albuquerque Da Silva > > > Subject: matriz > > > To: "Tapestry users" > > > Date: Thursday, 25 June, 2009, 3:48 AM > > > anybody knows some solution for > > > working editable matriz? I need to catch > > > cell of table. > > > > > > thanks. > > > > > > -- > > > Gutemberg Albuquerque Da Silva > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > -- > Best regards, > > Igor Drobiazko > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 and Event component.
It seems that Button is not designed for ajax. I wonder why you don't try block/zone? DH http://www.gaonline.com.cn/ - Original Message - From: "b...@umd" To: Sent: Friday, June 26, 2009 2:48 AM Subject: Re: Tapestry 5 and Event component. > > Ok, it seems to come from the parameter "String value" in my onButtonClicked > statement. I removed it and the event is now handled. However it appears > that I am not allowed to return a JSONObject from the OnButtonClicked > method. May be is it not possible with this kind of component. > > But perhaps you can still help me. I am trying to make a research function > for my interface. For the moment, it works great with the following code : > > gentoo.tml : > event="blur" onCompleteCallback="onSearchRequest" /> > > > gentoo.java : > @OnEvent(component = "textfield", value = "blur") > public JSONObject onBlurEvent(String value) { > System.out.println("Event Caught !"); > String translatedValue = "Package not found !"; > try { >String category=applicationManager.getCategoryFromApplication(value); >if (category != null) { > translatedValue = "This package is located in category > "+category+"."; >} >return new JSONObject().put("translatedValue", > translatedValue);} > catch(Exception e){} > return new JSONObject().put("translatedValue", translatedValue); > } > > gentoo.js : > /* This is to update the Textfield component 'result' */ > function onSearchRequest(response) { > $('result').update("Search result(s) : "+response.translatedValue); > } > > My problem is that the search is performed on "blur" event (when the user > click anywhere outside the textfield box) whereas I would like to perform it > when the user click on a button instead. So that is why I believed I could > trigger this event by changing the "blur" event into a "clicked" event. > > Does anyone know how I can simply do that ? > > > > > > -- > View this message in context: > http://www.nabble.com/Tapestry-5-and-Event-component.-tp24192270p24209012.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: Tapestry 6: Famous last words?
> I expect the T5 IOC to live well beyond the web framework portion. T5 IoC is very powerful. But at this point I am not so sure if Tapestry IoC is the best answer to flexibility. Take a look at Struts2 - they are able to switch their DI implementation by configuration. This brings them a lot of possibilities and integrations with third party frameworks / products that I do not see for tapestry. One could argument that this is a much more flexible approach than relying on one DI container. Piero - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org