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
Am 23.12.2011 17:05, schrieb 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.addSc
@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
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:
On Fri, 23 Dec 2011 11:29:43 -0200, Javix wrote:
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();
...
@BeginRender
void addJsLibs() {
if (error) {
String js = String.format("loadPass(\"%s\
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
On Fri, 23 Dec 2011 11:14:32 -0200, Javix wrote:
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 :(
The JSON support hasn't changed for a long time, way before 5.1.0.5.
--
Thiago H. de Paula Figueiredo
Independent
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
2011-12-23 14:00, 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
Here is the generated output from your last mail:
loadPass('Veuillez indiquer un nouv
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
2011-12-23 13:01, Javix:
> Sure it is not the best solution. Unfortunately, Tapestry is not able to do
> it as flexible as it does Ruby on Rails.
Yes, your solution is not the best one but the reason is not Tapestry!
There are hundreds of components using JS in Tapestry libraries and all
manage t
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
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");
On Thu, 22 Dec 2011 10:35:13 -0200, Sergueï Cambour
wrote:
Taking in account that the number of classes to modify, I think I'll
choose the first solution, - using RenderSupport. In this case, I should
remove
all the calls to the same js function from all the pages, right? Because
it's up
Thanks a lot for your replies. It is not so clear for me for the moment.
I'm on Tapestry 5.1.
In all the 'tml' pages there are calls to some js functions which all are
in separate js files, like that, for example:
-
2011-12-22 12:31, Sergueï Cambour:
> Is it possible to translate some javascript popup mesages by injection the
> translated values from a 'tml' page into javascript function which is in a
> separate js file?
There are two options to localize your JavaScript:
1. add messages in the initializer cal
Thansk for the reply. I've already seen that code. The problem is that in
that example a class Confirm was created in a javascript file:
var Confirm = Class.create();
But as far as I know it is valid only for prototype and for jQuery as it's
in my case. The js file uses jQuery. Any other idea?
Th
Hello
I Have something like this:
Delete
So, i guess that, the same way I'm able to get the username, it's maybe
possible to get a i18n message, and pass it to the javascript.
(The mixin code is here:
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained)
On Thu, Dec 22, 201
18 matches
Mail list logo