Re: Referencing the context path from within Javascript?

2012-01-30 Thread Thiago H. de Paula Figueiredo
On Mon, 30 Jan 2012 11:03:16 -0200, Julien Martin wrote: @Thiago, I actually wanted to avoid an additional dependency. That's ok, but then you're not using a stack. It would have worked if you included it as a library. I've never used tapestry5-jquery myself, but I do think it deserves to

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
@Thiago, I actually wanted to avoid an additional dependency. I am going to include the autocomplete javascript within the root layout as a library. @All Thanks all for helping me with this issue!! I understand how Tapestry deals with javascript much better now!! [?] Regards, Julien. 2012/1/30 T

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
I tried using the "@Import stack=" in order to include the jquery libraries to no avail. I get this: Render queue error in SetupRender[Index:childminderlayout.layout]: No JavaScriptStack with name 'context:/js/jquery-1.6.2.js'. Any one has any clue? Regards, Julien. 2012/1/30 Julien Martin > @Th

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
@Thiago: ok will do. 2012/1/30 Thiago H. de Paula Figueiredo > On Mon, 30 Jan 2012 08:14:40 -0200, Julien Martin > wrote: > > I have actually. The issue is how to replace a variable within the js >> file with the appropriate value. >> > > You don't. Make it a parameter of a function you'll cal

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
You're right François, It is an issue with the inclusion order of my files. I noticed that the files @Import(ed) by my main layout component come after the files @Import(ed) by the pages that use that layout. It should be the other way around. Is there a way to have more control over that? Julien.

Re: Referencing the context path from within Javascript?

