Re: T5: Weird behavior treating unicode urls, after T 5.0.15 version
Thank you for the prompt response. I created a JIRA for this: https://issues.apache.org/jira/browse/TAP5-539 On Thu, Feb 26, 2009 at 4:16 PM, Thiago H. de Paula Figueiredo wrote: > Em Thu, 26 Feb 2009 11:01:13 -0300, Grigoris Ioannou > escreveu: > >> Hi all, > > Hi! > >> http://localhost:8080/app/viewcity/Krak$00f3w-Poland-Europe/9584 >> and >> http://localhost:8080/app/viewcity/N$00eemes-France-Europe/7196 > > These URLs are really, really ugly. This behaviour was changed in some > version I can't recall to provide better support for null and empty > activation context parameters. > > There is a Tapestry service, org.apache.tapestry5.services.URLEncoder, that > does the activation context -> string and string -> activation context > encoding. You can write your own and override the one used by Tapestry > through the alias overriding feature described here: > http://tapestry.apache.org/tapestry5/guide/alias.html. > > I guess Tapestry could provide an easy way to switch between the old and the > new activation context encoding. You can file a JIRA for that, please. :) > > -- > 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 > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: Weird behavior treating unicode urls, after T 5.0.15 version
Hi all, I have this strange behavior in my Tapestry application: What I want to do is read the name of a city and its country from the database and I pass these names in the corresponding url, along with the city id. So, the urls, using T 5.0.15, become like the following, which is the desired result: http://localhost:8080/app/viewcity/Kraków-Poland-Europe/9584 and http://localhost:8080/app/viewcity/Nîmes-France-Europe/7196 This works as it should when I use T 5.0.15. But, when I update Tapestry to a later version (I tried with T 5.0.17, 5.0.18 and T 5.1 alpha), the urls get "ugly" : http://localhost:8080/app/viewcity/Krak$00f3w-Poland-Europe/9584 and http://localhost:8080/app/viewcity/N$00eemes-France-Europe/7196 This is quite crucial for the application (for SEO reasons, frankly), but the behavior of the latest versions of Tapestry hold me back to still using T 5.0.15 because of this. In AppModule.java, I have set configuration.add(SymbolConstants.SUPPORTED_LOCALES, "utf-8,en,en_GB"); and I am using jboss 4.2.2 on a linux machine with jdk 1.6.0.10 and mysql 5.0.67 Any hints/suggestions? Thank you in advance, Regards, Grigoris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Previewable image component
Borut, I believe this is what you're looking for: http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/ThumbNail.html I hope it works for you, Grigoris On Fri, Sep 26, 2008 at 11:05 AM, Borut Bolčina <[EMAIL PROTECTED]>wrote: > Hello, > > is this: > http://wiki.apache.org/tapestry/Tapestry5ImageComponent > > the preferred and only way of having previewable images? > > Cheers, > Borut >
Re: Editing a collection
Same problem here. I have a reservation form where the number of the guests is variable. So, in my CustomerDetails.tml I have inside a form: Name In CustomerDetails.java the code that is executed when the form is submitted is: Object onSuccess() { System.out.println("guests are now "); for (Guest g : getGuests()) { System.out.println(g.getName()); } ... } The number of the guests is known beforehand and is set at the page's onActivate: public Object onActivate() { List guests = new ArrayList(); for (int i = 0; i < getMaxGuests().intValue(); i++) { Guest guest = new Guest(); guests.add(guest); } setGuests(guests); } Nevertheless, the names of the guests are always null. Perhaps this is not the "right" way to enter multiple values? Any suggestions? Regards, Grigoris On Tue, Jan 29, 2008 at 4:19 PM, Michael Courcy <[EMAIL PROTECTED]>wrote: > Hi François > > Thanks a lot, but actually my goal was more on understanding the loop > inside the form and how the model is updated in such situation. > > I keep your link though, I'll have a look on it. > > > Michael. > > Francois Armand a écrit : > > Michael Courcy wrote: >> >>> You mean that using value="user.loginUser" tapestry alway update the same >>> thing. >>> Thus if I change the method >>> >>> User { >>> void setLoginUser(String loginUser){ >>> this.loginUser = loginUser; >>> System.out.println(loginUser); >>> } >>> >>> It should at least output the value I input in my textField ... >>> And that's right, it actually what's going on the input are correctly >>> output >>> >>> But When I outout the user itself in the page >>> >>> public void setUser(User user) { >>> this.user = user; >>> System.out.println(user); >>> } >>> >>> the old value is kept >>> >>> actually setUser is call before setLoginUser ... >>> >>> Ok thanks I've to work on that. >>> >> >> If you want, I built a "ListEditor" to handle this kind of things. It's >> part of my project, http://interldap.org >> What you may looking for is here : >> http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/java/org/interldap/wui/t5lib/components/ListEditor.java?view=markup&rev=672 >> And here there is an example of use case (it really lacks a lot of doc) : >> >> http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/resources/org/interldap/wui/t5lib/components/eschema/EditAttribute.tml?view=markup&rev=568 >> >> That build a list of input fields, with a [delete] button next to them, >> and [add new value] button at the end of the list. >> Each button emits an events so that enclosing component can add or delete >> matching value from list. >> When you click on a button, updated values are set in the list at the >> right place. >> >> It may be use to construct simpler list editor. >> >> Hope it may help ! >> >> > > -- > Michael Courcy > http://courcy.blogspot.com > http://courcy-en.blogspot.com > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Nikolaos Konstantinou PhD Student - Research Assistant http://www.cn.ntua.gr/~nkons
Re: T5 application behaviour behind an apache web server
Finally this solved the problem: I used both of your suggestions: I replaced ROOT.war with my application and I set "tapestry.suppress-redirect-from-action-requests" to true This seems to solve the problem. Thanks, Grigoris On Fri, Aug 1, 2008 at 4:18 PM, Jonathan Barker <[EMAIL PROTECTED] > wrote: > > I've used a different technique for the apache->jboss connection, but faced > the same problem. > > Unless someone else has a better solution, you can replace the ROOT.war in > the JBoss tomcat service with your application. > > Jonathan > > >
Re: [T5] @CommitAfter is missing
Ok, solved, I upgraded to T5.0.13 and it seems to be working for now. Grigoris On Fri, Jun 13, 2008 at 1:25 PM, Grigoris Ioannou <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to add a DAO layer in my application, using the sample code > provided at: > > > http://tapestry.formos.com/nightly/tapestry5/tapestry-hibernate/userguide.html > > The problem is that the annotation @CommitAfter is missing > and HibernateTransactionDecorator cannot be found in the classpath. > > I am using T5.0.11. > > My classpath contains tapestry- {annotations, core, hibernate, ioc, spring, > upload} -5.0.11.jar > > Am I missing anything or do I have to use a different version of Tapestry? > Otherwise, what could be wrong? > > If it helps, I am using tomcat 6.0.14 > > Thanks in advance, > Grigoris >
[T5] @CommitAfter is missing
Hi all, I am trying to add a DAO layer in my application, using the sample code provided at: http://tapestry.formos.com/nightly/tapestry5/tapestry-hibernate/userguide.html The problem is that the annotation @CommitAfter is missing and HibernateTransactionDecorator cannot be found in the classpath. I am using T5.0.11. My classpath contains tapestry- {annotations, core, hibernate, ioc, spring, upload} -5.0.11.jar Am I missing anything or do I have to use a different version of Tapestry? Otherwise, what could be wrong? If it helps, I am using tomcat 6.0.14 Thanks in advance, Grigoris
Is it possible to hide javascript source?
Hi all, I am including lots of javascript in my code through e.g. Tapestry includes the whole source of the javascript files in the page source, which results in pages whose source may be consisting of hundreds of lines of java code. Is there a way to avoid this? For instance, instead of including them, a wouldnt be sufficient? Grigoris
T4.1.3 How to disable a submit button programmatically?
Hi all, I have a Submit button in my form that I want to have disabled and to only be disabled if the form does not contain any errors and the form is not rewinding. So, what I would like to do is (I assume) public void pageBeginRender(PageEvent event) { disable button ??? } if (!delegate.getHasErrors()) { enable button ??? } Is this possible? I looked at the tapestry API and I found code similar to Submit reservationButton = (Submit) getComponent("submitReservationButton"); IBinding b = (IBinding) component.getBinding("disabled"); but I cant set a new value (i.e. "ognl:false") to the button. How to do it? Any help would be appreciated Grigoris
Re: T4.1.3 Page rewind
It worked after all. The trick was to create a page property with the facilities list and initialize it during pageBeginRender. It seems that ognl has a problem with expressions of the type a.b.c where b or c is null. So the solution was to add in .page: and in pageBeginRender: setRoomFacilityList(getRoom().getFacilities()); ...along with an IPrimaryKeyConverter implementation in the same .java file (without this, the data that gets transmitted during form rewind can get huge). Grigoris On Jan 25, 2008 7:51 PM, Ulrich Stärk <[EMAIL PROTECTED]> wrote: > Page rewinding is a necessary mechanism to map HTML attribute names and > their values to the corresponding page properties. When the page is > rendered, Tapestry generates HTML attribute names and values for each > element inside your form. When the form is submitted the same mechanism > makes sure the submitted values map correctly to your page properties. > There is no way to get around this. So you will either have to persist > your room facility in the session or if it is a persistent object you > could just store its identifier and load it from your persistence store > upon rewinding. You'ld do this by implementing one of the interfaces > mentioned here: > http://tapestry.apache.org/tapestry4.1/usersguide/events.html > > Uli > > Grigoris Ioannou schrieb: > > Good evening all, > > > > I have a question regarding Tapestry 4.1.3 and page rewinding. So, in my > > page, there is a @For component: > > > > > > > > > > > > > > > > > > I implemented the IPrimaryKeyConverter interface and at first pass it > works > > fine. But when the form is submitted, i see that the page tries to > render > > itself again, finding the room parameter null, and ofcourse throwing a > null > > exception, without even entering the facilityConverter. > > > > I also note that the problem remains even if I include this @For > component > > inside an @If component (in the .html page): > > > > > > > > > > > > Is there a way to avoid this stupid null exception? Can I somehow > disable > > page re-rendering on rewind? I would like to avoid persisting anything > in > > the session. > > > > Thank you in advance, > > Grigoris > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
T4.1.3 Page rewind
Good evening all, I have a question regarding Tapestry 4.1.3 and page rewinding. So, in my page, there is a @For component: I implemented the IPrimaryKeyConverter interface and at first pass it works fine. But when the form is submitted, i see that the page tries to render itself again, finding the room parameter null, and ofcourse throwing a null exception, without even entering the facilityConverter. I also note that the problem remains even if I include this @For component inside an @If component (in the .html page): Is there a way to avoid this stupid null exception? Can I somehow disable page re-rendering on rewind? I would like to avoid persisting anything in the session. Thank you in advance, Grigoris
T4.1.3 Tapestry-hibernate problem
Hi all, I have a dynamic form where the user can set a dynamic number of passengers. The html looks like: Title Name Surname Age The updatePassenger is an InvokeListener that executes this code: public void updatePassenger(IRequestCycle cycle) { if (cycle.isRewinding()) { setCurrentPassenger(getPassengerManager().getPassengerById(getCurrentPassengerId())); getPassengerManager().savePassenger(getCurrentPassenger()); } else { Passenger passenger = getPassengerManager().getPassengerById(getCurrentPassengerId()); setCurrentPassenger(passenger); } } (The idea is that in the beginning I retrieve every Passenger's data from the database and when the form is rewinding I store them in the database again) The getPassengerManager() is a class responsible for handling the Passenger objects, based on hibernate. The savePassenger function is: public void savePassenger(Passenger passenger) throws DataAccessException { try { getSession().saveOrUpdate(passenger); } catch (HibernateException e) { e.printStackTrace(); //nkons debug throw convertHibernateAccessException(e); } } The problem is that when the user submits the form in which all these are contained, the savePassenger is called (as it should) but nor does it update the passengers or throw an exception. What am I doing wrong? The thing is that in the list with passengers, I am keeping the Ids of the passengers, not the full Passenger Object, because the DataSqueezer produced long strings that (I believe) caused some random problems in submission: blank screens or no reaction. I am using Tapestry 4.1.3. Any help would be really appreciated. Thank you in advance, Grigoris