Search Results

Search found 64 results on 3 pages for 'kawtousse'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • dojo TimeTextBox don't listen to on blur event

    - by kawtousse
    Hi everyone, I want to add an on blur event to a dojo timetextbox but the event never been runned so the declaration of the timetextbox is like this: <label>End</label><input id="endp" name="endp" onBlur="calculateTimeSpent2(startp,endp,output);" /> the javascript function is like this: function calculateTimeSpent2(startp,endp,outputp) { var tmp0=document.getElementById('startp').value.split(':'); var tmp1=document.getElementById('endp').value.split(':'); if (tmp0[0]!='' && tmp1[0]!='') { var val1= findtime(tmp0[0],tmp0[1],tmp1[0],tmp1[1]); var tmp=val1.split(':'); if (tmp[0].indexOf('-')==-1) document.getElementById('outputp').value=val1; else { alert ("Start Time must be lower than End Time "); document.getElementById('endp').focus(); } } } I don't understand why dojo didn't execute the event correctly while loosing the focus. I tried to put the type=text but it does'nt work. Thanks for help.

    Read the article

  • Table changes depending on dropdown list values with servlet

    - by kawtousse
    What I want to realize is the following: In a JSP x I have a 3 dropdownlists and a button called edit when user click this button a table dynamically should be displayed. Now this table is modified correponding the values in those 3 dropdownlists. So it can be 3 cols or 4 cols or even 6 cols, it depends on the selected values. So what I tried is to use the servlet to getParameter doing the if clause construct the html and then forward the response. Have you any the suggestion of the structure that I can use in JSP? Thank you.

    Read the article

  • ajax post sending parameter failed

    - by kawtousse
    hi, in order to send to servlet parameter in post methos i am using ajax like the following: var xhr = getXhr(); xhr.onreadystatechange = function(){ if(xhr.readyState == 4 && xhr.status == 200) {alert("ok"); } }; xhr.open("POST","ServletEdition",true); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); id = document.getElementById('idIdden').value; xhr.send("id="+id) In the servet the following: String hd=request.getParameter("id"); System.out.println("idDailyTimeSheet est::" +hd); But it failes every time and the problem that i didn't see the cause. thanks

    Read the article

  • controling a float value with javascript

    - by kawtousse
    Hi, to control my input type and verify that its value is pretty a float in my form i deal with it in javascript like that: function verifierNombre () { var champ=document.getElementById("nperformed"); var str = champ.value; if(str.value==' '){champ.focus();} if (isNaN(str)) { alert("Invalid Valid! the field must be a number"); champ.focus(); return false; } return true; } but it still false because it doesn't accept really floats. so when entering a value like '11,2' the alert is declenched. I want to know how can I control float values with javascript. thanks.

    Read the article

  • Parsing a string to date gives 01/01/0001 00:00:00

    - by kawtousse
    String dateimput=request.getParameter("datepicker"); System.out.printl("datepicker:" +dateimput); DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); Date dt = null; try { dt = df.parse(dateimput); System.out.println("date imput is:" +dt); } catch (ParseException e) { e.printStackTrace(); } *datepicker:04/29/2010 (value I currently selected from datepicker). *the field in database is typed date. 1-date imput is:Thu Apr 29 00:00:00 CEST 2010 and in database level it is inserted like that 01/01/0001 00:00:00

    Read the article

  • pass value to servlet from a hidden input type

    - by kawtousse
    I am trying to pass the parameter called value in the hidden input type to my servlet. It is like that: retour.append("<input type=\"hidden\" id=\"id_" + nomTab + "_" + compteur + "\" value=\"" + object.getIdDailyTimeSheet() + "\"/>"); retour.append("<button id=edit name=edit type=submit onClick= editarow()>"); retour.append("<img src=edit.gif />"); retour.append("</button>"); retour.append("</td>"); But the method get parameter recommend a name to be able to get the value here. So how can I deal with it? Here I want to pass to the servlet the value of object.getIdDailyTimeSheet().

    Read the article

  • populating html table from database

    - by kawtousse
    Hi everyone, I want to generate html table in my jsp witch display values selected before submitting to allow user to know what did he puts into the form. So I finish the form when submitting the values are inserted in database. Now I search the possibility to display in the same jsp of the form the table having all the values selected. So it is possible ton allow to actions in the form tag to insert and display from database at the same time. Many Thanks for your help.

    Read the article

  • receive a responseText in ajax but without div tag

    - by kawtousse
    Hi everyone I want to know if there is any other way whithout using a div tag to receive response html when sending parameter whith ajax. I'am asking because when iam building the select in other servlet and returning the result to jsp it receive the responsehtml in a div tag when we use the famous: x = xhr.responseText; document.getElementById('param').innerHTML = x; with param is the id of div tag. Note: this works fine when populating ddl but its constraint are multiple for my case. Thinks.

    Read the article

  • servlet and jsp sending query result following MVC framework

    - by kawtousse
    Hi every one, in order to separate java code and html code and be more faithful to MVC framework i am coding like that; in the servlet i put the following: net.sf.hibernate.Session s = null; net.sf.hibernate.Transaction tx; try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery("select opcemployees.Nom,opcemployees.Prenom,dailytimesheet.TrackingDate,dailytimesheet.Activity," + "dailytimesheet.ProjectCode,dailytimesheet.WAName,dailytimesheet.TaskCode," + "dailytimesheet.TimeSpent,dailytimesheet.PercentTaskComplete from Opcemployees opcemployees,Dailytimesheet dailytimesheet " + "where opcemployees.Matricule=dailytimesheet.Matricule and dailytimesheet.Etat=3 " + "group by opcemployees.Nom,opcemployees.Prenom" ); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Object[] row = (Object[]) it.next(); request.setAttribute("items", row); }} } catch (HibernateException e){ e.printStackTrace(); } request.getRequestDispatcher("EspaceValidation.jsp").forward(request, response); and in jsp i start like that: <table> <c:forEach items="${items}" var="item"> <tr> <td>? </td> <td>?</td> </tr> </c:forEach> in this case what should i put exactly to obtain my result.a table fulled with the right value from the request

    Read the article

  • table changes depending on ddl values with servlet

    - by kawtousse
    I will be more clear. What I want to realize is the following: In a JSP x I have a 3 dropdownlists and a button called edit when user click this button a table dynamically should be displayed. Now this table is modified correponding the values in those 3 ddl. So it can be 3 cols or 4 cols or even 6 cols it depends on the selected values. So what I tried is to use the servlet to getParameter doing the if clause construct the html and then forward the response.Have you any the suggestion of the structure that I can use. Think you.

    Read the article

  • getting parameter value from a table using javascript

    - by kawtousse
    hi every one; I want to get the parameter in my table(HTLML) table every time the user click edit button. The table contains in each row an edit button like following: retour.append("<td>"); retour.append("<button id=edit name=edit type=button onClick= editarow()>"); retour.append("<img src=edit.gif />"); retour.append("</button>"); retour.append("</td>"); to get the value of each row where edit is clicked using javascript I do the following: function editarow(){ var table = document.getElementById("sheet"); var buttons = table.getElementsByTagName("button"); for(var i=0; i<buttons.length; i++) { if(buttons[i].name=="edit") { buttons[i].onclick = function() { var buttonCell = this.parentNode;//cell var editThisRow = buttonCell.parentNode;//td var er=editThisRow.parentNode.attributes[1].value; alert(er); } } } } but i didn't get the values expected. thanks for help

    Read the article

  • reload a form with the same parameter of the previous

    - by kawtousse
    Hi every one, I have really a problem that I don't know how to deal with it. I am using JSP and Servlet with the Eclipse IDE. First of all, the user fill an html table with the values that he has selected and written in the form. after that he will find his parameters displayed in the html table. the problem now is : the table contains in each row an edit button when clicking on it; the user should have the form automatically filled with values"previously selected" of the row. so it's how to reload the form with variables from html table. Note : I construct the table with a servlet. Please help.

    Read the article

  • calling a java class in a servlet

    - by kawtousse
    hi, in my servlet i called an instance of a class.java( a class that construct an html table) in order to create this table in my jsp. the servlet is like the following: String report=request.getParameter("selrep"); String datev=request.getParameter("datepicker"); String op=request.getParameter("operator"); String batch =request.getParameter("selbatch"); System.out.println("report kind was:"+report); System.out.println("date was:"+datev); System.out.println("operator:"+op); System.out.println("batch:"+batch); if(report.equalsIgnoreCase("Report Denied")) { DeniedReportDisplay rd = new DeniedReportDisplay(); rd.ConstruireReport(); } else if(report.equalsIgnoreCase("Report Locked")) { LockedReportDisplay rl = new LockedReportDisplay(); rl.ConstruireReport(); } request.getRequestDispatcher("EspaceValidation.jsp").forward(request, response); in my jsp i can not display this table even empty or full. note: exemple a class that construct denied Report has this structure: /*constructeur*/ public DeniedReportDisplay() {} /*Methodes*/ @SuppressWarnings("unchecked") public StringBuffer ConstruireReport() { StringBuffer retour=new StringBuffer(); int i = 0; retour.append("<table border = 1 width=900 id=sheet align=left>"); retour.append("<tr bgcolor=#0099FF>" ); retour.append("<label> Denied Report</label>"); retour.append("</tr>"); retour.append("<tr>"); String[] nomCols ={"Nom","Prenom","trackingDate","activity","projectcode","WAName","taskCode","timeSpent","PercentTaskComplete","Comment"}; //String HQL_QUERY = null; for(i=0;i< nomCols.length;i++) { retour.append(("<td bgcolor=#0066CC>")+ nomCols[i] + "</td>"); } retour.append("</tr>"); retour.append("<tr>"); try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery("select opcemployees.Nom,opcemployees.Prenom,dailytimesheet.TrackingDate,dailytimesheet.Activity," + "dailytimesheet.ProjectCode,dailytimesheet.WAName,dailytimesheet.TaskCode," + "dailytimesheet.TimeSpent,dailytimesheet.PercentTaskComplete from Opcemployees opcemployees,Dailytimesheet dailytimesheet " + "where opcemployees.Matricule=dailytimesheet.Matricule and dailytimesheet.Etat=3 " + "group by opcemployees.Nom,opcemployees.Prenom" ); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Object[] row = (Object[]) it.next(); retour.append("<td>" +row [0]+ "</td>");//Nom retour.append("<td>" + row [1] + "</td>");//Prenom retour.append("<td>" + row [2] + "</td>");//trackingdate retour.append("<td>" + row [3]+ "</td>");//activity retour.append("<td>" + row [4] +"</td>");//projectcode retour.append("<td>" + row [5]+ "</td>");//waname retour.append("<td>" + row [6] + "</td>");//taskcode retour.append("<td>" + row [7] + "</td>");//timespent retour.append("<td>" + row [8] + "</td>");//perecnttaskcomplete retour.append("<td><input type=text /></td>");//case de commentaire } retour.append("</tr>"); } //terminer la table. retour.append ("</table>"); tx.commit(); } catch (HibernateException e) { retour.append ("</table><H1>ERREUR:</H1>" +e.getMessage()); e.printStackTrace(); } return retour; } thanks for help.

    Read the article

  • Delete one row in html table marqued by a check box with javascript

    - by kawtousse
    Hi everyone, I build dynamically my HTML table from database like that: for(i=0;i< nomCols.length;i++) { retour.append(("<td bgcolor=#0066CC>")+ nomCols[i] + "</td>"); } retour.append("</tr>"); retour.append("<tr>"); try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery(HQL_QUERY); // inner join projecttasks.ProjectTypeCode as projects");// inner join projecttasks.taskCode as task inner join projects.projectCode as wa;"); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Dailytimesheet object=(Dailytimesheet)it.next(); retour.append("<td><input type=checkbox name=cb id=cb /> </td>"); retour.append("<td>" +object.getTrackingDate() + "</td>"); retour.append("<td>" +object.getActivity() + "</td>"); retour.append("<td>" +object.getProjectCode() + "</td>"); retour.append("<td>" +object.getWAName() + "</td>"); retour.append("<td>" +object.getTaskCode() +"</td>"); retour.append("<td>" +object.getTimeSpent() + "</td>"); retour.append("<td>" +object.getPercentTaskComplete() + "</td>"); } retour.append("</tr>"); } //terminer la table. retour.append (""); tx.commit(); } catch (HibernateException e) { retour.append ("</table><H1>ERREUR:</H1>" +e.getMessage()); e.printStackTrace(); } return retour; } so I want that all check boxes having the same id. When trying to delete one row in my table witch have the check box checked i found a problem with that. Iam using simple javascript like this: function DeleteARow() { //var Rows = document.getElementById('sheet').getElementsByTagName('tr'); //var RowsCount = Rows.length; //alert('Your table has ' + RowsCount + ' rows.'); if (document.getElementById('cb').checked==true) { document.getElementById('cb').parentNode('td').parentNode('tr').remove(); }} It doesn't work approperly and only the first row have the id 'cb'. Many thanks for your help.

    Read the article

  • SEND VALUE TO SERVLET WITH THE JAVASCRIPT

    - by kawtousse
    hi everyone, In my JavaScript function I do like this in order to redirect parameters to servlet: var ids1=document.getElementById("projet").value; document.location.href("http://localhost:8080/Opc_Web_App/ServletAffectation?ids1="+ids1); and in the servlet I do the following to get Value: String idprojet= request.getParameter("ids1"); System.out.println("le projet selectionné est :" +idprojet); the problem that i didn't have the result of System.out.print in my screen; so in other terms the servlet didn't get the parameter. I can not see the problem until now. Please help. Thank you.

    Read the article

  • delete a row in html table using a hidden type and javascript

    - by kawtousse
    Hi, I have a table with HTML constructed using my servlet class. When trying to delete a row in this table using a javascript function I must first of all put different id to separate elements.and i resolove it with hidden type like that: retour.append("<td>"); retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" value=\""+object.getIdDailyTimeSheet()+"\"/>"); retour.append("<button id=\"del\" name=\"del\" type=\"button\" onClick=DeleteARow('+id_"+nomTab+"_"+compteur+"')>"); retour.append("<img src=icon_delete.gif />"); retour.append("</button>"); retour.append("</td>"); As you can see each element has a delete button. What i want to know how can i delete one row. thinks.

    Read the article

  • the way to get a value from a hidden type correctly

    - by kawtousse
    hey, in a html table i construct in each row an edit buttton like the following: retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" value=\""+object.getIdDailyTimeSheet()+"\" name=\"hd_"+compteur+"\" />"); this is the hidden type then i do the following: retour.append("<button id=edit name=edit type=button onClick= editarow()>"); retour.append("<img src=edit.gif />"); retour.append("</button>"); retour.append("</td>"); here i am using the hidden type to differenciate between my rows with it. Now I am trying to get the parameter called here: value=\""+object.getIdDailyTimeSheet() in my servlet to do an update query based on the IdDailyTimeSheet. I didn't untill know find the way to get this value every time i click the edit button (i do its submit with the javascript). thanks for help.

    Read the article

  • get the right id of a record in database in each click on the edit button

    - by kawtousse
    hi every one, i am facing a big problem right now. I have a html table in each row i have a button called edit allowing user to relod the form with parameter that he has selected. for this i define a hidden type to get the id of the record in database to access to various colonne and to refresh the form with those parameters. My challenge now is how to get the right id in every click on the edit button to let me after to get the right record and to update it in the data base. I am preceeding like the following: retour.append("<td style=border-right:#FFF bordercolor=#FFFFFF>"); retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" value=\""+object.getIdDailyTimeSheet()+"\" name=\"hd"+compteur+"\" />"); retour.append("<button id=edit name=edit type=button onClick= editarow()>"); retour.append("<img src=edit.gif />"); retour.append("</button>"); retour.append("</td>"); i realise the submit in javascript and i want to get the idDailyTimesheet everyonce the user click the submit button. thanks for help.

    Read the article

< Previous Page | 1 2 3  | Next Page >