Hi all,
Im in a little trouble calling a jaggery function through html button onclick
event.
When I click on the button my browser firebug console says , ReferenceError:
startTask is not defined.
What I did was,
%
Var id = 8605;
Print('button onclick=startTask(id)Start/button');
var
Hi Akila,
Try this one:
print('button onclick=startTask(' +id +' )Start/button')
Or you can put like this outside the scripting segment (%%)
button onclick=startTask(%=id%)Start/button
Thanks,
Milinda
On Fri, Aug 1, 2014 at 12:36 PM, Akila Nimantha [IT/EKO/LOITS]
Hi
@Milinda : This code is fully written inside a jaggery tag.
@Akila : put print statement after the definition of the function as below.
%
Var id = 8605;
var startTask = function (id){
var version = new ws.WSRequest();
var options
Hi Akila,
AFAIK this is not how it is done. As you have written the code
startTask function
is in server side so you can't invoke it as normal javascript function
which reside in client side. So either you have to do a ajax call to the
server and invoke the jaggery method or put this method to
Hi,
Since *id* is a variable (Var id = 8605) the value of the id does not get
replaced in startTask(id) if we use as follow
Print(‘button onclick=startTask(id)Start/button’);
Also I have a doubt whether this code works as expected, because startTask()
should be executed in server side
[IT/EKO/LOITS]; dev@wso2.org
Subject: Re: [Dev] calling a jaggery function using button onclick
Hi Akila,
AFAIK this is not how it is done. As you have written the code startTask
function is in server side so you can't invoke it as normal javascript function
which reside in client side. So either