MikSan wrote:
Hi guys!
Here is a quick question that I hope gets a quick answer.=)
I have a Java Script var and a velocity var and what I want to do on the
macro.vm file is:
VelocityVar = JavaScriptVar
Anyone know if this is possible being one on server side and the other on
client side? And if possible how?
Thanks!
Thanks Sergiu but I have no idea how to do what you said :D
#macro(queryByName $queryName $visualType $command)
#set($name = $queryName + $visualType)
$name
#set($onClickFun = "popup('" + $name+ "');")
$onClickFun
#if($xwiki.wikiheavan.checkNull($name) == 1)
$context.getRequest().getHttpServletRequest().getSession().setAttribute($name,1)
#end
#set($thisPage =
$context.getRequest().getHttpServletRequest().getSession().getAttribute($name))
$xwiki.wikiheavan.queryByName($queryName,$thisPage,$visualType,$command)
<button type="submit" onClick=$onClickFun name=$name >
$name
</button>
<script language="javascript" type="text/javascript">
function popup(a){
var b = new String(a);
myJsVariable = "${name}";
alert(a);
alert(myJsVariable);
$xwiki.wikiheavan.addpage(a)
window.location.reload()
}
</script>
#end
Can you give me an example or add some clues on my code so I can figure it
out. Thanks
--
View this message in context:
http://n2.nabble.com/Javascript-var-to-Velocity-Var-tp676366p676595.html
Sent from the XWiki- Dev mailing list archive at
Nabble.com.