Error in a array populated using jsp in client-side in java-script

hii ,
I have this problem.
I have populated an array with records in jsp.The array is being populated correctly ..i hav check it .
Now I need to get back this array in client side in a java-script function.
I need this bcoz i need to check whether the value entered in a particular field in the form is there in the table before the form is submitted...hence the need of array.
Surprisingly in my java-script function i can get back the length of array,but as soon as i am writing something like arr[0] where arr is the name of array populated in server side using jsp,i am get scripting error.
i.e a code like
funtion partynamecheck()
var n=<%arr[0]%>
alert (n) ;
is giving scripting error.i.e showing error in page at the bottom left -side of browser.
but code like
funtion partynamecheck()
var n=<%arr.length%>
alert (n) ;
} is working fine.
Please help ..all wrk stuck.
Arnab

Hi,
i cann't help you with javascript, but the jsp-expression must have this syntax
var n=<%=arr[0]%>
Hope this help!
Roland

Similar Messages

  • [ProtectDoubleSubmit] Use it on client-side too ?

    Hi,
    I have used <xhtmlb:protectDoubleSubmit> for some time now and I find it very useful.
    As we are integrating more and more AJAX functionalities into our applications, I was wondering whether it would be possible to use it on client-side as well.
    I tried things like :
    showProtectDoubleSubmitWindow(true);
    or
    showProtectWindow();
    but it only shows up the window without blocking any user action.
    Thanks in advance.
    Best regards,
    Guillaume

    you dont want any user action to happen till you receive the response from the ajax call - right
    i am not sure why user action is not blocked in your case, (have to read the rendered protect doublesubmit code more carefully).
    simplest would be to set the cursor to hourglass as soon as ajax call is made and set it back to normal when the response is received.
    Regards
    Raja

  • Error when Connect to Oracle using JSP

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); There is no problem with this code in Java, but when i used it in JSP, the error occured.
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
    I am using JRUN Web Server, i don't know how to Configure JRUN to use JSP with Oracle.

    the problem is that your JDBC driver is not in the classpath of your servlet. Add the jar file to the WEB-INF\lib folder of your web application.
    i don't know how to Configure JRUNSorry, but in order to achieve anything, you'll have to RTFM.

  • Error with nvoking a bean using jsp

    Hi,
    I am getting following excepion:
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSPE:\e-data\tomcat40\bin\..\work\localhost\examples\jsp\SimpleJSPBean_jsp.java:59: Undefined variable or class name: counter
    out.print( counter.getCounter() );
    ^
    1 error
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:523)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
    at java.lang.Thread.run(Thread.java:484)
    My bean code is as follows:
    package test;
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class SimpleJSPBean extends HttpServlet
    implements Serializable
    private long m_counter=0L;
    public long getCounter(){
    return m_counter;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException
    m_counter++;
    & jsp code is :
    <html>
    <body>
    <BEAN name="counter" scope="session"
    type="test.SimpleJSPBean" create="yes" introspect="yes'>
    </Bean>
    You have accessed this page
    <%= counter.getCounter() %> times
    </body>
    </html>
    Zulfi.

    Following error occurred:
    A Servlet Exception Has Occurred
    Exception Report:
    javax.servlet.ServletException: Cannot create bean of class test.SimpleJSPBean
         at org.apache.jsp.SimpleJSPBean_jsp._jspService(SimpleJSPBean_jsp.java:71)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    Root Cause:
    java.lang.ClassNotFoundException: class test.SimpleJSPBean : java.lang.IllegalAccessException: test.SimpleJSPBean
         at java.beans.Beans.instantiate(Beans.java:211)
         at java.beans.Beans.instantiate(Beans.java:51)
         at org.apache.jsp.SimpleJSPBean_jsp._jspService(SimpleJSPBean_jsp.java:69)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    Zulfi.

  • Upgraded to Lion and now getting error 51 when trying to use Cisco VPN Client.

    Mac mini with Snow Leopard not having same issue, VPN client works fine. What happened?

    Try uninstalling then reinstalling the Cisco software. Cisco VPN may not be compatible with Lion. Check with them about compatibility or upgrade.

  • How to use Contribute to edit html or java script

    I have a client who use Contribute to edit web pages but they
    are unable to edit the html or javascript. I have a javascript
    photogallery they want to update but they can't. Is there away
    around this? I tried a flash gallery but they still can't update
    the xml file. Am I missing something here?

    You can give your users the rights to Edit page source in
    external application (both for xml as javascript):
    1. Main menu>Edit>Administer websites, pick site
    2. Users and Roles, pick role, click Edit role settings
    3. go to Editing and check 'Allow users to edit web page
    source in external application'
    When your users opens (using the Choose btn next to
    addressbar) a .js or .xml file in Contribute (tested in CS3) just
    click the 'Edit btn' and Contribute will open the file in the
    editor you selected.
    How to select the editors:
    1. Main menu>Edit>Preferences
    2. go to File Editors.
    If this does not work in your version maybe you can use Main
    menu>File>Actions>Edit page source in external
    application.

  • Error due to accessing database connection using jsp

    Hi,
    I have an error, during accessing a datbase using jsp:useBean from jsp.Urgent i need this one
    my source code is
    DbBean.java
    package SQLBean;
    import java.sql.*;
    import java.io.*;
    public class DbBean implements java.io.Serializable{
    private String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    private Connection dbCon;
    public DbBean(){
    super();
    public boolean connect() throws ClassNotFoundException,SQLException{
    Class.forName(dbDriver);
    dbCon = DriverManager.getConnection("jdbc dbc:mybean","","");
    return true;
    public void close() throws SQLException{
    dbCon.close();
    public ResultSet execSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    ResultSet r = s.executeQuery(sql);
    return (r == null) ? null : r;
    public int updateSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    int r = s.executeUpdate(sql);
    return (r == 0) ? 0 : r;
    database.jsp
    <HTML>
    <HEAD><TITLE>DataBase Search</TITLE></HEAD>
    <BODY>
    <%@ page language="Java" import="java.sql.*" %>
    <jsp:useBean id="db" scope="application" class="SQLBean.DbBean" />
    <jsp:setProperty name="db" property="*" />
    <center>
    <h2> Results from </h2>
    <hr>
    <br><br>
    <table>
    <%
    db.connect();
    ResultSet rs = db.execSQL("select * from employ");
    int i = db.updateSQL("UPDATE employ set fname = 'hello world' where empno='000010'");
    out.println(i);
    %>
    <%
    while(rs.next()) {
    %>
    <%= rs.getString("empno") %>
    <BR>
    <%
    %>
    <BR>
    <%
    db.close();
    %>
    Done
    </table>
    </body>
    </HTML>
    The error like this
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    error: Invalid class file format in C:\Program Files\Apache Tomcat 4.0\webapps\muthu\WEB-INF\classes\SQLBean\DbBean.class. The major.minor version '49.0' is too recent for this tool to understand.
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:65: Class SQLBean.DbBean not found.
    SQLBean.DbBean db = null;
    ^
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:68: Class SQLBean.DbBean not found.
    db= (SQLBean.DbBean)
    ^
    An error occurred at line: 7 in the jsp file: /database.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\muthu\database$jsp.java:73: Class SQLBean.DbBean not found.
    db = (SQLBean.DbBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "SQLBean.DbBean");
    ^
    4 errors, 1 warning
    Anybody help me?
    Thanx in advance

    Your code is ok . The problem is in java version witch you use to compile the DbBean class . I think you are using java 1.5 try to change to 1.4 compile and run again should help .

  • I have Mac OSX 10.5.8 and get java "error" message when trying to use research tool on Morningstar Java referred me to Apple but they had no update.Any ideas? thanks.e

    I have a imac OSX 10.5.8 and get a java "error" message when trying to use a research tool on Morningstar.Java referred me to Apple but they had no updates. Any ideas? thanks.

    Well I solved my problem.
    What still doesn't make sense though is that dragging iTune audio files directly on to the iTunes application icon gave me the error message... which is why I originally discounted it as being a potential link problem. If I had been able to get files to open normally (i.e. without an error message) I would have known it was a simple link problem. Strange.
    Anyway... relinking my folder of audio files did the trick.
    If you don't already know how here are the steps...
    iTunes > Preferences > Advanced > click on the "Change" button and browse to the folder that contains all of your iTunes audio files... that's it.

  • How to store files in mysql database using JSP?

    I'm developing an online recruitment system using JSP in server side. For the users who registers in it, I want them to upload their cv's from the web site so that I can store it in the database..I'm using mysql as the db..
    Can I know how to do it.?..or else is there any better way of doing that?
    Need a quick reply..Tx

    The best way to put data in a database in a JSP is to not do it. Instead, use a Servlet that calls a DataAccessObject. The DAO puts the data in the DB and the servlet gives the data to the DAO. The JSP does nothing but display results.
    Take a google for JSP MVC and DAO. BalusC has a great example of DAO and a JSP that uses one on his blog.

  • I want to make a chatroom using jsp, and have some problem, Help!

    I want to build a chatroom using jsp and client using plain html, so i need every client could have a constant connection with the web server and will receive messages realtime. But i got 2 problems.
    First, how can i turn my buffers off so that messages can get to the client the time it is meant to be. I added
    <@page buffer="none">
    but seems that it takes no effect, any tricks here? thx
    Second, I want every user could have a constant conn. with server but i dont want my server to waste resources on those connection that has already been disconnected.so is it possible to stop executing JSP pages once client has diconnected.Since i found that it will throw no exception writing to the client even if the connection is disconnected in JSPs.
    Thanks!!!!!

    By theway, i'm using TOMCat 5.0 as my JSP container.

  • Error in setting value of ComboBox in java script

    Hi All,
    I my jsp file I am doing the following in java script function:
    document.getElementById('form1:porcessCombo').value = strArray;
    where "strArray" is an array of Strings
    But this doesnt seem to be working....
    How do i assign an array of objects as Combo box value in Java Script?
    Please help!
    Thanks.

    Thanks for your quick reply...Couple of more
    questions:
    1.) I am now getting an error as notImplemented() -
    i think this is because of using .options....Am i
    right?
    2.) Could you please elaborate what "Option" ? I
    have an array of strings String[]....which i compute
    in a scriptlet and i access it using
    var list = <%=stringArray%>
    document.getElementById('form1:listCombo').options =
    list
    OR JUST
    document.getElementById('form1:listCombo').options =
    <%=stringArray%>
    Waiting for your replyFirst of all i would like to make some points clear,
    1) You cannot cast a Java String array object to Javascript Object...
    2) You have to create an array which would hold Option Object in it
    for a better understanding look at this code
    var arry1 = new Array("display1","display2";
    var arra2 = new Array("valu1","value2");
    var selectObj = document.getElementById("listCombo");
    selectObj.options.length = 0;
    for(var i=0;i<arry1.length;i++)
    selectObj.options.add(new Option(arry1,arry2[i]));
    or have a single array with options in it..
    var listArray = new Array(new Option("display","value").......);
    var selectObj = document.getElementById("listCombo");
    selectObj.options.length = 0;
    for(var i=0;i<listArray .length;i++)
    selectObj.options[i] = listArray[i];
    Hope I have made the concept clear....

  • How to get the value retruned by java script function into my jsp page

    Hai all,
    I had a particular java script function which returns a date.
    function getDate() {
         var sDate;
    // This code executes when the user clicks on a day in the calendar.
    if ("TD" == event.srcElement.tagName)
    // Test whether day is valid.
    if ("" != event.srcElement.innerText)
    //alert(event.srcElement.innerText);
    sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText;
    document.all.ret.value = sDate;
    var mahi=window.open("configurexml.jsp?xyz=document.all.ret.value")
    return sDate;}
    Now i want to display this particular date in my jsp page. can anyone tell me the correct approach or a sample code to diaplay this date in my jsp page.
    <%@ page language="java"
    import="javax.xml.parsers.*,java.io.*,org.w3c.dom.*"%><%@ page import="java.util.*" %>
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> <head> <title>Configuring Xml File</title>
    <SCRIPT LANGUAGE="JavaScript" SRC="xyz.js"> </SCRIPT>
    body bgcolor="#d0d0d0" onClick= "return getDate()" >
    <form name="f1">
    <b>20 october 2006 </b>
    Here where i am printing the date i had to get the value from the js function. how to do that. plz help me....

    Are you talking about server-side java code (servlets/jsp) or client side (applet)? Given we are in the JSP forum I'll assume we're talking server side.
    If so, you are making a common but fundamental mistake. JavaScript executes on the client, not on the server. If you want client data on the server it has to get there somehow. The simplest way to do this in JSP land is via HTTP. So... have your JavaScript code call a JSP (or servlet) and pass the value you want as a URL parameter. Of course this will also change the browser location, so if you don't want this to happen use a frame or iframe to capture your HTTP request.
    For example:
    Javascript....
    function someFunction() {
    return 1;
    var value = someFunction();
    location.href="somejsp.jsp?value=" + value;

  • Opening a Java Window from a jsp page on the client side

    Hi all,
    Thanks in advance to all who could help me for this problem.
    I've written some jsp pages. In one of them, I open a new Java Window,
    which is a simple Java Frame. If I test this directly on the Tomcat
    server, everything works well.
    But when I call the jsp page through a web browser of a distant client
    (normal use), and when I want to see the java window, no window pops
    up. It appears that the Java Window pops up on the server, and not on
    the client side, which is what I wanted.
    Could someone tell me how to make the Java frames appear on the client
    side ? (Is it linked to the code or to the configuration of Tomcat ?)
    Thanks in advance,
    Alexis.

    JSP always run on the server. On the client you only see the results.
    But you can use applets on the client side: http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html

  • Show the Read more link in the list view webpart using Client side Rendering

    Hi,
    I have a share point list name as Team.It contains two columns like Role(single line of text) and Name( people and picker).
    I want the display the list view webpart like below format using JS Link/Client side rendering concept.
    If list contains more than 3 items (display like this)
    >TeamMemberName1
    >TeamMemberName2
    >TeamMemberName3
    Readmore... (Read more link should expand all the team members)
    If list contains more than 3 items (display like this)
    >TeamMemberName1
    >TeamMemberName2
    >TeamMemberName3
    Could you please provide the code.It is very urgent for me.
    Thanks for the help!!!

    (function () {
        debugger;
        //Create our Namespace object to avoid polluting the global namespace
        var pfh = pfh || {};
        //Define our Header Render pattern
        pfh.renderHeader = function (ctx) {
            var headerHTML = "<ul>";
            return headerHTML;
        pfh.renderFooter = function (ctx) {
            //Define any footer content here.
            var footerHTML = "</ul>";
            return footerHTML;
        pfh.CustomItem = function (ctx) {
            var itemHTML = "<li>" + ctx.CurrentItem.TeamMemberName[0].title; + "</li>";
            return itemHTML;
        //Define any code/function that needs to be run AFTER the page has been completed and the DOM is complete.
        pfh.PostRenderCallback = function (ctx) {
        //Define the function that will register our Override with SharePoint.
        pfh.RegisterTemplateOverride = function () {
            var overrideCtx = {};
            overrideCtx.Templates = {};
            overrideCtx.Templates.Header = pfh.renderHeader;
            overrideCtx.Templates.Footer = pfh.renderFooter;
            overrideCtx.Templates.Item = pfh.CustomItem;
            overrideCtx.onPostRender = [pfh.PostRenderCallback(ctx)];
            overrideCtx.BaseViewID = 98; //Note: We're using BaseView ID 99 to match our override below
            overrideCtx.ListTemplateType = 100;
            SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
        //Now we load in our override to ensure that this Override is only applied to the intended ListView
        ExecuteOrDelayUntilScriptLoaded(function () {
            var OldRenderListView = RenderListView;
            RenderListView = function (ctx, webPartID) {
                if (ctx.ListTitle == "Test") {
                    ctx.BaseViewID = 98;
                OldRenderListView(ctx, webPartID)
        }, 'ClientTemplates.js');
        //Register for MDS enabled site otherwise the display template doesn't work on refresh
        //Note: The ~sitecollection tokens cannot be used here!
        RegisterModuleInit("/_catalogs/masterpage/Display Templates/csr_ovr_RenderListTemplate_Fixed.js", pfh.RegisterTemplateOverride); // CSR-override for MDS enabled site
        pfh.RegisterTemplateOverride(); //CSR-override for MDS disabled site (because we need to call the entry point function in this case whereas it is not needed for anonymous functions)
    I am using the above script to render the items.
    I am new to the CSR.
    Where do i need to include your script in my script.
    Please help on this.
    Thank you for reply sagar.
    Please note that i am not using content search webpart.

  • Client-side Conversion using  NumberConverter and DateConverter

    Hi,
    In our application we have a custom input text component and we are using the same component to capture date, number, currency and string values .As we are using the same component to capture date/number/string values I can't add number/date converter to it.
    At run time I have to read the user entered values and need to convert them into date/ number /currency values. I am planning to use Client-side Converters to format the values.
    Please let me know how make use of NumberConverter and DateConverter in java script to convert the values at client side.
    Regards,
    Kiran

    Hi Gabrie,
    Thanks for your response.
    ADF is providing NumberConverter / DateConverter to convert date/number/currency values. Instead of writing my own custom converters can I use the framework provided converters to convert the values at client side?

Maybe you are looking for