The documentation says that the transport.read.url can be specified as a function. Could you please tell me the syntax for doing this using UI for JSP?
<
kendo:dropDownList
name
=
"module"
dataTextField
=
"domainValue"
dataValueField
=
"domainId"
optionLabel
=
"Please Select..."
id
=
"module"
>
<
kendo:dataSource
>
<
kendo:dataSource-transport
>
<
kendo:dataSource-transport-read
url
=
getTestModuleUrl
()
contentType
=
"application/json"
/>
</
kendo:dataSource-transport
>
</
kendo:dataSource
>
</
kendo:dropDownList
>
A string is expected for the url but if I do that, then the string is taken literally, and not as a function. Could you please tell me the correct syntax?
Thank you.
Hello,
I have a question about tag's name in kendoUI for jsp, do you follow any naming convention in tag's name? page Code Conventions for the JavaServer Pages was the only thing that I found about naming convention in jsp files, according to what I have studied in that page , mulitple worlds in file names should started with letter-case and another words should commences with an upper-case letter, but multiple worlds in kendo tags seperated by hyphen(-).
I would be appreciated if tell me what is the best practice for naming tags files in jsp.
I'm running a trial with Kendo UI for JSP 2020.1.406
I've been following the instructions here: https://docs.telerik.com/kendo-ui/jsp/introduction?DisableOverride=true&utm_medium=email&utm_source=eloqua&utm_campaign=dt-jsp-trials
This got me set up with a base project, to which I was able to add a JSP page and some CSS to style it. Now I want to add a dropdown list and populate it with some data. The stuff that gets the data is all from an existing project. Basically, I'm making a call to a Service class and then to a query in a Dao class.
This is my main controller:
package com.agristats.transfersystem.controller;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.agristats.transfersystem.bo.Program;
import com.agristats.transfersystem.service.ProgramService;
@Controller
public class MainController {
@RequestMapping("/")
public String main() {
return "main";
}
}
This is working. Then, following the 2nd introductory video on that referenced page, I added this servlet to an api package:
package com.agristats.transfersystem.api;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.agristats.transfersystem.bo.Program;
import com.agristats.transfersystem.service.ProgramService;
import com.google.gson.Gson;
/**
* Servlet implementation class Programs
*/
@WebServlet("/api/programs")
public class Programs extends HttpServlet {
private static final long serialVersionUID = 1L;
private final ProgramService programService;
private List<Program> programs;
/**
* @see HttpServlet#HttpServlet()
*/
public Programs() {
this.programService = new ProgramService();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// response.getWriter().append("Served at: ").append(request.getContextPath());
try {
programs = programService.findAllWantedPrograms();
Gson gson = new Gson();
response.setContentType("application/json");
response.getWriter().write(gson.toJson(programs));
} catch (IOException e) {
response.sendError(500);
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
This fails here: programs = programService.findAllWantedPrograms();
With this error:
java.lang.NullPointerException: null
at com.agristats.transfersystem.service.ProgramService.findAllWantedPrograms(ProgramService.java:32) ~[classes/:0.0.1-SNAPSHOT]
at com.agristats.transfersystem.api.Programs.doGet(Programs.java:41) ~[classes/:0.0.1-SNAPSHOT]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:128) [spring-boot-2.3.0.M4.jar:2.3.0.M4]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66) [spring-boot-2.3.0.M4.jar:2.3.0.M4]
at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:103) [spring-boot-2.3.0.M4.jar:2.3.0.M4]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:121) [spring-boot-2.3.0.M4.jar:2.3.0.M4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.13]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.13]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.13]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.13]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [catalina.jar:9.0.13]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.13]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.13]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) [catalina.jar:9.0.13]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.13]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.13]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.13]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.13]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791) [tomcat-coyote.jar:9.0.13]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-coyote.jar:9.0.13]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.13]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_163]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_163]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.13]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_163]
It appears that when the code gets into the Service class and tries to run the Dao query, the dao object is empty.
Am I missing something on the Spring side of this? Can this not be done within the Servlet? Is the method outlined in the video no longer valid (it is seven years old)? Is there a better way to do this? Any help would be most appreciated.
IDEA cant resolve lib when i use:
<%@ taglib prefix="kendo" uri="http://www.kendoui.com/jsp/tags"%>
jar file located in /WEB-INF/lib/ folder, with previous version i don't have such problem
When I try to enter an object's property with dot syntax as the value of the name attribute that will not work, like so:
<
kendo:datePicker
name
=
"person.birthdate"
value
=
"${person.birthdate}"
format
=
"dd.MM.yyyy"
>
</
kendo:datePicker
>
Note that the same syntax is accepted for the value attribute.
Most conspicuous is the missing button with calendar icon at the right hand side of the input field. Is that behaviour by design?
Best regards,
Marcus
We have serious performance issues in IE (Edge is also quite slow) when editing fields in a grid. Our grids have in general 10+ columns and 50+ rows.
The page consists of 2 tabs, where the first tab contains a grid.
When trying to edit a numeric text field, the operation is very slow. Even the field selection lasts around 3-4 seconds. I am aware that there are issues regarding performance in IE but is there anything that we can change in our implementation to improve the performance but keep the functionality?
Our application is unusable in Internet Explorer with the current setup.
Grids have all operations enabled:
Grids have detail rows which consist of 3 or more tabs. And each tab has either a grid (smaller than the main grid) or numeric text fields (10+).
I prepared a few grid examples to be able to debug the slow performance:
There is a JSP Kendo grid version and JS grid version with attached diagnostic sessions screenshots. Based on the IE diagnostic session on "mousedown" there are repeated offsetwidth calculations triggered which are propagated to every element in the main grid and this is repeated in our example's case 10 times. Is there a way to avoid this triggered calculations?
Our Kendo Library version is 2016.3.914 (but I tested it with the latest 2017.1.223 with the same results)
Thanks in advance for any ideas!
I have an app I created using Kendo UI and now I am upgrading it and want to fully utilize JSP which I am fairly new at. I somewhat get your taglibs but don't "think" everything that can be done via Kendo UI can be done via UI for JSP via the taglibs? So I assume you have to decide those things which can use taglibs and be done on the server side and those things which remain as JavaScript and done on the client? As a simple example if and how would the following JavaScript code snippet I currently do in my app be replaced (if possible) and built with taglibs (I know via <kendo:window> but now sure how all options would be done such as actions)?
$("#ppCustomize").kendoWindow({
appendTo: "#ppCustomizeForm",
title: "Application Settings",
visible: false,
modal: true,
resizable: false,
actions: [
"Tick",
"Close"
],
}).data("kendoWindow").wrapper.find(".k-i-tick").click(function(e) {
//e.preventDefault();
displayLoading('#ppCustomize', null);
if ($('#DateFilter').val() == "") {
$('#DateFilter').val("Clear");
};
displayLoading(document.body, null);
eval(logiActions.eventupdatevariables);
});
ppCustomize = $("#ppCustomize").data("kendoWindow");
$("#selectCustom").kendoButton( {
click: function() {
ppCustomize.center().open();
}
});
I've seen a few threads about this for asp.net and the Kendo UI javascript dropdownlist but the solutions don't really apply to the JSP dropdownlist.
I want to make my dropdownlist mandatory as below.
<
kendo:dropDownList
name
=
"status"
dataTextField
=
"domainValue"
dataValueField
=
"domainId"
optionLabel
=
"Please Select..."
required
=
"required"
>
<
kendo:dataSource
data
=
"${projectStatus}"
></
kendo:dataSource
>
</
kendo:dropDownList
>
However, because Kendo renders the actual input field as hidden, then the error message displays in the top left of the browser. How do I get it to display on the dropdown?
Hello,
I tried to create a custom cell editor for boolean values in a grid by adding the k-checkbox style to a checkbox.
Unfortunately it doesn't seem to work. When clicking on the styled checkbox, the cell just closes the edit mode, but doesn't change the value.
Is there a solution for this problem?
Thank you for your help,
Daniel