Browse by category:
|| | ||
How to implement a gantt chart thin-client sample with custom server action ?
The attached example demonstrates the bare essentials of thin-client (DHTML) support for Gantt charts.
To run the application:
1. Extract the attached .zip file to JViews_Home\tools\tomcat\webapps,
2. Make sure the jviews.jar and gantt.jar files are in the \WEB-INF\lib folder,
3. Launch Tomcat, and
http://localhost:8080/gantt/index.html in Internet Explorer or a similar browser.
The server side
The entire source code is kept in one file,
GanttChartServlet.java (see the folder ...\WEB-INF\classes), so that the entire server-side implementation can be seen in one go.
GanttChartServlet class implements the
IlvGanttServlet class and defines the obligatory
createServletSupport method. This method creates an instance of the
IlvGanttServletSupport class. The
getChart method of this class creates a Gantt chart based on a simple data model, defined in the
The data model creates two activites with a constraint in between.
In order to demonstrate how the chart can react to a signal from the client side, an
IlvLabel object has been added to the Gantt sheet. When a client views the application and clicks on the activity or constraint graphics in the Gantt sheet, the server side changes the label to reflect the class type of the graphic clicked on. The name of the action is
MY_ACTION, and the interaction is coded by adding a server action to the servlet support class with the
The client side
IlvGanttView object. The
IlvInteractor instance 'MyInteractor', enabling interaction with the server side, is then created. Each time the mouse is clicked, a
MY_ACTION signal is sent to the server.
Finally, a simple zoom in the interactor with a tooltip is created inside an
|gantt.zip (136 kb)|
|Also listed in|
|Visualizations -> JViews -> Gantt|
|Using script code in my SVG file||Drawing a graphical object in a map|