Can we call one velocity template to another template to reuse the code?
For example i have one velocity template where common code is there and that common code i want to use in another velocity template.
Please suggest.
That's precisely the purpose of the #parse directive.
Please check the Velocity Users Guide.
Related
Since Goolge Chart API is not available inside China. I want to replace it with Baidu's ECharts.
Should I define another ChartView, and is there any official document on How To?
Right now, I am using Jinja2 template to include echarts.js (lib) and custom js code (action) as well as custom method in view (data source) at the end of the html file. But I hope there is official way to do that.
As a dirty and quick solution, I use another template with custom js code for Baidu's ECharts.
In next plan, I will override FAB design.
In a velocity template I want to display a link which is in a variable. By now I just display the url, this line in my .vm template is :
URL : $topo.urlFileServer
How could I make it clickable?
Velocity version : 1.7
Velocity is just for rendering any text you provide to it as-is, it does not cares about what language you are using the Velocity Template engine to render. It could be HTML or any other language.
This problem is particularly related with HTML. You could use the data you have to make an anchor tag like this:
The Server's Link
That would work.
I have hard-coded the link destination URL in the below link.
I need to re-factor the code so that the URL is set dynamically (reading it from a property file) Any one has an idea how to achieve that in wicket?
Thank you.
You can use org.apache.wicket.markup.html.link.ExternalLink in your Java code. Its model can read/load it from anywhere you need.
This is possible without the need for any Java code.
Given a properties file with a key for the url and the links label:
url = http://www.stackoverflow.com
label = Help me!
One can simple use Wicket message system:
<a wicket:message="href:url"><wicket:message key="label" /></a>
Tested with Wicket 6.19.0
In the Wicket guide: Reading bundles with tag <wicket:message>
Is any way to use Velocity DisplayTool in ODT template (rendered with XdocReport). I linked libraries with maven but when i render report from template I see tag $display.stripTags(Object), it seems that velocity does not recognize this tag.
Is there a need to make special configuration in xml, I use spring but I don't want velocity view resolver bean as it is in many solutions.
Ideas?
The $display variable will only be available within your template if you have added it to the velocity context.
There are 2 ways I know you can do this:
You can add an instance of the display tool to the context as a variable before rendering the template
You can create an xml configuration file and configure a ToolManager (example)
Say for example that i have a grid (dojox.grid.DataGrid). I want to know all the extension points available on that grid.
When checked with the dojo api doc in events section of the grid i cant find the extension points, (say for example extension point onBeforeRow is not listed in that event section).
Thanks in advance.
pretty much every public method is an extension point, in that you can dojo.connect to it. The "on" pattern indicates an event pattern, and there's no formal declaration beyond the naming pattern AFAIK.