Telerik Forums
UI for JSP Forum
2 answers
291 views

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.

MELWIN
Top achievements
Rank 1
Iron
 answered on 16 Mar 2022
7 answers
912 views

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?

Stefan
Telerik team
 answered on 21 Feb 2017
2 answers
413 views

I have a dropdownlist defined as follows:

<kendo:dropDownList name="module" dataTextField="domainValue" dataValueField="domainId">
        <kendo:dataSource data="${testModule}"></kendo:dataSource>
 </kendo:dropDownList>

 

The html generated in the browser is as follows:

<span class="k-widget k-dropdown k-header" style="" title="" unselectable="on" role="listbox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-owns="module_listbox" aria-disabled="false" aria-busy="false" aria-activedescendant="b5f28c08-1663-4dfc-bebe-a03898405acf">
<span class="k-dropdown-wrap k-state-default" unselectable="on">
<span class="k-input" unselectable="on">Library</span>
<span class="k-select" aria-label="select" unselectable="on">
</span>
<input id="module" name="module" data-role="dropdownlist" style="display: none;">
</span>
<script>
jQuery(function(){jQuery("#module").kendoDropDownList({"dataSource":{"data":[{"domainId":17,"domainValue":"Library","domainCode":"TMOD"},{"domainId":18,"domainValue":"Regular","domainCode":"TMOD"},{"domainId":19,"domainValue":"Advanced","domainCode":"TMOD"},{"domainId":20,"domainValue":"Unknown","domainCode":"TMOD"}]},"dataValueField":"domainId","dataTextField":"domainValue"});})
</script>

 

Then in a $(document).ready function I have the following:

var dropdownlist = $('#module').data("kendoDropDownList");
dropdownlist.select(function(dataItem) {
       return dataItem.value === "Regular";
});

 

The second line throws a javascript error because the variable dropdownlist is not defined. 

Note I have 3 other dropdownlists defined on the page, all with different names, obviously, and get the same error.

Please tell me where I'm going wrong.  Thank you.
Jane
Top achievements
Rank 1
 answered on 16 Nov 2016
4 answers
247 views

Hi all,

I just started evaluating Kendo UI for JSP and I am very impressed by the quality of your concept.

I have implemented the Autocomplete, ComboBox and DropDownList tags successfully, but I would like to highlight matches of the input value with the list items.

My first try was to provide an extra field in the response data with embedded HTML markup, but that is being converted into entities: <em> becomes &lt;em&gt;. Is there a way to turn this kind of conversion off?

To be sure, I found the example for client side formatting:

String template = "<span class=\"k-state-default\" style=\"background-image: url(../resources/web/Customers/#:data.customerId#.jpg\"></span>" +
                  "<span class=\"k-state-default\"><h3>#: data.contactName #</h3><p>#: data.companyName #</p></span>";
 
String valueTemplate = "<span class=\"selected-value\" style=\"background-image: url(../resources/web/Customers/#:data.customerId#.jpg\") ></span>" +
        "<span>#:data.contactName#</span>";
%>
 
<div class="demo-section k-content">
    <h4>Customers</h4>
    <kendo:dropDownList name="customers" headerTemplate="<%=headerTemplate%>" template="<%=template%>" valueTemplate="<%=valueTemplate%>"

However, I've not managed to transfer this into JSP syntax.

Could you please help me with this?

 

Best regards

Marcus
Top achievements
Rank 1
 answered on 26 Apr 2016
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?