jquery - How to access values inside javascript from .vm file -


i have list of values available in velocity template

#set ($allitems = $action.getproduct()) #foreach ($item in $allitems)     <div class="wrap" id="productname">$item.getproductname()</div> #end 

now want them available in java script code inside dialog box.

actor.addpanel("panel 1", "<label for='product'>document.getelementbyid('#productname')</label>" + "<br>" +  "<input id='dialoginput' type='text' value=''>input 1</input>" + "<br>" + "<input id='dialoginput1' type='text' value=''>input 2</input>", "panel-body"); 

but not printing value of productname. how can value?

you using string "productname" id's. use $item.getproductname() in stead:

#set ($allitems = $action.getproduct()) #foreach ($item in $allitems)     <div class="wrap" id="$item.getproductname()">$item.getproductname()</div> #end 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -