Re: Hwo to redirect to another page from a vois @OnEvent method

2012-03-08 Thread Javix
:26 -0300, Javix <[hidden > email]<http://user/SendEmail.jtp?type=node&node=5547946&i=0>> > wrote: > > > I don't really know, the method signature was defined as void that's why > > I'm asking. And as it is void, in java these methods can not

Re: Hwo to redirect to another page from a vois @OnEvent method

2012-03-08 Thread Javix
; On Thu, 08 Mar 2012 12:17:47 -0300, Javix <[hidden > email]<http://user/SendEmail.jtp?type=node&node=5547914&i=0>> > wrote: > > > Is it possible to redirect to another page from inside a void method > > annotated as follows: > > Does it really need to

Hwo to redirect to another page from a vois @OnEvent method

2012-03-08 Thread Javix
Is it possible to redirect to another page from inside a void method annotated as follows: @OnEvent(value = EventConstants.ACTIVATE) public void initPage(Object[] parameters) { if(something goes wrong) { redirect to home page } } Thank you -- View this message

Tapestry 5.1 - setting default locale

2012-02-15 Thread Javix
I can't figure out how to set (force) the default locale value. here is what I added to my service module: [code] { ... configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,de,fr"); ... public void contributeComponentRequestHandler(OrderedConfiguration configuration) { configuration.add

Re: Tapestry 5 with Prototype 1.7

2012-02-10 Thread Javix
Could you tell in which place exactly did you place the new prototype.js file? Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-with-Prototype-1-7-tp3288189p5469538.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Prototype - IE9 update?

2012-02-09 Thread Javix
The link is broken :((( https://github.com/hlship/tapx/blob/master/tapx-prototype/src/main/resources/com/howardlewisship/tapx/prototype/tapestry-js-fixes.js -- View this message in context: http://tapestry.1045711.n5.nabble.com/Re-Prototype-IE9-update-tp4331824p5469075.html Sent from the Tapestr

Re: Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2012-01-12 Thread Javix
I found why it didn't work. I just replaced: Tapestry.Initializer.load = function loadPass(jsonObject){ } with Tapestry.Initializer.loadPass = function loadPass(jsonObject){ ... } I believed that 'load' was a maethod to call on Tapestry.Initializer object(unfortunately T API says

Re: Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2012-01-06 Thread Javix
One more question: How to trigger the exectution of js function. For exmaple, before the code was like that directly n the tml page: Some hard-coded meessage

Re: Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2012-01-04 Thread Javix
Finally I got it working by adding as you told: Tapestry.Initializer.load = function load(jsonObject){ .. errorText.text(jsonObject.m1) } and ot in the very begining of the call: jQuery(document).bind(Tapestry.ZONE_UPDATED_EVENT, function(e){ //load(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m

Re: Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2012-01-04 Thread Javix
It didn't work: Oups ... org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value MultiZoneUpdate[{page=org.apache.tapestry5.corelib.components.Zone@1799a64, May it's because in the javascript file the call to the load fucntion is made lie that:

Re: How to remove a locale prefix from url

2012-01-04 Thread Javix
I discovered that in the real application that was made in one only language(the client' one), there is a URLRewriterRule with SimpleRequestWrapper in use. So I have to change a little bit my question: what is the best way to implement the possibility to swith between locales in this case taking in

Difference between renderSupport.addScript and JSON addInit(function, JSON Object)

2011-12-28 Thread Javix
I have a strange behavior when usin the above methods to add javascript from inside Java classes. When I use the first one like this: //java class @Inject private Messages messages; @Environmental private RenderSupport renderSupport; @BeginRender void addJsLibs() { Strin

Internationalization - How to remove locale prefix in the URL

2011-12-27 Thread Javix
Could anybody explaine how to remove the generated by Tapestry locale prefix in the url or just avoid id? When switching the locale like this(took from the very known exmaple): public class Layout { @Inject private PersistentLocale persistentLocale; @Inject private Locale currentLocal

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Yes, I see. I'll try to replace the arguments I passed before to my JS function by JSON object. P.S. The difference is that in RoR you can embed Ruby code inside js files. -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp50943

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
@Chris: thanks again and sorry for my tone of sharpness regarding the community activity. I watched JSON technics. As far as I got it, it is just a container to keep your data, like a hash. So what is advantages to use it instead of 'renderSupport.addScript(js);' where I constructed the js function

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Thanks again, after escaping single quote it worked for me. As for JSON, I'l take a try and come back if I ever have some questions; For the moment it is not so clear (really I never did it) how to get JSON values in a JS function. One more question to google for. -- View this message in context:

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Thank you for the info. Two more questions: 1. In the page TML the call to the abov JS fucntion was done in on 'IF' loadPath(); ... Can I add the same condition to the abov addJsLibs method: @BeginRender void addJsLibs() { if (error) { String js = String.format("loadPas

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
AH, OK, I see. Thank you for the attention. As for JSON, I have no idea how to use it, especially when I'm on Tapestry 5.1.5 :( -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp5094388p5097160.html Sent from the Tapestry - Use

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Could you indicate where exactly I have to escape single quotes, please, here: String js = String.format("loadPass('%s','%s','%s','%s','%s');", m1, m2, m3, m4, m5); Thks -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp5094

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Unfortunately no one gave a good solution how to achieve the same functionality from Java code. So, finally, there 2 solutions, both are working for me. 1. Declare the needed variables insode a tml page like that: Like that we are passing the needed translations to the js function. 2. Copy-p

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
I think I know why it doesn't work properly. 1. I add a js function from inside the java class using [code] String m1 = messages.get("js_error_password_not_given"); String m2 = messages.get("js_error_no_confirmed_password"); String m3 = messages.get("js_error_password_not_matched");