Results 1 to 8 of 8
  1. #1
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    63
    Rep Power
    0

    Default need help in jsp which displays table as excel sheet which uses jquery library

    need help in jsp which displays table as excel sheet which uses jquery library-output.jpgHi friends,

    Actually i got a situation where i have to pick a table from DB and display the table along with column names, To do that in little effective manner i took help of jquery excel dashboard library. This library displays the table very nicely in excel, Now user can enter the data. Now problem is i am not getting how to read the row values and how to send them action class.

    Sorry if my question is wrong i am new to jquery so dont know much in that, i googled but i didn't find suitable solution for it.
    Last edited by akiravelmont; 12-04-2013 at 02:53 PM. Reason: to add the output image

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,275
    Rep Power
    6

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    But what does your question have to do with JSPs or even Java? You should find a JQuery forum.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    63
    Rep Power
    0

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    Because i am using jquery in jsp and displaying the excel sheet in jsp only now i have to read the entered values from jsp to action class

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,275
    Rep Power
    6

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    Well perhaps there is a relation to Java in there somewhere, but as long as you don't post any code to look at, that will remain a mystery.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    63
    Rep Power
    0

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    K sorry for that here i am attaching the code

    Java Code:
    <%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="beanWrite"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
    <%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic"%>
    <%@ page isELIgnored="false"%>
    <html:html>
        <head>
            <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
            <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
            <title><bean:message bundle="Messages" key="app.title" /></title>
            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
            <link href="css/style.css" type="text/css" rel="stylesheet">
    		<link type="text/css" href="css/3rdparty/jquery-ui-1.8.5.custom.css" rel="stylesheet" />
            <script type="text/javascript" src="scripts/actioncalls.js"></script>
            
    		<script src="http://handsontable.com/lib/jquery.min.js"></script>
    		<script src="http://handsontable.com/dist/jquery.handsontable.full.js"></script>
            <title>Manage Project Parameters </title>
            
    		<link rel="stylesheet" media="screen" href="http://handsontable.com/dist/jquery.handsontable.full.css" /> 
    		<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css" />
            
        </head>
    
        <body topmargin="1" leftmargin="0" id="Project">
            <form>
                <input type="hidden" name="go" value="" />
                <input type="hidden" name="selectedId" value="" />
                <input type="hidden" name="rowCount" id="rowCount" value="1"/>
                <input type="hidden" name="columns" id="columns" value=""/>
                
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                          <%@include file="admin_header.jsp"%> 
                        </td>
                    </tr>
                    <tr>
                        <td class="Ban-shad" height="10"></td>
                    </tr>
                    <tr>                	
                       	<td class="BD-tdcent">
                            <table border="0" width="80%" cellspacing="0" cellpadding="0" align="center">
    					        <%@include file="statusmessage.jsp"%> 
                                      <tr>
                                          <td>&nbsp;</td>
                                      </tr>                                  
                                      <tr>
                                        <td class="BD-tdcent">
    								       <c:if test="${reportForm.sourceTable != null && not empty reportForm.sourceTable}">
    								       
    								       <script>
    								       $(document).ready(function () {
    								    	   var data =[];
    								    	   <c:forEach var="column" items="${reportForm.sourceTable.columns}" varStatus="pstatus"> 
    									    	   //window.alert("\"<c:out value='${column.key}'/>\"");
    									    	   data.push("<c:out value='${column.key}'/>");
    									    	   //window.alert(data);
    								    	   </c:forEach>	 
    								    	   window.alert(data);
    								    	   var newData = [];
    								    	   newData.push(data);
    								    	   
    								    	   $('#example').handsontable({
    								    	     data: newData,
    								    	     minSpareRows: 1,								    	    
    								    	     colHeaders: false,
    								    	     contextMenu: true						    	     							    	     
    								    	     
    								    	   });
    								       });
    								       
    								       
    								       $("button:#Get").click(function () {
    								    	   
    								    		$('#msg').html($('#example').val());
    								    	 
    								    	    });
    								       
    								       </script>
    								       </c:if>
    								       <div id="example" ></div>
    								       check this:<label id="msg"></label>
                                          
                                         </td>
                                      </tr>                                         
                                      <tr>
                                      	<td>&nbsp;</td>
                                      </tr>
    									<tr>
    									<td>
    	                    				<table border="0"  width="100%" cellspacing="0" cellpadding="0">
                                				<tr>
    									            <td class="CNT-act1" style="text-align: center;" colspan="3">
    									            <input type="button" id="Get" value="get" />
    									                 <input type="submit" value="save" /> 							                 
    									                 
    				                                </td>
    				                            </tr>
    				                        </table>
                       				<tr>
    				                    <td>&nbsp;</td>
    				                    <td>&nbsp;</td>
    				                </tr>
    				             </table>
                          </td>
                   </tr>
                </table>
            </form>
        </body>
    </html:html>

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,275
    Rep Power
    6

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    Unfortunately this does not show what the JQuery stuff generates. If you use the Firefox plugin 'Firebug' you can see what HTML is generated to render the table and what names are given to the input fields; that should be your clue how to fetch that data back again from the request when submitted to the server. Of course the JQuery manual probably also explains it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,182
    Rep Power
    20

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    Quote Originally Posted by akiravelmont View Post
    Because i am using jquery in jsp and displaying the excel sheet in jsp only now i have to read the entered values from jsp to action class
    The JSP side is pretty much irrelevant.
    JQuery runs on the client (in the browser), so by that point you are in the Javascript/HTML realm.
    Same goes for the Excel stuff.
    What you need to find out is how (if at all) the JQuery-Excel sheet can be sent to the server. Until you figure that out there is no Java involved at all.
    And a JQuery forum or website would be a better bet than here.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,182
    Rep Power
    20

    Default Re: need help in jsp which displays table as excel sheet which uses jquery library

    All the relevant documentation is here.
    And you need to get in the habit of informing a forum exactly what technology you are using...I initially thought you were using the JQuery excel plugin, not this handsontable one.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 0
    Last Post: 04-26-2013, 03:48 PM
  2. Replies: 5
    Last Post: 08-02-2012, 01:55 PM
  3. excel sheet
    By sam.jj12 in forum NetBeans
    Replies: 1
    Last Post: 02-15-2012, 06:01 PM
  4. Excel Sheet Validation
    By Raghuraman K in forum Advanced Java
    Replies: 3
    Last Post: 09-27-2010, 02:35 PM
  5. Export Html table to excel sheet by JS
    By roby_joshua in forum New To Java
    Replies: 1
    Last Post: 08-27-2008, 07:25 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •