[T4] - Tapestry.bind basic Ajax example
Hi there, I'm trying to do an XHR request using the same method as @DirectLink component. Here is the code: script type=text/javascript var xmlDoc = new ActiveXObject(Microsoft.XMLDOM); var content; function SendAjaxRequest() { tapestry.bind (/PhoneBook/app?component=%24DirectLinkamp;page=majaxamp;service=direct); tapestry.load(xmlDoc); content = xmlDoc.responseXML; } /script p a href=# onclick=SendAjaxRequest()click here/a /p The server-side component does work when called when using DirectLink, but when clicking the link as coded above it doesn't. 1./ in IE7 it simply doesn't work but the page is displayed 2./ in Firefox it doesn't display the whole page and Firebug sends an error message:uncaught exception: [Exception...' Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [ nsIXMLHttpRequest.setRequestHeader] I know, I know there must be something I have misunderstood but I am a bit lost. I don't want to use DirectLink because the result of the XHR must be used in another javascript function. Any help/remarks ? Thanks Loïc
Re: T4: creating search form and search result on one page
remove public Collection list; inside search(), just do setList( getService().search(getClient()) ); On 10/19/07, Joshua Jackson [EMAIL PROTECTED] wrote: Here is the html template of search form and search result underneath it: span jwcid=@Layout form jwcid=[EMAIL PROTECTED] table width=100% tr td width=35%span jwcid=@Insert value=message:app.number //td tdinput jwcid=[EMAIL PROTECTED] value=ognl:client.appNumber //td /tr tr tdspan jwcid=@Insert value=message: payor.name //td tdinput jwcid=[EMAIL PROTECTED] value=ognl:client.payorName //td /tr tr tdnbsp;/td td input type=submit jwcid=[EMAIL PROTECTED] action=listener:search value=message:search/ /td /tr /table /form table jwcid=@contrib:Table source=ognl:list columns=Client:appNumber tr td colspan=4 class=tablePages span jwcid=[EMAIL PROTECTED]:TablePages/ /td /tr /table /span Here is the search listener: public Collection list; public abstract Collection getList(); public abstract void setList(Collection list); public abstract Client getClient(); public abstract void setClient(Client client); private Service service; public void search() { list = getService().search(getClient()); } public Service getService() { return service; } And here is the page definition: page-specification class=pages.Panel inject property=service object=spring:service/ /page-specification On 10/19/07, Jonathan Barker [EMAIL PROTECTED] wrote: Post your code. I've never had a problem. -- What you want today, may not exist tommorrow Blog: http://joshuajava.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting
Re: how to have persistent data in querystring?
Well i guess the onPassivate-method isn't entirely out of the question since it gives a central place to handle this on the page-level as well. The tagging-variant seems nicer though. I thought i read somewhere in the documentation that a 'client-side persistence strategy' was on the horizon, which would include 'automagically' inserting persistent fields into the url. I can't find anymore where i've read it though. Since we're talking about updating / changing the url, in a somehwat related post i asked about possibilities for rewriting the url. (I havn't found time to try to resolve this) http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397 from that post: For example I want a Venue bean with name venueX and id=123 to show up as: http://test.com/venue/countryname/cityname/venux/123 Notice the countryname and cityname, which aren't fields of the Venue-page but are derived from the association venue-page-- venue-- city -- country. I think adapting the onPassivate-method for inserting these values into the url and onActivate() for only parsing the necessary fields from this url is all that is needed to get this to work, is this correct? btw: a Url-rwrite filtr for this won't work because i also want to have the translation the other way around.: not only from nice -- tapestry internal but also from tapestry internal -- nice. Url-rewrite only gives me the former. Later on i would like to strip the first /venue/ -- http://test.com/venue/countryname/cityname/venux/123 would become http://test.com/countryname/cityname/venux/123. This becomes harder, because tapestry now doesn't know anymore to which page to redirect. out-of-the-box it starts searching for a page with countryname. I guess for this I have to dig a little deeper. Hmm, in hindsight i believe this isn't at all a coherent post, with almost no question or conclusion to be found... consider this a kind of braindump ;-) cheers, Geert-Jan Josh Canfield-2 wrote: Ok, and you want to do this without implementing a passivate method on page B... That doesn't seem like a trivial problem to solve, especially in a safe and general way. I'm pretty sure nothing like that exists now, but I believe all the hooks are available to create your own annotations so you could do the implementation. If I were going to attempt this I'd start by looking at adding new activate/passivate methods via the class transform worker... There are a lot of issues to deal with... but you could start by taking a look at http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ComponentClassTransformWorker.html and the source for the @Environmental annotation might help http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/EnvironmentalWorker.html Good luck, Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: that would require a lot of manual labor for each and every link. btw: my question relates to T5. Say i had page B injected into page A. I could then initialize page B and return page B from some eventhandler on page A. What I would want to accomplish is that this automatically results in redirecting to page B (as normal) with the difference that the url of page B shows my predefined fields of page B in the url (I know I mentioned querystring in the subjectheader, i mean the path-part of the url) The mechanism could know this because at designtime I could have tagged the fields of page B that I wanted to include in the url. This would enable me to once define these fields at design-time and not having to worry about it later on. is anything like this out there, or planned at all? Thanks in advance, Geert-Jan Josh Canfield-2 wrote: If you want to parameters to the query string then you can create a link and add parameters to it from within your page. http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Link.html Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: okay, I like peristent data very much. On the other hand I want to have pages in which several persistent properties are encoded into the querystring (for better bookmarking and other requirements from a user-perspective). so my question is: is there a way to encode / decode certain persistent properties into the querystring? The best would be a way without having to change the onActivate and onPassivate-methods of course... Thanks in advance, Geert-Jan -- View this message in context: http://www.nabble.com/how-to-have-persistent-data-in-querystring--tf4646238.html#a13272192 Sent from the Tapestry - User mailing list archive at 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
Re: t5 form submit not fired
ok that explains a few things ;-) thanks for clearing that up. Nick Westgate wrote: Hugo defined myAction as returning a StreamResponse - no redirect. Geert-Jan says myAction returns void - a redirect occurs. Cheers, Nick. Hugo Palma wrote: If your getting a page redirect then your doing something wrong in your code. If you post it i can try and find the problem. Britske wrote: after the onchange occurs, this is what happens in my app: 1. onMyAction is executed() (this is an actionlink which returns nothing (void) which results in a client-side redirect to the same page (as per documentation: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html ) 2. onActivate() is executed on the server, which I think proofs that there was indeed a redirect. please don't get me wrong, I still think it's an elegant solution... //Geert-Jan HugoPalma wrote: Why do you say a redirect happens ? Does your page refresh when you change the selectbox value ? It won't refresh because all your doing is call a javascript function. There's no redirect. Britske wrote: since your example effectively calls a ActionLink through AJAX, a redirect DOES happen. It's the result of the ActionLink. If I'm seeing this correctly what then is the advantage of doing a call through AJAX or a form.submit() for the discussed purpose, since both result in a redirect? //Geert-Jan HugoPalma wrote: The method i suggested is implemented so that you don't have to submit the form. That's what AJAX is all about, you make a request to the server and then update a portion of your page based on the response from the server using javascript. There's no page reload of for submission. Britske wrote: yeah indeed it is only called once when the template is rendered, I discovered now. However i don't need to return a dynamic url or whatever based on the getTheLink-method. what I need is a way to reliably catch a event at the server/java side (in this case onChange) every time that event occurs. I don't want to submit my form when that happens (otherwise I could use the method you suggested) but I want to update some information on the current page and stay there. This means that i have to redirect to my currentpage with a couple of queryparameters in the url which depend on the selected fields in the form. hmm, the more i think about it, I don't think i really need to catch the event server-side. I just redirect to the current page on onChange using javascript:window.location=... and parse the querystrings correctly in it. hope this makes sense, thanks! Geert-Jan HugoPalma wrote: That's the way it's supposed to be. You only see the getTheLink method executed once because that what it need to replace ${theLink} in your template with the correct link that is returned from your method. This is done once when the page renders. If you look at the rendered page source you won't see ${theLink} there, instead you will the the generated link to your listener. Anyway, does it really matter how many times the getTheLink method is invoked ? I think not. What really matters is that the listener method to which your getTheLink method should be returning the URL to is called whenever you call the sendRequest function. Britske wrote: thanks that works partially. However, the event is only catched twice: 1. on pageload (??m the sendRequest isn't called, but somehow the getTheLink()-method is executed.) 2. the first time i send a onchange. However after the first onchange all other onchange-event don't get getTheLink() executed, although sendRequest() is called on the client-side each time. This is my relevant code: in html: script function sendRequest() { alert(sendRequest reached); new Ajax.Request('${theLink}', {asynchronous:true,onSuccess:handleResponse}); } /script ... select t:type=select t:model=themaList t:value=thema onchange=sendRequest() name=thema id=thema tabindex=4 class=formElement/ in the page-class: public String getTheLink() { System.out.println(catched!!); return catched!; } Do you 've got any idea what causes this behavior? Thanks, Geert-Jan HugoPalma wrote: I would suggest that you use AJAX instead of doing the form submit. Although the AJAX integration in T5 is still not implemented it's very easy to do using the provided prototype and json javascripts. I did this successfully for some simple events also. Shortly, here's how i did it: In my page i have these two javascript functions: function handleResponse(xhrResponse) { var json = xhrResponse.responseText.evalJSON(true); //Do whatever you want with the server response } // -- function sendRequest() { new
Re: Tapestry 5 Roadmap
That is an incredible statement! There have been numerous discussions on this mailing list on the way T4 was made completely incompatible since it was going to incorporate the very best and then T5 was made even more incompatible to incorporate the latest. This has been a vexing issue with quite a few people and organizations who invested in T3/T4 based projects. By way of example, tell me how these products are not compatible within major releases: Websphere 4, 5, 6 WebLogic: 8, 9, 10 MySQL: 4, 5 Hibernate: 2, 3 There are some pieces that change and new features are introduced. But your don't have to do a major rewrite to use the newer version. As an example, if T5 were T4 + annotations, that would be a compatible release. But Howard has chosen to rewrite it from the ground up with no compatiblity concern. Well, thats his prerogative as this is open-source community driven development. If I want, I can take the T3 code base and establish my own framework. However, it also reflects on the popularly or lack of for Tapestry. This topic has been beaten to death and I don't wish to bring it up again. However, your point regarding versions was egregious. - Original Message - From: Christian Gruber [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, October 18, 2007 10:58 AM Subject: Re: Tapestry 5 Roadmap I'm not sure where incompatible releases comes in. No one releases 1.0 - 2.0 compatible releases except O/S vendors. That's typically what the large version number change means - these are incompatible. That's not a strike against Tapestry, that's an industry expectation. Christian On 18-Oct-07, at 6:45 AM, kranga wrote: The question is very relevant. The concern of the project should be to build out the business functionality using existing tools. If the tools in question are not yet released and in production, there is a very legitimate concern that the maintenance of the tool will become a partial focus. Tapestry may be a compelling offering technologically, but it has many other factors going against it - lack of a developer mindshare, incompatible releases in the past, etc. We have used Tapestry for big projects - but we are still using T3 since T4 and T5 are completely incompatible. You cannot push beta software past project stakeholders unless that beta software is also providing you with competitive advantage. T5 has some able competitors in Wicket and JSF/Stripes, etc while still lacking an ajax foundation for instance. So the competitive advantage is not clear cut. - Original Message - From: Alex Shneyderman [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, October 18, 2007 3:22 AM Subject: Re: Tapestry 5 Roadmap The one question I could not answer without looking ridiculous was What happens to our multi-million dollar project if Howard is hit by a bus tomorrow I think the question is irrelevant. The question you should be answering: Is the current base usable enough to push through on the project?. A relevant after-question (if answer to the above is not exactly) to answer how easy it is to add the features you are missing if you have to. And how easy it is to poke through the tapestry's source-base to fix bugs that might exist and you will find during the project's development. If you can cross off HLS as your dependency then t5 is probably the best choice to make from what's available out there :-) Alex. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 4.1.3 Archetype
hello, is there anything like ' this ' for tapestry 4.1.3 snapshot? HYPERLINK http://tapestry.apache.org/tapestry5/quickstart/http://tapestry.apache.org /tapestry5/quickstart/ Thanks, []´s Daniel Ruiz Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM
RE: T5: A Form without a Session
hi josh,you can pass your own ValidationTrackerwith a persistence strategyof your choiceto the form component using the tracker parameter. And the default tracker with session persistence will not be created.or you can create your own form component:http://www.nabble.com/T5%3A-refreshing-page-when-there-is-an-error-tf4627982.htmlg,kris[EMAIL PROTECTED] schrieb: -An: "Tapestry users" users@tapestry.apache.orgVon: "Josh Canfield" [EMAIL PROTECTED]Gesendet von: [EMAIL PROTECTED]Datum: 19.10.2007 07:32PMThema: T5: A Form without a SessionI'd like to add a form component to my page, I haven't found a way to do itwithout causing a session to be created when the page is first accessed. I'mfine if a session is created when the user actually submits the form, tohandle validation etc. but some forms are rarely used and session overheadis just unwelcome.It looks like in the form component the default validator is @Persist'dwhich is causing the session to be created. I don't want to use clientpersistence if it's going to stuff the ugly base 64 encoded object in theurl, although I haven't seen a way to change the persistence withoutchanging the default persistence for everything...So, I've gone with a standard html form for the simple search box for nowwhich is fine, but I'd like to use the t:form on other pages withoutforcing a session to be created when the form may not be submitted.Any thoughts?Thanks,Josh-- --TheDailyTube.com. Sign up and get the best new videos on the internetdelivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple select dropdown
For multiple select box you do a multiple and define size. Seems like there is no way you can do a multiple select on a dropdown though. Daniel Jue wrote: Look at the Palette or Enhanced Palette code. On 10/17/07, Daniel Jue [EMAIL PROTECTED] wrote: I think you define a size variable that tells the html control how many items to show. On 10/17/07, Jean-Philippe Steinmetz [EMAIL PROTECTED] wrote: How do you do a regular multiple selection box (as a list)? I can't seem to find anything in the component reference. Thanks, Jean-Philippe -Original Message- From: Daniel Jue [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 8:31 AM To: Tapestry users Subject: Re: multiple select dropdown No I do not think you can do that. Maybe in Flash. As a user, I wouldn't expect that to be possible. On 10/16/07, Tapestry240 [EMAIL PROTECTED] wrote: Hi everyone, Is there a way to do a multiple select from a drop down. I am not asking about the list box but a drop down(one row) where I can do multiple select. Thanks in advance, Prabhat -- View this message in context: http://www.nabble.com/multiple-select-dropdown-tf4634807.html#a1323560 3 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] - 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] -- View this message in context: http://www.nabble.com/multiple-select-dropdown-tf4634807.html#a13302651 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: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
But i 1would point out that this is a good opportunity to clean up your markup Jesse Kuhnert wrote: Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex)] location|context:/WEB-INF/Search.html, line 106 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.InappropriateExpressionException Any ideas? Thanks, Dom Couldwell Global Markets Research --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex)] location|context:/WEB-INF/Search.html, line 106 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.InappropriateExpressionException Any ideas? Thanks, Dom Couldwell Global Markets Research --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5 form submit not fired
thanks for mentioning the difference. In my case a dropdown-change causes a result-set to reload based on a new query which is shown as the main result on the page. Since this almost means rendering the entire page again, there isn't much difference between streaming the diference as Json or whatever or doing a complete reload. However ,i'm the first to admit that to do things as populating dropdown boxes (autocomplete or whatever) or changing a fraction of the page, AJAX is the way to go. Thanks again, Geert-Jan Josh Canfield-2 wrote: The whole point of AJAX is not having to return the whole page. You just want to return the part of the page that needs updating. If selecting a field in a drop down is supposed to add a dependant drop down (choose a country changes possible address fields for instance), then you only return enough information for that field to be updated and use Javascript to populate the field. Your stream response can be XML, JSON, or HTML depending on what your needs are... Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: A changes your method somehwat to return void -- redirect to current page (Thanks Nick for mentioning the difference) Could you eleborate what exactly you stream to the client in the StreamReponse you give back? This must be the entire page right? You can't just stream changes back to the client at least to my knowledge. I'm curious if in your opinion streaming the response gives a noticable performance difference than doing a redirect to the same page. //Geert-Jan HugoPalma wrote: If your getting a page redirect then your doing something wrong in your code. If you post it i can try and find the problem. Britske wrote: after the onchange occurs, this is what happens in my app: 1. onMyAction is executed() (this is an actionlink which returns nothing (void) which results in a client-side redirect to the same page (as per documentation: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html ) 2. onActivate() is executed on the server, which I think proofs that there was indeed a redirect. please don't get me wrong, I still think it's an elegant solution... //Geert-Jan HugoPalma wrote: Why do you say a redirect happens ? Does your page refresh when you change the selectbox value ? It won't refresh because all your doing is call a javascript function. There's no redirect. Britske wrote: since your example effectively calls a ActionLink through AJAX, a redirect DOES happen. It's the result of the ActionLink. If I'm seeing this correctly what then is the advantage of doing a call through AJAX or a form.submit() for the discussed purpose, since both result in a redirect? //Geert-Jan HugoPalma wrote: The method i suggested is implemented so that you don't have to submit the form. That's what AJAX is all about, you make a request to the server and then update a portion of your page based on the response from the server using javascript. There's no page reload of for submission. Britske wrote: yeah indeed it is only called once when the template is rendered, I discovered now. However i don't need to return a dynamic url or whatever based on the getTheLink-method. what I need is a way to reliably catch a event at the server/java side (in this case onChange) every time that event occurs. I don't want to submit my form when that happens (otherwise I could use the method you suggested) but I want to update some information on the current page and stay there. This means that i have to redirect to my currentpage with a couple of queryparameters in the url which depend on the selected fields in the form. hmm, the more i think about it, I don't think i really need to catch the event server-side. I just redirect to the current page on onChange using javascript:window.location=... and parse the querystrings correctly in it. hope this makes sense, thanks! Geert-Jan HugoPalma wrote: That's the way it's supposed to be. You only see the getTheLink method executed once because that what it need to replace ${theLink} in your template with the correct link that is returned from your method. This is done once when the page renders. If you look at the rendered page source you won't see ${theLink} there, instead you will the the generated link to your listener. Anyway, does it really matter how many times the getTheLink method is invoked ? I think not. What really matters is that the listener method to which your getTheLink method should be returning the URL to is called whenever you call the sendRequest function. Britske wrote: thanks that works partially. However, the event is only catched twice: 1. on pageload (??m the sendRequest isn't called, but somehow the getTheLink()-method
Re: how to have persistent data in querystring?
your welcome;-) i have a look it myself. Josh Canfield-2 wrote: I haven't played with the client persistence strategy, but the documentation ( http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/persist.html) says The field is persisted onto the client; you will see an additional query parameter in each URL (or an extra hidden field in each form). The nightly builds implementation is adding the client persisted fields into the url as a query parameter using a Base 64 encoded object stream... ( http://tapestry.formos.com/nightly/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/ClientPersistentFieldStorageImpl.html#line.41 ) If you want attractive URLs then I'd say this isn't what you are looking for... Although I got to learn a bit about it so thanks for asking the question :) Josh On 10/19/07, Britske [EMAIL PROTECTED] wrote: Well i guess the onPassivate-method isn't entirely out of the question since it gives a central place to handle this on the page-level as well. The tagging-variant seems nicer though. I thought i read somewhere in the documentation that a 'client-side persistence strategy' was on the horizon, which would include 'automagically' inserting persistent fields into the url. I can't find anymore where i've read it though. Since we're talking about updating / changing the url, in a somehwat related post i asked about possibilities for rewriting the url. (I havn't found time to try to resolve this) http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397 from that post: For example I want a Venue bean with name venueX and id=123 to show up as: http://test.com/venue/countryname/cityname/venux/123 Notice the countryname and cityname, which aren't fields of the Venue-page but are derived from the association venue-page-- venue-- city -- country. I think adapting the onPassivate-method for inserting these values into the url and onActivate() for only parsing the necessary fields from this url is all that is needed to get this to work, is this correct? btw: a Url-rwrite filtr for this won't work because i also want to have the translation the other way around.: not only from nice -- tapestry internal but also from tapestry internal -- nice. Url-rewrite only gives me the former. Later on i would like to strip the first /venue/ -- http://test.com/venue/countryname/cityname/venux/123 would become http://test.com/countryname/cityname/venux/123. This becomes harder, because tapestry now doesn't know anymore to which page to redirect. out-of-the-box it starts searching for a page with countryname. I guess for this I have to dig a little deeper. Hmm, in hindsight i believe this isn't at all a coherent post, with almost no question or conclusion to be found... consider this a kind of braindump ;-) cheers, Geert-Jan Josh Canfield-2 wrote: Ok, and you want to do this without implementing a passivate method on page B... That doesn't seem like a trivial problem to solve, especially in a safe and general way. I'm pretty sure nothing like that exists now, but I believe all the hooks are available to create your own annotations so you could do the implementation. If I were going to attempt this I'd start by looking at adding new activate/passivate methods via the class transform worker... There are a lot of issues to deal with... but you could start by taking a look at http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ComponentClassTransformWorker.html and the source for the @Environmental annotation might help http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/EnvironmentalWorker.html Good luck, Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: that would require a lot of manual labor for each and every link. btw: my question relates to T5. Say i had page B injected into page A. I could then initialize page B and return page B from some eventhandler on page A. What I would want to accomplish is that this automatically results in redirecting to page B (as normal) with the difference that the url of page B shows my predefined fields of page B in the url (I know I mentioned querystring in the subjectheader, i mean the path-part of the url) The mechanism could know this because at designtime I could have tagged the fields of page B that I wanted to include in the url. This would enable me to once define these fields at design-time and not having to worry about it later on. is anything like this out there, or planned at all? Thanks in advance, Geert-Jan Josh Canfield-2 wrote: If you want to parameters to the query string then you can create a link and add parameters to it from within your page.
T5: page with form re-rendering
Hi, I have a form like following, it sets a persisted variable(country) in the page class, initially it includes addressHK component in the page, when user choose 'US' and click submit, the page is supposed to be refreshed withh addressUS component included, but it never happen, it seems page was never got re-rendered, any way to force the re-rendering t:form t:id=editProfile input t:type=select t:id=country t:model=CountryList/ t:if test=${isUS}t:addressUS //t:if t:if test=${isHK}t:addressHK //t:if input type=submit name=Submit id=Submit value=Submit / /t:form -- View this message in context: http://www.nabble.com/T5%3A-page-with-form-re-rendering-tf4656465.html#a13305488 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: Templates and t:body
Ok, still have a problem. No error, just no header rendered. --- Here is my Header.java file: package try.tapestry.components; public class Header { public Header() { } } Here is my Header.tml file: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body h1This is a header/h1 /body /html Here is my Start.tml !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleHello World Title/title /head body t:Header / Hello world. Start. /body /html --- Here is my Start.java package try.tapestry.pages; public class Start { public Start () { } } - Here is the output when rendered (no header was inserted, just ignored. No errors.): !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;htmlheadlink href=/assets/tapestry/default.css rel=stylesheet type=text/cssmeta content=text/html; charset=ISO-8859-1 http-equiv=Content-TypetitleHello World Title/title/headbody Hello world. Start. /body/html - Any help is appreciated. I MUST be missing something so simple. Bob -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 18:20 To: Tapestry users Subject: Re: Templates and t:body Tapestry mandates a certain organization to your classes. If you page class is org.example.pages.MyPage then your component class (here, Header) must be org.example.components.Header. The .pages. and .components. part is very specific to Tapestry, hard-wired into the framework. Those are packages that Tapestry scans at startup to locate page and component classes, and such classes must exist there (for Tapestry to perform runtime code transformation and hot class reloading). On 10/19/07, Heck, Bob [EMAIL PROTECTED] wrote: I created the Header.java and I am getting the same error: Unable to resolve 'Header' to a component class name Here is my Header.java public class Header { public Header() { } } and my Header.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; h1This is a header/h1 /html Just to make sure, I dug into my classes files that were deployed and the Header.class is there. Josh, what version of Tapestry are you using? I am using 5.0.6-SNAPSHOT Angelo, what version are you using? Thanks in advance. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josh Canfield Sent: Thursday, October 18, 2007 12:36 To: Tapestry users Subject: Re: Templates and t:body Did you create the Header.java? On 10/18/07, Angelo Chen [EMAIL PROTECTED] wrote: Hi Jonathan, I tried your approach, but does not work, here is my steps: 1. create a Header.html in component directory, it has only one line:h2hi my heading/h2 2. I use it in my start.html: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleStart Page/title /head body h1Start Page/h1 t:Header / /body /html It complains:Unable to resolve component type 'Header' to a component class name. Anything I'm missing here? Thanks, A.C. Jonathan Barker wrote: Sorry, I only answered half of your question. Including your standard header into hello.tml would be something like: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleMy Tapestry Application/title /head body t:header / My Page Specific Content /body /html -Original Message- From: Heck, Bob [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 12:27 PM To: Tapestry users Subject: RE: Templates and t:body Or, maybe I should just start at the top. I have a header that I want to display on every page. That header html (tml) markup is stored in the file header.tml How do I include this in another file, say hello.tml? What is the syntax and component usage? -Original Message- From: Thiago H de Paula Figueiredo [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 12:17 To: Tapestry users Subject: Re: Templates and t:body On Thu, 18 Oct 2007 13:05:48 -0300, Heck, Bob [EMAIL PROTECTED] wrote: So, how does layout.tml know to use specific.tml to fill in the t:body/ tag? Does it have to be injected somehow? Where does it get a reference? How is
Re: T5: page with form re-rendering
problem solved, test should be: test=isUS Angelo Chen wrote: t:if test=${isUS}t:addressUS //t:if t:if test=${isHK}t:addressHK //t:if input type=submit name=Submit id=Submit value=Submit / /t:form -- View this message in context: http://www.nabble.com/T5%3A-page-with-form-re-rendering-tf4656465.html#a13305697 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: Templates and t:body
Tapestry mandates a certain organization to your classes. If you page class is org.example.pages.MyPage then your component class (here, Header) must be org.example.components.Header. The .pages. and .components. part is very specific to Tapestry, hard-wired into the framework. Those are packages that Tapestry scans at startup to locate page and component classes, and such classes must exist there (for Tapestry to perform runtime code transformation and hot class reloading). On 10/19/07, Heck, Bob [EMAIL PROTECTED] wrote: I created the Header.java and I am getting the same error: Unable to resolve 'Header' to a component class name Here is my Header.java public class Header { public Header() { } } and my Header.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; h1This is a header/h1 /html Just to make sure, I dug into my classes files that were deployed and the Header.class is there. Josh, what version of Tapestry are you using? I am using 5.0.6-SNAPSHOT Angelo, what version are you using? Thanks in advance. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josh Canfield Sent: Thursday, October 18, 2007 12:36 To: Tapestry users Subject: Re: Templates and t:body Did you create the Header.java? On 10/18/07, Angelo Chen [EMAIL PROTECTED] wrote: Hi Jonathan, I tried your approach, but does not work, here is my steps: 1. create a Header.html in component directory, it has only one line:h2hi my heading/h2 2. I use it in my start.html: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleStart Page/title /head body h1Start Page/h1 t:Header / /body /html It complains:Unable to resolve component type 'Header' to a component class name. Anything I'm missing here? Thanks, A.C. Jonathan Barker wrote: Sorry, I only answered half of your question. Including your standard header into hello.tml would be something like: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleMy Tapestry Application/title /head body t:header / My Page Specific Content /body /html -Original Message- From: Heck, Bob [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 12:27 PM To: Tapestry users Subject: RE: Templates and t:body Or, maybe I should just start at the top. I have a header that I want to display on every page. That header html (tml) markup is stored in the file header.tml How do I include this in another file, say hello.tml? What is the syntax and component usage? -Original Message- From: Thiago H de Paula Figueiredo [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 12:17 To: Tapestry users Subject: Re: Templates and t:body On Thu, 18 Oct 2007 13:05:48 -0300, Heck, Bob [EMAIL PROTECTED] wrote: So, how does layout.tml know to use specific.tml to fill in the t:body/ tag? Does it have to be injected somehow? Where does it get a reference? How is this done? t:body just renders whatever was put inside your t:layout tag. ;) The specific page uses the layout, not the inverse. -- Thiago H. de Paula Figueiredo Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg Tecnologia da Informação Ltda. http://www.eteg.com.br --- -- 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] -- View this message in context: http://www.nabble.com/Templates-and-t%3Abody-tf4647900.html#a13279344 Sent from the Tapestry - User mailing list archive at 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Done http://jira.opensymphony.com/browse/OGNL-130 Thanks, Dom Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] mTo Tapestry users 10/19/2007 05:23 users@tapestry.apache.org PMcc Subject Please respond to Re: Tap 4.0.2 to 4.1.2 migration loop Tapestry users / ognl issue [EMAIL PROTECTED] ache.org Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR,
Re: Tapestry 4.1.3 Archetype
http://tapestry.apache.org/tapestry4.1/tapestry-archetype/index.html I haven't tried it, though. In case you need to find it again, it's on the T4.1 page, left-hand nav, under Modules. -- Kevin On 10/19/07 3:01 PM, in article [EMAIL PROTECTED], Daniel Ruiz [EMAIL PROTECTED] wrote: hello, is there anything like ' this ' for tapestry 4.1.3 snapshot? HYPERLINK http://tapestry.apache.org/tapestry5/quickstart/http://tapestry.apache.org /tapestry5/quickstart/ Thanks, []´s Daniel Ruiz Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Templates and t:body
Ok Found the answer as to why this was not working. This may be trivial to seasoned users, but a hard catch for a newbie. For components, such as the Header we have been talking about, the .java file AND the .tml file need to both reside in the components package. I had been putting the .tml file in the webroot and the .java for the component in components. Moved the .tml to components package and it works now. Bob -Original Message- From: Heck, Bob [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 19:33 To: Tapestry users Subject: RE: Templates and t:body Ok, still have a problem. No error, just no header rendered. --- Here is my Header.java file: package try.tapestry.components; public class Header { public Header() { } } Here is my Header.tml file: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body h1This is a header/h1 /body /html Here is my Start.tml !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleHello World Title/title /head body t:Header / Hello world. Start. /body /html --- Here is my Start.java package try.tapestry.pages; public class Start { public Start () { } } - Here is the output when rendered (no header was inserted, just ignored. No errors.): !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;htmlheadlink href=/assets/tapestry/default.css rel=stylesheet type=text/cssmeta content=text/html; charset=ISO-8859-1 http-equiv=Content-TypetitleHello World Title/title/headbody Hello world. Start. /body/html - Any help is appreciated. I MUST be missing something so simple. Bob -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 18:20 To: Tapestry users Subject: Re: Templates and t:body Tapestry mandates a certain organization to your classes. If you page class is org.example.pages.MyPage then your component class (here, Header) must be org.example.components.Header. The .pages. and .components. part is very specific to Tapestry, hard-wired into the framework. Those are packages that Tapestry scans at startup to locate page and component classes, and such classes must exist there (for Tapestry to perform runtime code transformation and hot class reloading). On 10/19/07, Heck, Bob [EMAIL PROTECTED] wrote: I created the Header.java and I am getting the same error: Unable to resolve 'Header' to a component class name Here is my Header.java public class Header { public Header() { } } and my Header.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; h1This is a header/h1 /html Just to make sure, I dug into my classes files that were deployed and the Header.class is there. Josh, what version of Tapestry are you using? I am using 5.0.6-SNAPSHOT Angelo, what version are you using? Thanks in advance. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josh Canfield Sent: Thursday, October 18, 2007 12:36 To: Tapestry users Subject: Re: Templates and t:body Did you create the Header.java? On 10/18/07, Angelo Chen [EMAIL PROTECTED] wrote: Hi Jonathan, I tried your approach, but does not work, here is my steps: 1. create a Header.html in component directory, it has only one line:h2hi my heading/h2 2. I use it in my start.html: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleStart Page/title /head body h1Start Page/h1 t:Header / /body /html It complains:Unable to resolve component type 'Header' to a component class name. Anything I'm missing here? Thanks, A.C. Jonathan Barker wrote: Sorry, I only answered half of your question. Including your standard header into hello.tml would be something like: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleMy Tapestry Application/title /head body t:header / My Page Specific Content /body /html -Original Message- From: Heck, Bob [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 12:27 PM To: Tapestry users Subject: RE: Templates and t:body Or, maybe I should just start at the top. I have a header that I want to display on every page. That header html (tml) markup is
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex)] location|context:/WEB-INF/Search.html, line 106 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.InappropriateExpressionException Any ideas? Thanks, Dom Couldwell Global Markets Research --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
RE: Tapestry 4.1.3 Archetype
Thanks Kalle, I will take a look on Trails too, and sorry about the 'snapshot'. :D []´s Daniel Andrade Ruiz -Original Message- From: Kalle Korhonen [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 3:46 PM To: Tapestry users Subject: Re: Tapestry 4.1.3 Archetype Well, there's the Trails archetype that uses T4.1.3: http://trailsframework.org/Quick+Start. And btw, 4.1.3 is released, not a snapshot. Kalle On 10/19/07, Daniel Ruiz [EMAIL PROTECTED] wrote: hello, is there anything like ' this ' for tapestry 4.1.3 snapshot? HYPERLINK http://tapestry.apache.org/tapestry5/quickstart/; http://tapestry.apache.org /tapestry5/quickstart/ Thanks, []´s Daniel Ruiz Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: A Form without a Session
I'd like to add a form component to my page, I haven't found a way to do it without causing a session to be created when the page is first accessed. I'm fine if a session is created when the user actually submits the form, to handle validation etc. but some forms are rarely used and session overhead is just unwelcome. It looks like in the form component the default validator is @Persist'd which is causing the session to be created. I don't want to use client persistence if it's going to stuff the ugly base 64 encoded object in the url, although I haven't seen a way to change the persistence without changing the default persistence for everything... So, I've gone with a standard html form for the simple search box for now which is fine, but I'd like to use the t:form on other pages without forcing a session to be created when the form may not be submitted. Any thoughts? Thanks, Josh -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.
Re: how to have persistent data in querystring?
I haven't played with the client persistence strategy, but the documentation ( http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/persist.html) says The field is persisted onto the client; you will see an additional query parameter in each URL (or an extra hidden field in each form). The nightly builds implementation is adding the client persisted fields into the url as a query parameter using a Base 64 encoded object stream... ( http://tapestry.formos.com/nightly/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/ClientPersistentFieldStorageImpl.html#line.41 ) If you want attractive URLs then I'd say this isn't what you are looking for... Although I got to learn a bit about it so thanks for asking the question :) Josh On 10/19/07, Britske [EMAIL PROTECTED] wrote: Well i guess the onPassivate-method isn't entirely out of the question since it gives a central place to handle this on the page-level as well. The tagging-variant seems nicer though. I thought i read somewhere in the documentation that a 'client-side persistence strategy' was on the horizon, which would include 'automagically' inserting persistent fields into the url. I can't find anymore where i've read it though. Since we're talking about updating / changing the url, in a somehwat related post i asked about possibilities for rewriting the url. (I havn't found time to try to resolve this) http://www.nabble.com/url-rewriting-in-Tapestry-5-tf4496726.html#a12823397 from that post: For example I want a Venue bean with name venueX and id=123 to show up as: http://test.com/venue/countryname/cityname/venux/123 Notice the countryname and cityname, which aren't fields of the Venue-page but are derived from the association venue-page-- venue-- city -- country. I think adapting the onPassivate-method for inserting these values into the url and onActivate() for only parsing the necessary fields from this url is all that is needed to get this to work, is this correct? btw: a Url-rwrite filtr for this won't work because i also want to have the translation the other way around.: not only from nice -- tapestry internal but also from tapestry internal -- nice. Url-rewrite only gives me the former. Later on i would like to strip the first /venue/ -- http://test.com/venue/countryname/cityname/venux/123 would become http://test.com/countryname/cityname/venux/123. This becomes harder, because tapestry now doesn't know anymore to which page to redirect. out-of-the-box it starts searching for a page with countryname. I guess for this I have to dig a little deeper. Hmm, in hindsight i believe this isn't at all a coherent post, with almost no question or conclusion to be found... consider this a kind of braindump ;-) cheers, Geert-Jan Josh Canfield-2 wrote: Ok, and you want to do this without implementing a passivate method on page B... That doesn't seem like a trivial problem to solve, especially in a safe and general way. I'm pretty sure nothing like that exists now, but I believe all the hooks are available to create your own annotations so you could do the implementation. If I were going to attempt this I'd start by looking at adding new activate/passivate methods via the class transform worker... There are a lot of issues to deal with... but you could start by taking a look at http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ComponentClassTransformWorker.html and the source for the @Environmental annotation might help http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry/internal/services/EnvironmentalWorker.html Good luck, Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: that would require a lot of manual labor for each and every link. btw: my question relates to T5. Say i had page B injected into page A. I could then initialize page B and return page B from some eventhandler on page A. What I would want to accomplish is that this automatically results in redirecting to page B (as normal) with the difference that the url of page B shows my predefined fields of page B in the url (I know I mentioned querystring in the subjectheader, i mean the path-part of the url) The mechanism could know this because at designtime I could have tagged the fields of page B that I wanted to include in the url. This would enable me to once define these fields at design-time and not having to worry about it later on. is anything like this out there, or planned at all? Thanks in advance, Geert-Jan Josh Canfield-2 wrote: If you want to parameters to the query string then you can create a link and add parameters to it from within your page. http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Link.html Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: okay, I like
Re: t5 form submit not fired
The whole point of AJAX is not having to return the whole page. You just want to return the part of the page that needs updating. If selecting a field in a drop down is supposed to add a dependant drop down (choose a country changes possible address fields for instance), then you only return enough information for that field to be updated and use Javascript to populate the field. Your stream response can be XML, JSON, or HTML depending on what your needs are... Josh On 10/18/07, Britske [EMAIL PROTECTED] wrote: A changes your method somehwat to return void -- redirect to current page (Thanks Nick for mentioning the difference) Could you eleborate what exactly you stream to the client in the StreamReponse you give back? This must be the entire page right? You can't just stream changes back to the client at least to my knowledge. I'm curious if in your opinion streaming the response gives a noticable performance difference than doing a redirect to the same page. //Geert-Jan HugoPalma wrote: If your getting a page redirect then your doing something wrong in your code. If you post it i can try and find the problem. Britske wrote: after the onchange occurs, this is what happens in my app: 1. onMyAction is executed() (this is an actionlink which returns nothing (void) which results in a client-side redirect to the same page (as per documentation: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html ) 2. onActivate() is executed on the server, which I think proofs that there was indeed a redirect. please don't get me wrong, I still think it's an elegant solution... //Geert-Jan HugoPalma wrote: Why do you say a redirect happens ? Does your page refresh when you change the selectbox value ? It won't refresh because all your doing is call a javascript function. There's no redirect. Britske wrote: since your example effectively calls a ActionLink through AJAX, a redirect DOES happen. It's the result of the ActionLink. If I'm seeing this correctly what then is the advantage of doing a call through AJAX or a form.submit() for the discussed purpose, since both result in a redirect? //Geert-Jan HugoPalma wrote: The method i suggested is implemented so that you don't have to submit the form. That's what AJAX is all about, you make a request to the server and then update a portion of your page based on the response from the server using javascript. There's no page reload of for submission. Britske wrote: yeah indeed it is only called once when the template is rendered, I discovered now. However i don't need to return a dynamic url or whatever based on the getTheLink-method. what I need is a way to reliably catch a event at the server/java side (in this case onChange) every time that event occurs. I don't want to submit my form when that happens (otherwise I could use the method you suggested) but I want to update some information on the current page and stay there. This means that i have to redirect to my currentpage with a couple of queryparameters in the url which depend on the selected fields in the form. hmm, the more i think about it, I don't think i really need to catch the event server-side. I just redirect to the current page on onChange using javascript:window.location=... and parse the querystrings correctly in it. hope this makes sense, thanks! Geert-Jan HugoPalma wrote: That's the way it's supposed to be. You only see the getTheLink method executed once because that what it need to replace ${theLink} in your template with the correct link that is returned from your method. This is done once when the page renders. If you look at the rendered page source you won't see ${theLink} there, instead you will the the generated link to your listener. Anyway, does it really matter how many times the getTheLink method is invoked ? I think not. What really matters is that the listener method to which your getTheLink method should be returning the URL to is called whenever you call the sendRequest function. Britske wrote: thanks that works partially. However, the event is only catched twice: 1. on pageload (??m the sendRequest isn't called, but somehow the getTheLink()-method is executed.) 2. the first time i send a onchange. However after the first onchange all other onchange-event don't get getTheLink() executed, although sendRequest() is called on the client-side each time. This is my relevant code: in html: script function sendRequest() { alert(sendRequest reached); new Ajax.Request('${theLink}', {asynchronous:true,onSuccess:handleResponse}); } /script ... select t:type=select t:model=themaList t:value=thema onchange=sendRequest() name=thema id=thema tabindex=4
Re: Tapestry 5 Roadmap
Egregious? That demands and answer and perhaps an apology. Firstly, try porting and app from Weblogic Portal 8 to Weblogic Portal 9. It has conversion tools, but it's not compatible without up- conversion. Upconversion doesn't count. Then think of eclipse and the plugins geared for such. As to appservers themselves, core platforms have a higher bar for backwards compatibility and always have than component frameworks. Databases are also externally compatible only because they conform to an API they didn't write themselves (SQL92, etc.). I'm not sure about MySQL, but many SQL databases that have native APIs are not API compatible between releases when using that native API. And try to move the files over between databases, and you have to do an export and an import, because you can't just install an upgrade and have everything work. As I said, upconversion doesn't count. We're talking about a component framework, which is highly finicky. If you update the major versions, it's not unreasonable that existing components won't work. I mean Howard could have spent a lot of effort making a bridge or translation system to maintain compatibility (which is often how total rewrites gain their backwards compatibility... see windows), but he didn't (clearly) think that was worth his time. Of course, it's open-source, so you could do it, if you wanted it badly enough. Oh, and blah blah blah fork blah blah. You know that part. Regardless of all of this, at least one major apache project has this policy too, and that's from 2 minutes on google.http://apr.apache.org/versioning.html . Major versions mean incompatible releases. That's (in my experience, except for platforms themselves) often the (non-marketing) meaning of major versions. A few other examples: http://www.jmock.org/versioning.html http://xstream.codehaus.org/versioning.html http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/VersionInformation.html http://wiki.eclipse.org/Version_Numbering ... oh, and most unix libraries. While not absolutely true in all cases, it is most certainly true in many cases, and is not unreasonable. Now apologize for your imputation, sir, for you are substantially, demonstrably incorrect. Christian. P.S. Ok, I'm not really that offended, just irritated with how personal you just made it. I don't like being called out for simple observations from 15 years in software development. On 19-Oct-07, at 7:00 AM, kranga wrote: That is an incredible statement! There have been numerous discussions on this mailing list on the way T4 was made completely incompatible since it was going to incorporate the very best and then T5 was made even more incompatible to incorporate the latest. This has been a vexing issue with quite a few people and organizations who invested in T3/T4 based projects. By way of example, tell me how these products are not compatible within major releases: Websphere 4, 5, 6 WebLogic: 8, 9, 10 MySQL: 4, 5 Hibernate: 2, 3 There are some pieces that change and new features are introduced. But your don't have to do a major rewrite to use the newer version. As an example, if T5 were T4 + annotations, that would be a compatible release. But Howard has chosen to rewrite it from the ground up with no compatiblity concern. Well, thats his prerogative as this is open-source community driven development. If I want, I can take the T3 code base and establish my own framework. However, it also reflects on the popularly or lack of for Tapestry. This topic has been beaten to death and I don't wish to bring it up again. However, your point regarding versions was egregious. - Original Message - From: Christian Gruber [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, October 18, 2007 10:58 AM Subject: Re: Tapestry 5 Roadmap I'm not sure where incompatible releases comes in. No one releases 1.0 - 2.0 compatible releases except O/S vendors. That's typically what the large version number change means - these are incompatible. That's not a strike against Tapestry, that's an industry expectation. Christian On 18-Oct-07, at 6:45 AM, kranga wrote: The question is very relevant. The concern of the project should be to build out the business functionality using existing tools. If the tools in question are not yet released and in production, there is a very legitimate concern that the maintenance of the tool will become a partial focus. Tapestry may be a compelling offering technologically, but it has many other factors going against it - lack of a developer mindshare, incompatible releases in the past, etc. We have used Tapestry for big projects - but we are still using T3 since T4 and T5 are completely incompatible. You cannot push beta software past project stakeholders unless that beta software is also providing you
Re: [T5] Connection between symbols and messages
I know from a user perspective I'd like to have things be able to default all the way out to symbol / global properties file definitions when developing libraries and such if possible There may be some performance or other internal framework decisions / reasoning behind it but I started to slowly implement these features in T4.1.x as well with good results so far. On 10/19/07, Dan Adams [EMAIL PROTECTED] wrote: So right now I have a situation where I need my library to provided some default values for some things it provides. The natural place for this seems to be FactoryDefaults. The problem is that certain things are only looked up in the component messages when determining defaults and it doesn't appear that symbols and included when searching for messages (ComponentMessageSourceImpl uses an AssetFactory and the application properties file). So the question is: Is it appropriate to have the global SymbolSource included when looking for component messages? Perhaps after the assets and application properties file? Some background on the issue: I'm adding a validator that takes an optional constraint. Rather than changing Validator to support this I just want to include a blank default constraint value for the validator in the library that contributes it. But I know this issue of looking up defaults is going to come up for other components. -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
component list parameters?
Hi, So I'm wondering if this is possible, and if not, has this been thought of? I'm wanting to add a variable list of parameters to a component, because it can take an arbitrary number of them and loop overthem. So I'm looking at something like this. A.tml div xmlns:t=blah t:b id=${literal:b1} blah content 1 /t:b t:b id=${literal:b2} blah content 2 /t:b /div And then in A.java have something like public class A { @Parameter private ListB _bs; } So then all the Bs that are direct children of A are added in as parameters. It woudl be less convenient, but still cool to do something like: div xmlns:t=blah t:parameter name=bs t:b id=${literal:b1} blah content 1 /t:b t:b id=${literal:b2} blah content 2 /t:b /t:parameter /div But have each B handled seperately and added to the list. It would make it much easier to do complex things like tabviews (with arbitrary tabs) or other such things, I think, though there may be other ways to skin this cat. Christian. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Tapestry 5 Roadmap
We have a T3 and a T4 Appliaction in production and hopefully will start a T5 development soon. I do not see a real big problem in this versions not beeing compatible. I also think you compare different kind of beasts if you compare Websphere with Tapestry. It's more like EJB 2.x to EJB 3 - and nobody cried out its incompatible. Compatibility can be the reason for stagnancy - and that is the one thing you can not balme Tapestry for :-) If you are happy with T4, just stay with it, it's maintained well, we just updated to 4.1.3 with no problem. just my 2 Cents, Max -Ursprüngliche Nachricht- Von: kranga [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. Oktober 2007 13:00 An: Tapestry users Betreff: Re: Tapestry 5 Roadmap That is an incredible statement! There have been numerous discussions on this mailing list on the way T4 was made completely incompatible since it was going to incorporate the very best and then T5 was made even more incompatible to incorporate the latest. This has been a vexing issue with quite a few people and organizations who invested in T3/T4 based projects. By way of example, tell me how these products are not compatible within major releases: Websphere 4, 5, 6 WebLogic: 8, 9, 10 MySQL: 4, 5 Hibernate: 2, 3 There are some pieces that change and new features are introduced. But your don't have to do a major rewrite to use the newer version. As an example, if T5 were T4 + annotations, that would be a compatible release. But Howard has chosen to rewrite it from the ground up with no compatiblity concern. Well, thats his prerogative as this is open-source community driven development. If I want, I can take the T3 code base and establish my own framework. However, it also reflects on the popularly or lack of for Tapestry. This topic has been beaten to death and I don't wish to bring it up again. However, your point regarding versions was egregious. - Original Message - From: Christian Gruber [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, October 18, 2007 10:58 AM Subject: Re: Tapestry 5 Roadmap I'm not sure where incompatible releases comes in. No one releases 1.0 - 2.0 compatible releases except O/S vendors. That's typically what the large version number change means - these are incompatible. That's not a strike against Tapestry, that's an industry expectation. Christian On 18-Oct-07, at 6:45 AM, kranga wrote: The question is very relevant. The concern of the project should be to build out the business functionality using existing tools. If the tools in question are not yet released and in production, there is a very legitimate concern that the maintenance of the tool will become a partial focus. Tapestry may be a compelling offering technologically, but it has many other factors going against it - lack of a developer mindshare, incompatible releases in the past, etc. We have used Tapestry for big projects - but we are still using T3 since T4 and T5 are completely incompatible. You cannot push beta software past project stakeholders unless that beta software is also providing you with competitive advantage. T5 has some able competitors in Wicket and JSF/Stripes, etc while still lacking an ajax foundation for instance. So the competitive advantage is not clear cut. - Original Message - From: Alex Shneyderman [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, October 18, 2007 3:22 AM Subject: Re: Tapestry 5 Roadmap The one question I could not answer without looking ridiculous was What happens to our multi-million dollar project if Howard is hit by a bus tomorrow I think the question is irrelevant. The question you should be answering: Is the current base usable enough to push through on the project?. A relevant after-question (if answer to the above is not exactly) to answer how easy it is to add the features you are missing if you have to. And how easy it is to poke through the tapestry's source-base to fix bugs that might exist and you will find during the project's development. If you can cross off HLS as your dependency then t5 is probably the best choice to make from what's available out there :-) Alex. - 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: T4: creating search form and search result on one page
Why dont you debug your getService().search() method and see what arguments it gets and what it returns ? It should help you find where and what the problem is... Joshua Jackson wrote: It stilll doesn't work. Does anyone have a complete sample code for this? thanks in advance, On 10/19/07, Andreas Andreou [EMAIL PROTECTED] wrote: remove public Collection list; inside search(), just do setList( getService().search(getClient()) ); -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: template-expansion sees hibernate-entity as java.lang.Boolean?
Has anyone ever experienced something similar? or has anyone used hibernate lazy-associations succesfully with expansions in T5? I'm still not sure if it's a hibernate or a tapestry thing. FYI; the error is happening in: org.apache.tapestry.internal.services.PropertyConduitSourceImpl.readMethodForTerm(PropertyConduitSourceImpl.java:370) and states: Could not convert 'firstresult.poi.city.name' into a component parameter binding: Class java.lang.Boolean does not contain a property named 'name' (within property expression 'firstresult.poi.city.name'). //Geert-Jan Britske wrote: first of all, excuse me for the post-flood, but I had some standing issues. Perhaps some of these questions can help others as well so here this one goes: I was on a roll until i wanted to include the name of a City-instance through a template expansion, which gave the error: Could not convert 'firstresult.poi.city.name' into a component parameter binding: Class java.lang.Boolean does not contain a property named 'name' (within property expression 'firstresult.poi.city.name'). However, city is of type City and not op type java.lang.Boolean! The traversal goes through a POI and a City-class which are both mapped as hibernate-entities. the traversal poi.getCity() is a lazy association. (for you hibernate gurus: @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name=cityid, nullable=false) @Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) private City city; my expansion looks like:: t:compositeBlockList t:id=comp1 t:parameter name=groupheader div style=padding:5px strong ${firstresult.poi.city.name} /strong /div /t:parameter /t:compositeBlockList What is causing this error? Could the hibernate-entity City look like a boolean (when reflection is used) before it is lazily fetched?? I can't really imagine that but who knows? anyone? thanks, Geert-Jan -- View this message in context: http://www.nabble.com/template-expansion-sees-hibernate-entity-as-java.lang.Boolean--tf4646244.html#a13289365 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 form submit not fired
A changes your method somehwat to return void -- redirect to current page (Thanks Nick for mentioning the difference) Could you eleborate what exactly you stream to the client in the StreamReponse you give back? This must be the entire page right? You can't just stream changes back to the client at least to my knowledge. I'm curious if in your opinion streaming the response gives a noticable performance difference than doing a redirect to the same page. //Geert-Jan HugoPalma wrote: If your getting a page redirect then your doing something wrong in your code. If you post it i can try and find the problem. Britske wrote: after the onchange occurs, this is what happens in my app: 1. onMyAction is executed() (this is an actionlink which returns nothing (void) which results in a client-side redirect to the same page (as per documentation: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html ) 2. onActivate() is executed on the server, which I think proofs that there was indeed a redirect. please don't get me wrong, I still think it's an elegant solution... //Geert-Jan HugoPalma wrote: Why do you say a redirect happens ? Does your page refresh when you change the selectbox value ? It won't refresh because all your doing is call a javascript function. There's no redirect. Britske wrote: since your example effectively calls a ActionLink through AJAX, a redirect DOES happen. It's the result of the ActionLink. If I'm seeing this correctly what then is the advantage of doing a call through AJAX or a form.submit() for the discussed purpose, since both result in a redirect? //Geert-Jan HugoPalma wrote: The method i suggested is implemented so that you don't have to submit the form. That's what AJAX is all about, you make a request to the server and then update a portion of your page based on the response from the server using javascript. There's no page reload of for submission. Britske wrote: yeah indeed it is only called once when the template is rendered, I discovered now. However i don't need to return a dynamic url or whatever based on the getTheLink-method. what I need is a way to reliably catch a event at the server/java side (in this case onChange) every time that event occurs. I don't want to submit my form when that happens (otherwise I could use the method you suggested) but I want to update some information on the current page and stay there. This means that i have to redirect to my currentpage with a couple of queryparameters in the url which depend on the selected fields in the form. hmm, the more i think about it, I don't think i really need to catch the event server-side. I just redirect to the current page on onChange using javascript:window.location=... and parse the querystrings correctly in it. hope this makes sense, thanks! Geert-Jan HugoPalma wrote: That's the way it's supposed to be. You only see the getTheLink method executed once because that what it need to replace ${theLink} in your template with the correct link that is returned from your method. This is done once when the page renders. If you look at the rendered page source you won't see ${theLink} there, instead you will the the generated link to your listener. Anyway, does it really matter how many times the getTheLink method is invoked ? I think not. What really matters is that the listener method to which your getTheLink method should be returning the URL to is called whenever you call the sendRequest function. Britske wrote: thanks that works partially. However, the event is only catched twice: 1. on pageload (??m the sendRequest isn't called, but somehow the getTheLink()-method is executed.) 2. the first time i send a onchange. However after the first onchange all other onchange-event don't get getTheLink() executed, although sendRequest() is called on the client-side each time. This is my relevant code: in html: script function sendRequest() { alert(sendRequest reached); new Ajax.Request('${theLink}', {asynchronous:true,onSuccess:handleResponse}); } /script ... select t:type=select t:model=themaList t:value=thema onchange=sendRequest() name=thema id=thema tabindex=4 class=formElement/ in the page-class: public String getTheLink() { System.out.println(catched!!); return catched!; } Do you 've got any idea what causes this behavior? Thanks, Geert-Jan HugoPalma wrote: I would suggest that you use AJAX instead of doing the form submit. Although the AJAX integration in T5 is still not implemented it's very easy to do using the provided prototype and json javascripts. I did this successfully for some simple events
Re: T5 Desired complex community components
Hi, here is a good place to start: http://www.jsfmatrix.net/ Click on the demo links to see what other frameworks have. The list of components is long... Regards, Borut 2007/10/17, Daniel Jue [EMAIL PROTECTED]: I was wondering what kind of components people are looking for that are not yet available as an open source example. T5 seems to have the simple html components pretty well covered, and we're all waiting anxiously for direct AJAX support. I was thinking simple things, up to the complexity of Pallete, Grid and BeanEditForm. I am using the EnhancedPallete (on the wiki) with good success, and I created an EnhancedGrid that allows for a component to be stuck in it's body (good for rows of totals that you want to align with the grid, but not have sorting apply to) Some other ideas that I've seen come up in the past: A Grid-independant Pager (sounds easy to do, but I haven't needed it yet) Fisheye Menu (Was part of Tacos?) Date Picker and Color Picker (I think they are available now) Progress Bar (would probably require AJAX to be any good) What about codified versions of these components? PivotTable (kind of like a Grid and Tree I guess) Tabs (Examples have been given, but a nice out-of-the-box one with CSS would be cool for tutorials) Dashboard (Something for dealing with IFrame layouts?) How about things that delve into areas normally reserved for web designers? (dynamic generation of Flash buttons would be a great starter example, using something like JGenerator) The Tapestry rounded-corners service is in this kind of gray area. I'm kind of hooked on the idea, especially if caching works as well as serving image files. What else is out there (either on the web or in a rich client) that you'd rather not reinvent? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 4.1.3 Archetype
Well, there's the Trails archetype that uses T4.1.3: http://trailsframework.org/Quick+Start. And btw, 4.1.3 is released, not a snapshot. Kalle On 10/19/07, Daniel Ruiz [EMAIL PROTECTED] wrote: hello, is there anything like ' this ' for tapestry 4.1.3 snapshot? HYPERLINK http://tapestry.apache.org/tapestry5/quickstart/; http://tapestry.apache.org /tapestry5/quickstart/ Thanks, []´s Daniel Ruiz Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007 3:59 PM
[T5] Connection between symbols and messages
So right now I have a situation where I need my library to provided some default values for some things it provides. The natural place for this seems to be FactoryDefaults. The problem is that certain things are only looked up in the component messages when determining defaults and it doesn't appear that symbols and included when searching for messages (ComponentMessageSourceImpl uses an AssetFactory and the application properties file). So the question is: Is it appropriate to have the global SymbolSource included when looking for component messages? Perhaps after the assets and application properties file? Some background on the issue: I'm adding a validator that takes an optional constraint. Rather than changing Validator to support this I just want to include a blank default constraint value for the validator in the library that contributes it. But I know this issue of looking up defaults is going to come up for other components. -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4: creating search form and search result on one page
It stilll doesn't work. Does anyone have a complete sample code for this? thanks in advance, On 10/19/07, Andreas Andreou [EMAIL PROTECTED] wrote: remove public Collection list; inside search(), just do setList( getService().search(getClient()) ); -- What you want today, may not exist tommorrow Blog: http://joshuajava.wordpress.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4.1: How to filter out exceptions from bots?
Thanks A LOT! Exactly what I was looking for - works great! Malin On 10/18/07, Ulrich Stärk [EMAIL PROTECTED] wrote: Malin Ljungh schrieb: Hi all, I've got some annoying stack traces in my log from bots, primarily a bot called LiteFinder but also Googlebot. (the LiteFinder seems to get lowercase URLs which results in many org.apache.tapestry.PageNotFoundExceptionsince I use uppercase first letter of my pages) I print stack trace in the exception page setException method - how can I at this point detect the user-agent and just ignore it? Cheers, Malin Just inject the WebRequest into your page and check for any unwanted user agents in your setException() method. @InjectObject(infrastructure:request) public abstract WebRequest getRequest(); public void setException(Throwable t) { String userAgent = getRequest().getHeader(User-Agent); if(!isUnwanted(userAgent)) { // user agent is valid // do your logging stuff or whatever } } Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]