Updating a Field on event in Tapestry5

2011-03-10 Thread gauravchopra
Hi I am new to Tapestry, I am using Tapestry 5.2.2 version. I have a requirement to update another textfield on blur event of a field. for example: say I have 2 fields TextField A TextField B Enter any value in TextField A, a server call will be made and update the Textfield B. Appreciate

Re: remove HTML comments from output

2011-03-10 Thread stephanos2k
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

Re: remove HTML comments from output

2011-03-10 Thread stephanos2k
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

How to Get Service Without @Inject annotation

2011-03-10 Thread Yohan Yudanara
Hi.. Could anyone give me an example how to get service bean, without using @Inject annotation, in page class? Is it using ObjectLocator? What built-in service to inject, in order to use ObjectLocator? I can use this when using tapestry-spring and spring ioc: @Inject private ApplicationContext

Re: How to Get Service Without @Inject annotation

2011-03-10 Thread Igor Drobiazko
Injecting ObjectLocator into a page or component class is not supported. You need to provide a wrapper service, which uses ObjectLocator. Then inject it into your page and retrieve your services. Alternatively you can retrieve the Registry from ServletContext. Check this out.

Re: Updating a Field on event in Tapestry5

2011-03-10 Thread LLTYK
Define update another textfield. Are you putting some result from the server in it? Read up ZoneUpdater: http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxonevent Although it's annoyingly tricky to refresh form fields. The example refreshes some plain text. -- View this

Re: remove HTML comments from output

2011-03-10 Thread Howard Lewis Ship
You could decorate the TemplateParser service and convert its output to drop the CommentToken objects inside the returned ComponentTemplate object (that is, return a new ComponentTemplate that filters its output somewhat). On Thu, Mar 10, 2011 at 2:39 AM, stephanos2k

Uploading then displaying Images

2011-03-10 Thread Rich M
Hi, I think I've run into a conceptual understanding roadblock in trying to setup uploading then displaying of images in my application. I've got the uploading part working so far, although since my application is deployed as a WAR, the files upload to a system folder. That works alright,

Re: URL protocol versioning in Tapestry 5

2011-03-10 Thread abangkis
Hi Howard. Thanks a lot for your explanation. On Thu, Mar 10, 2011 at 1:23 AM, Howard Lewis Ship hls...@gmail.com wrote: The philosophy in Tapestry is that action links are transient ... their value is dependent on the exact structure of the page which can change between deployments ... and

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 16:37:29 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! I had read this thread http://tapestry.1045711.n5.nabble.com/How-to-display-Blob-byte-array-image-td2436148.html along with other information regarding uploading/displaying images. I think I'm a bit

Re: Uploading then displaying Images

2011-03-10 Thread Rich M
On 03/10/2011 03:17 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 10 Mar 2011 16:37:29 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! I had read this thread http://tapestry.1045711.n5.nabble.com/How-to-display-Blob-byte-array-image-td2436148.html along with other information

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 17:49:14 -0300, Rich M rich...@moremagic.com wrote: Okay, that makes sense. Is there a way to use the StreamResponse instead of the URL then to display an image in the browser? Unless you want to generate one of that data URLs

Re: remove HTML comments from output

2011-03-10 Thread stephanos2k
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._

Re: remove HTML comments from output

2011-03-10 Thread Robert Zeigler
MarkupRendererFilter: renderMarkup(MarkupWriter writer, MarkupRenderer renderer) { renderer.renderMarkup(writer);//allow the rest of the filters to work. Document doc = writer.getDocument(); //now you can manipulate the dom via the doc variable. }

Re: remove HTML comments from output

2011-03-10 Thread Robert Zeigler
You could probably do this, if you felt so inclined. You can't override SaxTemplateParser directly. Instead, you would override TemplateParser (contributed by InternalModule), and use that to instantiate your custom/overridden SaxTemplateParser. One clarification: template /parsing/ is

Re: remove HTML comments from output

2011-03-10 Thread Howard Lewis Ship
... and I'd tend towards a modified version of what he's already done, which is to strip out the TemplateTokens as they are parsed by the TemplateParser. However, what he's done could be improved just a bit. public TemplateParser decorateTemplateParser(final TemplateParser delegate) { return

Re: Uploading then displaying Images

2011-03-10 Thread Rich M
On 03/10/2011 04:21 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 10 Mar 2011 17:49:14 -0300, Rich M rich...@moremagic.com wrote: Okay, that makes sense. Is there a way to use the StreamResponse instead of the URL then to display an image in the browser? Unless you want to generate one of

Re: Uploading then displaying Images

2011-03-10 Thread Josh Canfield
I think this thread has gotten me very confused. You have uploaded files, presumably you know where they are and can identify them. You want to get those files to display in your browser. In order to do that you create an img src=/ tag that contains a URL as the value of the src attribute that

Re: Updating a Field on event in Tapestry5

2011-03-10 Thread Josh Canfield
I am new to Tapestry, I am using Tapestry 5.2.2 version. I have a requirement to update another textfield on blur event of a field. Generally I would write a bit of javascript that watches for the blur event and move the data over. Enter any value in TextField A, a server call will be made

#tapestry5 twitter tag

2011-03-10 Thread Howard Lewis Ship
If you are a Twitter user, you might have noticed that the Tapestry committers, and others, are using the #tapestry5 tag in their tweets about Tapestry. If you use Tapestry and Twitter (even together!) feel free to tweet about what your are working on, or even just that you like/enjoy Tapestry.

Re: #tapestry5 twitter tag

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 20:58:20 -0300, Howard Lewis Ship hls...@gmail.com wrote: If you are a Twitter user, you might have noticed that the Tapestry committers, and others, are using the #tapestry5 tag in their tweets about Tapestry. If you use Tapestry and Twitter (even together!) feel free to

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 19:24:52 -0300, Rich M rich...@moremagic.com wrote: Primarily because I can't think of a reasonable way to build a URL to the file that could actually be served. I wish I was more knowledgeable about servlets and such, but if my application is running from a WAR, how

Re: Uploading then displaying Images

2011-03-10 Thread Kalle Korhonen
On Thu, Mar 10, 2011 at 4:11 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 10 Mar 2011 19:24:52 -0300, Rich M rich...@moremagic.com wrote: Primarily because I can't think of a reasonable way to build a URL to the I think you have a confusion here. The folder structure you

Re: Uploading then displaying Images

2011-03-10 Thread Josh Canfield
Sorry, but that's a really bad advice - never put uploaded files under the context path of your application. What happens when you update the WAR? Strongly agree.                return new BufferedImageStreamResponse(ImageIO.read(imageStorage.getImageInputStream(imageId))); What is the

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 22:02:04 -0300, Josh Canfield joshcanfi...@gmail.com wrote: Sorry, but that's a really bad advice - never put uploaded files under the context path of your application. What happens when you update the WAR? Strongly agree. I agree too. I put my uploaded files in the

Re: Uploading then displaying Images

2011-03-10 Thread Kalle Korhonen
On Thu, Mar 10, 2011 at 5:02 PM, Josh Canfield joshcanfi...@gmail.com wrote: Sorry, but that's a really bad advice - never put uploaded files under the context path of your application. What happens when you update the WAR? Strongly agree.                return new

Re: How to Get Service Without @Inject annotation

2011-03-10 Thread Yohan Yudanara
Thank you very much for your help. I use the registry from ServletContext. I'm using this code: @Inject private Context context; and use this statement to get bean: Registry registry = (Registry) context.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME); entityManager =