2012-01-30 Thread François Facon
This should work. Perhaps a conflict regading inclusion order of your js file. At this point you have to debug with firebug to see why Tapestry.Initializer.bignibou_autocomplete() is not defined. perhaps extend failed as jquery was already there. Regards François ---

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
Hi François, I like your solution as it seems more flexible. I tried to implement it as follows: /js/jquery.autocomplete.js: *jQuery.noConfict();* *(function($) {* * $.extend(Tapestry.Initializer, {* * bignibou_autocomplete : function(specs) {* * $("#accountPostcode").autocomplete({* * source : fu

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
Thanks Lenny, Is the dependency to "com.flowlogix.web.services.AssetMinimizer" necessary? Is there a "pure-T5" way of retrieving the string from the script? Here is what I came up with borrowing from your code: *javaScriptSupport.addScript(getString(openStream(jsAutocomplete)), link);* * * * pri

Re: Referencing the context path from within Javascript?

2012-01-30 Thread François Facon
It would be better to use js object and pass parameter to constructor. for prototype see http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust for jquery https://github.com/got5/tapestry5-jquery/blob/master/src/

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Lenny Primak
Take a look at these: http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/java/com/flowlogix/web/mixins/ColorHighlight.java http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/ColorHighlight.js On Jan 30, 2012, at

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
Thanks François, I have actually. The issue is how to replace a variable within the js file with the appropriate value. This seems easy enough with an inline script as above but if the script is located in its own file I don't know how to achieve the desired effect. Regards, Julien. Le 30 janvier

Re: Referencing the context path from within Javascript?

2012-01-30 Thread François Facon
Hi Julien, did you try the use of @Import to import your js file as explained http://tapestry.apache.org/javascript.html? Regards François 2012/1/30 Julien Martin : > Hi Thiago! > > Using your advice, I managed to generate the link easily. I have also moved > the script to a separate file as adv

Re: Referencing the context path from within Javascript?

2012-01-30 Thread Julien Martin
Hi Thiago! Using your advice, I managed to generate the link easily. I have also moved the script to a separate file as advised. Now what remains unclear to me is that the *addScript* method takes a String and not a url to my javascript file. So on the one hand I have my link, on the other my ja

Re: Referencing the context path from within Javascript?

2012-01-29 Thread Thiago H. de Paula Figueiredo
On Sun, 29 Jan 2012 19:22:31 -0200, Julien Martin wrote: Thiago, Hi! Yes it is indeed a Tapestry page. Here is the java code for it (there is no template for this page): So the correct way of generating an URL for a page is to @Inject PageRenderLinkSource and use one of its methods. Th

Re: Referencing the context path from within Javascript?

2012-01-29 Thread Thiago H. de Paula Figueiredo
On Sat, 28 Jan 2012 20:12:06 -0200, Julien Martin wrote: Hello Thiago, Hi! It is on a page template. The advice you provide does work. However, I am realizing I need to concatenate the protocol+host+etc. which is a bit cumbersome. Page templates don't handle anything. Pages, components

Re: Referencing the context path from within Javascript?

2012-01-28 Thread Julien Martin
e path is worked out. > My javascript is located at the following path: > "/context-path/account/childminderRegistration" and I need to resolve the > following path: "/context-path/utils/JSonPostcodesWithQueryParam" for the > url javascript variable. > > Is there a si

Re: Referencing the context path from within Javascript?

2012-01-28 Thread Thiago H. de Paula Figueiredo
On Sat, 28 Jan 2012 17:43:17 -0200, Julien Martin wrote: Hello, Hi! How can I achieve this with T5? As a general answer, you can @Inject HttpServletRequest and use its getContextPath() method. Depending on who handles this URL (a Tapestry page? a Tapestry page event handler method), t

Multiple level context path not working in tomcat

2010-08-14 Thread Dongmei Cao
Hi, I have Tapestry 5.1.0.5 web app. I’m trying to deploy it to Tomcat 6 with multi-level context path (e.g. /myWebApps/admin) by renaming my war file to myWebApps#admin.war. But I’m getting exception like the following when accessing the web app: Caused by: org.apache.tapestry5

Re: Referencing the context path in AppModule

2009-07-06 Thread P . Stavrinides
uot;nille hammer" To: "Tapestry users" Sent: Monday, 6 July, 2009 14:39:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Referencing the context path in AppModule Hi Peter, I presume that the error occurs, because in developent environment the file is accessi

Re: Referencing the context path in AppModule

2009-07-06 Thread nille hammer
, nillehammer == http://www.winfonet.eu - original Nachricht Betreff: Referencing the context path in AppModule Gesendet: Mo, 06. Jul 2009 Von: Peter Stavrinides > Hi all, > > I am trying to referencing a properties file in my AppModule... currently I > am doing this based

Referencing the context path in AppModule

2009-07-06 Thread Peter Stavrinides
Hi all, I am trying to referencing a properties file in my AppModule... currently I am doing this based on the wiki example: public ContextSymbolProvider buildFileSystemPropertiesSymbolProvider() { return new ContextSymbolProvider( "src/main/webapp/WEB-INF/context

Re: simplere way to access context path ?

2008-01-07 Thread Hugo Palma
n = '${asset:context:login}'; i just want to forward another page... On Jan 7, 2008 2:13 PM, Hugo Palma <[EMAIL PROTECTED]> wrote: There sure is: ${asset:context:images/x.gif} Mohammad Shamsi wrote: hi all, i want to use context path in my page templa

Re: simplere way to access context path ?

2008-01-07 Thread Mohammad Shamsi
; > > document.location = '${asset:context:login}'; > > > > > > i just want to forward another page... > > > > > > On Jan 7, 2008 2:13 PM, Hugo Palma <[EMAIL PROTECTED]> wrote: > > > > > >> There sure

Re: simplere way to access context path ?

2008-01-07 Thread Hugo Palma
wrote: There sure is: ${asset:context:images/x.gif} Mohammad Shamsi wrote: hi all, i want to use context path in my page template. now i do like this : @Inject Request request; public String getContext() { return request.getContextPath(); } in .tml : any better way

Re: simplere way to access context path ?

2008-01-07 Thread Davor Hrg
e on my page : > > > document.location = '${asset:context:login}'; > > > i just want to forward another page... > > > > On Jan 7, 2008 2:13 PM, Hugo Palma <[EMAIL PROTECTED]> wrote: > > > There sure is: > > > > ${asset:context:images/x.gif}

Re: simplere way to access context path ?

2008-01-07 Thread Mohammad Shamsi
sset:context:images/x.gif} > > Mohammad Shamsi wrote: > > hi all, > > > > i want to use context path in my page template. > > now i do like this : > > > > @Inject > > Request request; > > > > public String getContext() { > > return r

Re: simplere way to access context path ?

2008-01-07 Thread Hugo Palma
There sure is: ${asset:context:images/x.gif} Mohammad Shamsi wrote: hi all, i want to use context path in my page template. now i do like this : @Inject Request request; public String getContext() { return request.getContextPath(); } in .tml : any better way ? (for example a

simplere way to access context path ?

2008-01-07 Thread Mohammad Shamsi
hi all, i want to use context path in my page template. now i do like this : @Inject Request request; public String getContext() { return request.getContextPath(); } in .tml : any better way ? (for example a symbol or ...) -- sincerely yours M. H. Shamsi

Re: [T4] One way to get the context path when you need to inject it straight into HTML

2007-11-01 Thread Kalle Korhonen
: > > > > ... > > > > Note the path to csshover2.htc, obviously it's going to break if I don't > > get the context path in there. Here's my solution: > > > > > ><!-- This is an IE6 and below hack to make the men

Re: [T4] One way to get the context path when you need to inject it straight into HTML

2007-11-01 Thread Jim Roycroft
The mailinglist/nabble formatting cut out some stuff... here's the relevant snippet: Jim Roycroft wrote: > > ... > > Note the path to csshover2.htc, obviously it's going to break if I don't > get the context path in there. Here's my solution: > > &

[T4] One way to get the context path when you need to inject it straight into HTML

2007-11-01 Thread Jim Roycroft
. --> body{ behavior: url(/scripts/csshover2.htc); } Note the path to csshover2.htc, obviously it's going to break if I don't get the context path in there. Here's my solution: <!-- This is an IE6 and below hack to make the menu work. --> body{ behavior: url

Re: [T-4.0] LinkFactoryImpl caches context path

2007-05-08 Thread Christian Haselbach
On Tue, May 08, 2007 at 11:24:33AM +0200, Christian Haselbach wrote: > Oh, got that wrong. Tapestry uses the servlet path, not the context > path, to create the url. On a closer look, I had it right the first time. The context path is cached and used. I guess I have to use a custom LinkF

Re: [T-4.0] LinkFactoryImpl caches context path

2007-05-08 Thread Christian Haselbach
On Tue, May 08, 2007 at 11:08:29AM +0200, Christian Haselbach wrote: > LinkFactoryImpl seems to cache the context path from the first request. > This causes EngineServiceLink to have the context path of the first > request and not of the current request. > > Is there an easy

[T-4.0] LinkFactoryImpl caches context path

2007-05-08 Thread Christian Haselbach
Hi, LinkFactoryImpl seems to cache the context path from the first request. This causes EngineServiceLink to have the context path of the first request and not of the current request. Is there an easy way to have the current context path in EngineServiceLink? I know it is a bit unusual to have

RE: friendly url problem when setting context path to the web root directory

2006-12-30 Thread Firas Adiler
ration for tapestry.url.ServiceEncoders look like? -Original Message- From: Huang Gehua [mailto:[EMAIL PROTECTED] Sent: Thursday, December 28, 2006 8:13 PM To: Tapestry users Subject: friendly url problem when setting context path to the web root directory I was a beginner of Tapestry 4.0.x. In my

friendly url problem when setting context path to the web root directory

2006-12-28 Thread Huang Gehua
I was a beginner of Tapestry 4.0.x. In my T4 project I've activated Friendly URLs and it works fine. But when i deploy the T4 project to a new Virtual Host and set the context path as the web root I meet problems.I can visit the Home page with http://10.0.0.201/app.But can't visit or

Re: Context path

2006-07-25 Thread Rodnei Couto
Thanks.. Work fine... []'s Rondnei Couto Shing Hing Man escreveu: You can inject javax.servlet.ServletContext into your serivce (I presume you meant a Tapestry service). The use servletContext.getRealPath("/") to retrieve the context path. A how-to on injecting javax.servlet

Context path

2006-07-25 Thread Rodnei Couto
Hi list, I'm creating a service. I need to know the context path to get an image used in my service. How can I discover this? Thanks, Rodnei Couto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Context path

2006-07-25 Thread Shing Hing Man
You can inject javax.servlet.ServletContext into your serivce (I presume you meant a Tapestry service). The use servletContext.getRealPath("/") to retrieve the context path. A how-to on injecting javax.servlet.ServletContext into a tapestry service is at http://lombok.d

Re: Context path

2006-07-25 Thread Blackwings
From the Tapestry main Servlet (ApplicationServlet or directly from GenricServlet) you can call getServletContext().getRealPath("/"); 2006/7/25, Rodnei Couto <[EMAIL PROTECTED]>: Hi list, I'm creating a service. I need to know the context path to get an image used in

Context path

2006-07-25 Thread Rodnei Couto
Hi list, I'm creating a service. I need to know the context path to get an image used in my service. How can I discover this? Thanks, Rodnei Couto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e