Re: T5.3: customize validation messages (2)
Hm, I just noticed that on deployment this line appears in the logs: /Could not add object with duplicate id 'ValidationMessages'. The duplicate object has been ignored./ So what am I supposed to do - contribute my customized validation messages at first somehow or use a different id? -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-2-tp4681506p4685253.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.3: customize validation messages (2)
In a http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-td4659356.html previous post I was trying to figure out how to customize the validation messages and came up with this (using Scala): / def contributeComponentMessagesSource(assetSource: AssetSource, config: OrderedConfiguration[Resource]) { config.add(ValidationMessages, assetSource.resourceForPath(com/mycompany/ValidationMessages.properties), *before:AppCatalog*) }/ *The problem is that it's not deterministic: sometimes it works and sometimes it doesn't.* I assume that the last parameter before:... is responsible, but I can't figure out how (after: also didn't work). Any suggestions? -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-2-tp4681506p4681506.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
How to use a different zone to update after the AJAX submit?
Let's assume I have *2 zones* and *1 event link*. I set up the event link to update zone #1 with the current time on click (zone=zone1). What if, on the server-side after the submit is issued, I decide that */before noon/ zone #1* and */after noon/ zone #2* is updated. Is this in any way possible? [PS: My real use case is updating a complete form vs. only the status bar in case of errors/warnings] Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-use-a-different-zone-to-update-after-the-AJAX-submit-tp4669860p4669860.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to use a different zone to update after the AJAX submit?
Thanks for the lightning-fast reply [maybe you also have an answer for my other http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-td4659356.html question ] :) I will give it a try, I thought it was just for updating /multiple/ zones, not also a /different/ zone. Cheers! -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-use-a-different-zone-to-update-after-the-AJAX-submit-tp4669860p4669894.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3: customize validation messages
I'll summarize the problem: *How do I change the default validation messages in Tapestry 5.3?* -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-tp4659356p4666592.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3: customize validation messages
I'm afraid I'd need a little more guidance than this. I tried this (in Scala) - which didn't seem to have any effect: /def contributeComponentMessagesSource(bundles: OrderedConfiguration[Resource], typeCoercer: TypeCoercer) { val path = MyValidationMessages.properties val resource = typeCoercer.coerce(path, classOf[Resource]) bundles.add(validationMessages, resource) }/ *The debugger tells me that the resource is found - but bundles.add() takes a 'key' argument - which one should I use? Or am I on the wrong track?* It seems the 'old' way was just deprecated without giving any info on how to do it now :-? Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-tp4659356p4667884.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.3: customize validation messages
I'm running T5.3 and want to overwrite the existing validation messages. I created my own file 'MyValidationMessages.properties' and tried to contribute it. But I only found references to the deprecated 'contributeComponentMessagesSource', or hints to 'contributeComponentMessagesSource' - but I don't quite understand how to apply it to my case. What's the correct way? Cheers, Stephan -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-tp4659356p4659356.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
How to set 'parameters' on EventLink?
I was trying out the new 'parameters' property of the EventLink, but I don't know how it's supposed to work - I tried: /t:eventlink t:id=init parameters=literal:test// But I only get /UnknownValueException: Could not find a coercion from type java.lang.String to type java.util.Map./ What am I doing wrong? Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-set-parameters-on-EventLink-tp4630532p4630532.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to set 'parameters' on EventLink?
Thanks a lot you guys for clearing that up! :-) -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-set-parameters-on-EventLink-tp4630532p4630695.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Ajax Navigation
I have a web page similar to GMail: one list of items, sub-folders (like Spam/Inbox) and separate items to 'go in to'. Everything works via AJAX, but now I want to have bookmarkable URLs. Any recommendations on how to achieve this with Tapestry? Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Ajax-Navigation-tp4627764p4627764.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax Navigation
Thanks a lot for your post! :-) I looked at what you suggested, are there any hints/tips on how to integrate such functionality with Tapestry? I suppose a JS script (like history.js) should receive and handle + request and 'call' Tapestry to actually do the rendering. But I can't seem to come up with a good way on how to 'squeeze' the library in-between. Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Ajax-Navigation-tp4627764p4628324.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Scala + v5.3 + ${}: IntrospectionException
I just tried to reference a variable from a Scala case class in a template file when I received this: /java.beans.IntrospectionException: type mismatch between read and write methods/ I used something like ${currentEntity.id} when the exception occured, just ${currentEntity} works. I'm not 100% certain that it has to do with Scala, yet, but it seems like it. I think in v5.2 it worked. *Does anyone have a clue why this happens or how to fix it?* Oh, here is part of the stacktrace: /java.lang.RuntimeException: java.beans.IntrospectionException: type mismatch between read and write methods at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:103) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.getAdapter(PropertyAccessImpl.java:68) / Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Scala-v5-3-IntrospectionException-tp4590266p4590266.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Scala + v5.3 + ${}: IntrospectionException
Thanks for your reply. I tried adding @BeanProperty to the case class and it still fails - BUT the stacktrace is different: /Caused by: java.beans.IntrospectionException: type mismatch between read and write methods at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:603) at java.beans.PropertyDescriptor.setWriteMethod(PropertyDescriptor.java:270) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.addPropertyIfScalaGetterMethod(PropertyAccessImpl.java:156) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.addPropertiesFromScala(PropertyAccessImpl.java:138) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:97)/ It appears as though somebody especially wrote methods just to handle Scala classes, but it leaves me even more puzzled as to why it fails then. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Scala-v5-3-IntrospectionException-tp4590266p4590494.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Scala + v5.3 + ${}: IntrospectionException
Hm, I tried to debug and went to the root of the exception: java.beans.PropertyDescriptor.findPropertyType It seems that the read method for the 'id' field is /public java.lang.Object com.mycompany.sql.model.DataEntity.id()/ while the write method is /public void com.mycompany.sql.model.DataEntity.id_$eq(long)/ I will try a few things to see if I can somehow resolve this. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Scala-v5-3-IntrospectionException-tp4590266p4590540.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Remove CSS JS stacks in v5.3
Actually I do! I have my own implementation based on https://github.com/got5/tapestry5-jquery tapestry5-jquery . And it works, too :-) So the question still stands, *how to get rid of it*? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Remove-CSS-JS-stacks-in-v5-3-tp4578833p4582042.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Remove CSS JS stacks in v5.3
I recently upgraded to v5.3 and noticed that my previous method of removing the default Tapestry stylesheet and javascript stacks didn't work anymore (I decorated JavaScriptSupport and disabled importStack() etc.). What's the best way to get rid of the two stacks completely? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Remove-CSS-JS-stacks-in-v5-3-tp4578833p4578833.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Remove CSS JS stacks in v5.3
Thanks for the suggestion! It seems AssetStack was removed in v5.3. But I modified it to this (using Scala): def contributeJavaScriptStackSource(configuration: MappedConfiguration[String, JavaScriptStack]) { configuration.`override`(core, new JavaScriptStack { def getInitialization = def getStylesheets = Collections.emptyList() def getJavaScriptLibraries = Collections.emptyList() def getStacks = Collections.emptyList() }); } This removes almost everything except for: /ProgressiveDisplay.js/ (which I guess is not actually a part of the stack). Any ideas how to remove it, too? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Remove-CSS-JS-stacks-in-v5-3-tp4578833p4579214.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: how to use asset from component library in template?
Thanks for the explanation! Very much appreciated :-) On Mon, Jul 11, 2011 at 9:30 PM, Nillehammer-2 [via Tapestry] ml-node+4576210-1636130599-151...@n5.nabble.com wrote: Hi stephanos2k, By the way, the stylesheet in my library references some images [background-image: /images/error.png], what's the best way to make this work when using the library? CSS files are assets that are not parsed like templates. So dynamic insertion of asset paths won't work here. To make background-image urls work with assets either put them into a style-addribute in the particular element or use a style.../style section in your template(s). I myself use the latter and have put everything together in my layout component. Regards, nillehammer -- http://www.winfonet.eu - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4576210i=0 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4576210i=1 -- If you reply to this email, your message will be added to the discussion below: http://tapestry.1045711.n5.nabble.com/how-to-use-asset-from-component-library-in-template-tp4574973p4576210.html To unsubscribe from how to use asset from component library in template?, click herehttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4574973code=c3RlcGhhbi5iZWhua2VAZ29vZ2xlbWFpbC5jb218NDU3NDk3M3w0OTkxMDQ0NDk=. -- View this message in context: http://tapestry.1045711.n5.nabble.com/how-to-use-asset-from-component-library-in-template-tp4574973p4579225.html Sent from the Tapestry - User mailing list archive at Nabble.com.
how to use asset from component library in template?
I'm in the middle of moving assets from one monolithic Tapestry app to a 'common' base library assets. Of course now I have to adapt my asset paths, but it's somewhat awkward: new asset path: /com/mycompany/style.css/ old layout path: /com.appname.components.Layout.tml/ Now when I want to reference the styesheet in my layout, the only way I could make it work was: link href=${asset:/../../mycompany/style.css}/ *Isn't there a better way?* PS: I also added a LibraryMapping for com.mycompany and can correctly load components from the libarary. Couldn't I use this virtual folder to access the assets directly somehow? -- View this message in context: http://tapestry.1045711.n5.nabble.com/how-to-use-asset-from-component-library-in-template-tp4574973p4574973.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: how to use asset from component library in template?
Have you tried link href=${classpath:/com/mycompany/style.css}/? /Could not convert 'classpath:/com/mycompany/style.css' into a component parameter binding: Error parsing property expression 'classpath:/com/mycompany/style.css': Unable to parse input at character position 11./ (v5.3) Better yet, why don't you use @Import? Well, this is a long story. The gist is that I'm using tools like CoffeeScript, LessCSS and HeadJS - so the files I use in development are different from the ones in production. By the way, the stylesheet in my library references some images [background-image: /images/error.png], what's the best way to make this work when using the library? -- View this message in context: http://tapestry.1045711.n5.nabble.com/how-to-use-asset-from-component-library-in-template-tp4574973p4575317.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: contribute to head from a page
Thanks for clearing that up. Yet, I'm still thinking it might be very intuitive to create an additional head tag in the sub-page which is then merged with the template's head - it just feels right to define stylesheets scripts in the .tml and not in the code. But that's just me :-) Cheers, Stephan -- View this message in context: http://tapestry.1045711.n5.nabble.com/contribute-to-head-from-a-page-tp4376587p4379584.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: contribute to head from a page
Guys, thanks for the reply. But in my post I said I can't use annotations, since the assets are different for production mode. So @Import doesn't work for me! PS: You may ask yourself why I use different assets: I use LESS for CSS and have multiple .less files in development and one .css file in production mode... -- View this message in context: http://tapestry.1045711.n5.nabble.com/contribute-to-head-from-a-page-tp4376587p4378056.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
contribute to head from a page
I have a layout L and page P. The layout has a few scripts stylesheets which are needed everywhere. But P requires a few specific files. How can I add a stylesheet and a script to the final head ? - I tried just defining a head in P, assuming it would be merged; didn't work. - I can't use annotations, since the assets are different for production mode. Can I somehow use a block in layout and overwrite it in the page? PS: Using Tapestry 5.2.5 Cheers, Stephan -- View this message in context: http://tapestry.1045711.n5.nabble.com/contribute-to-head-from-a-page-tp4376587p4376587.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
AJAX ActionLink within ProgressiveDisplay
Hi, I was just build a table (via t:loop) that includes an t:actionLink in each row. The table itself is loaded via progressiveDisplay. The t:actionlink is supposed to issue an AJAX request to update a zone that lies within the t:progressiveDisplay. My problem: the t:actionLink does nothing. I investigated...and built a small example. Example.tml t:progressivedisplay t:actionlink t:zone=zone1 t:id=btn1Btn 1/t:actionlink t:actionlink t:zone=zone2 t:id=btn2Btn 2/t:actionlink t:zone t:id=zone1zone1/t:zone /t:progressivedisplay t:zone t:id=zone2zone2/t:zone Btn1 Btn2 are loaded via the t:progressivedisplay. Zone1 as well, only Zone2 is there at page load. The resulting HTML is: div id=progressivedisplay class=t-zone /start.btn1 Btn 1 /start.btn2 Btn 2 div id=zone1_12f6347aa94 class=t-zonezone1/div /div div id=zone2 class=t-zonezone2/div The zone2 has a 'regular' id and the zone1 an 'adapted' - perfectly alright so far. But when I looked into the JSON response of the t:progressivedisplay I noticed... ... linkZone : [ { linkId : btn1_12f6347aa94, url : /start.btn1, zoneId : zone1 }, { linkId : btn2_12f6347aa94, url : /start.btn2, zoneId : zone2 } ] ...that the linking isn't working! Btn2 is properly linked to zone2, but btn1 is linked to (non-existing) zone1! I looked in the tapestry.js file and found this line: var zoneElement = zoneId == '^' ? $(element).up('.t-zone') : $(zoneId); This is where the zoneId from the reponse is used to find the appropriate HTML element. Obviously it can't find it. Am I on to something here or did I screw up my application somehow (I use a few decorates)? PS: I have to add that I'm using the jquery plugin for Tapestry, so this might affect this behavior. Cheers, Stephan -- View this message in context: http://tapestry.1045711.n5.nabble.com/AJAX-ActionLink-within-ProgressiveDisplay-tp4308800p4308800.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
GZIP: Tapestry or Apache
Out of sheer interest: Assuming Apache is used in front of Tapestry, which of the two would be the best place to GZIP resources? Why? PS: Considering speed, CPU/memory usage compatibility - not considering: setup maintenance Cheers, Stephanos -- View this message in context: http://tapestry.1045711.n5.nabble.com/GZIP-Tapestry-or-Apache-tp4264432p4264432.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Customizing the Layout Component
Thanks a lot for the info, Barry! Will definitely check it out. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Customizing-the-Layout-Component-tp4234938p4258643.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Customizing the Layout Component
In my Layout I'd like to distinguish between 2 states (let's just say red or blue). Those are known/set by each page individually - it inherits from BasePageRed or BasePageBlue (which go back to BasePage where the parameter Col is defined). How do I 'get' the parameter value from the BasePage (class) to the Layout (tml)? PS: I am aware that I can set the parameter in Page.tml - but I don't want to repeat myself in each file. Cheers, Stephanos -- View this message in context: http://tapestry.1045711.n5.nabble.com/Customizing-the-Layout-Component-tp4234938p4234938.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Customizing the Layout Component
Thanks for the quick response! Hm, I didn't know that this would break the class hierarchy. I understand the issue like this (hope it works in HTML/Mail): Layout.tml Page.tml -- Result -- Page.java BasePageRed.java BasePage.java [read P] [Set P] [Declare P] I am far from completely grasping what goes on when Tapestry renders, but I though the tmls ('left') and classes ('right') are merged somehow. I assumed I could tell Layout to 'expect' a Parameter coming from the class side. Alternatively, setting the parameter in every Page.tml (few dozen) just didn't seem so 'DRY'. But your solution sounds very reasonable - I was just wondering :-) Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Customizing-the-Layout-Component-tp4234938p4235829.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: remove HTML comments from output
Thanks to you two - I think the TemplateParser option does everything I need now. I'm quite amazed how simply Tapestry can be customized. -- View this message in context: http://tapestry.1045711.n5.nabble.com/remove-HTML-comments-from-output-tp3415110p3424881.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: remove HTML comments from output
That sounds interesting. #1: Is there any 'documentation' to get started with the MarkupRendererFilter? I can't see where exactly I can manipulate the DOM in [renderMarkup(MarkupWriter writer, MarkupRenderer renderer)]. #2: And do you think it's the fastest method? - since, if I understand correctly, this is called for each pageview. Couldn't the template itself be filtered only once and the 're-used'? Cheers, Stephanos -- View this message in context: http://tapestry.1045711.n5.nabble.com/remove-HTML-comments-from-output-tp3415110p3423068.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: remove HTML comments from output
Would it make more sense (performance-wise) to remove the HTML comments in the 'SaxTemplateParser'? I remembered that there was an option in Tapestry to compress whitespaces from templates. I dug around the Tapestry source a bit and found the 'SaxTemplateParser' which apparently parses each template once before 'using' it for each request (correct me if I'm wrong). What do you think? Can I override the parser somehow? -- View this message in context: http://tapestry.1045711.n5.nabble.com/remove-HTML-comments-from-output-tp3415110p3423090.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: remove HTML comments from output
Cool - thanks for the info! I just implemented it, works like a charm. In case anyone is interested in this - here is my code (Scala): # AppModule def decorateTemplateParser(parser: TemplateParser) = new TemplateParser() { import scala.collection.JavaConversions._ def parseTemplate(templateResource: Resource) = { val res = parser.parseTemplate(templateResource) val tokens = res.getTokens.filter(t = t.getTokenType != TokenType.COMMENT) new ComponentTemplateImpl(res.getResource, tokens, res.getComponentIds, res.isExtension, null) } } The only thing I'm confused about is the last constructor parameter of the ComponentTemplate (Maplt;String, Listlt;TemplateTokengt; overrides) which I had to set to null because I can't get the data out of the result object. Is this problematic? -- View this message in context: http://tapestry.1045711.n5.nabble.com/remove-HTML-comments-from-output-tp3415110p3424135.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
remove HTML comments from output
I think Tapestry should be able to remove the HTML comments from the rendered result - IF the user explicitly enables this. I saw that this was discussed before, but apparently no actions were taken (right?). The only reasons I can think of NOT to do it are: a) slower rendering because of additional computing overhead - the overhead is probably quite small, if it isn't, I bet the stripped version could easily be cached b) problems with browser specific 'comments' ([if lt IE 6]) - the section could simply be ignored (or Javascript can be used for those conditional commands) In the end the benefits would be: - smaller output - comments are kept private - they are for internal purposes only anyway What do you think? -- View this message in context: http://tapestry.1045711.n5.nabble.com/remove-HTML-comments-from-output-tp3415110p3415110.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org