Hi
Any One can tell how the timeline view pages event (james, smith etc) are automatically refresh after some time. when we these event call .csv file
Thx
hi
i am only refresh automatic the timeline views left hand side part (events james, smith etc)
You can call scheduler.load(url, type) through setInterval, it will load data, add new and update the existing events
hi
We use The following code:::
<%@page import=“java.io.FileNotFoundException”%>
<%@page import=“java.io.IOException”%>
<%@page import=“java.io.*”%>
<%
String path = super.getServletContext().getRealPath("/");
String csvFile = path + File.separator + “section.csv”, line = “”, cvsSplitBy = “,”, csvFile1 = path
+ File.separator + “data.csv”;
%>
<div class="dhx_cal_tab" name="unit_tab" style="right:332px;"></div>
<div class="dhx_cal_tab" name="timeline_tab" style="right: 268px;"></div>
<div class="dhx_cal_tab" name="day_tab" style="right: 204px;"></div>
<div class="dhx_cal_tab" name="week_tab" style="right: 140px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right: 76px;"></div>
</div>
<div class="dhx_cal_header"></div>
<div class="dhx_cal_data"></div>
</div>
The above code is used by me,i want the Sections value is refresh automatic after sometime no need to refresh the whole page only events .
please tell how this work is done
Currently you have embed the code which reads data from CSV file in the scheduler’s page, which is quite fine on its own, but limit your possibilities.
You can move the code which generates data in the separate servlet, and instead of
scheduler.parse(data);
call
scheduler.load(servlet_url);
Now you can place the call to load in the setInterval, so it will be reloaded each few seconds.
hi
this is my servlet class and name of servlet class is Section3 .how to modify these class and how to call in main class.
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
String path= super.getServletContext().getRealPath("/");
String csvFile = path+File.separator+“section.csv”, line = “”, cvsSplitBy = “,”;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(csvFile)); //read the csv file contents using buffered reader
int i = 0;
out.print("[");
while ((line = br.readLine()) != null) { //read the file data
String[] Name = line.split(cvsSplitBy);
if (i > 0) {
out.println("{key: " + Name[0] + “,label:’” + Name[1]+ “’},”);
}
i++;
}
out.print("]");
br.close();
} catch (FileNotFoundException e) {
System.out.println(“File Not Found section”);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}