JSF :: Using Jquery Date Picker With Input Field In Bean

Aug 9, 2014

I have an bean vacationRequestBean with startdate and enddate of date field. I used jquery date picker in my index.xhtml for those fields. format is MM-dd-yyyy for date picker

<script>
$(function() {
$("#datepicker").datepicker();
});
</script>

and in xhtml

<h:inputText id="date" class="datepicker" value="#{vacationRequestBean.startdate }" >
<f:convertDateTime pattern="MM-dd-yyyy" type="date />
</h:inputText>

<h:inputText id="date" class="datepicker" value="#{vacationRequestBean.enddate }" >
<f:convertDateTime pattern="MM-dd-yyyy" type="date />
</h:inputText>

I am getting error as "<f:convertDateTime > Parent not an instance of ValueHolder". How to store the value selected using jquery date picker to bean on submitting the form.

View Replies


ADVERTISEMENT

JSF :: Value Input Text Cannot Bind To Bean

Feb 28, 2011

I have following bean:

public class LoginBean {
private String email;
private String password;
private SessionId sessionId;
private UserController userController;
public LoginBean() {
this.email = "";
this.password = "";

[code]....

And the jsp page is html and css and next part

<h:form id="form">
<p><h:inputText value="#{loginBean.email}" /></p>
<p><h:inputSecret value="#{loginBean.password}" /></p>
<p><h:message for="form"/></p>
<p><h:commandButton value="login" action="#{loginBean.login}" /></p>
</h:form>

I can't get the values out of the inputtext in any way?

View Replies View Related

JSF :: Passing Content Of Input-text To Bean?

Apr 8, 2014

I have an xhtml file with this content:

<h:inputText tabindex="7" styleClass="input" id="title" value="#{register.title}"
required="true">
</h:inputText>

Basically I want the user to enter his title (e.g. Mr., Dr.), which would be passed on to a bean which would send this information to me in email.

I also have a bean called register, along with setters and getters:

private String title;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}

I want to pass this information to a String called body, within the bean:

body = body+"Title: "+this.title+"
";

I would then send the String in an email.

View Replies View Related

JTextfield And Jtable - Get Users Input From Field To Table

Sep 13, 2014

I have project to get from users input like name,surname,to save to Jtable,i have table and jtextfiled but when user get input they don t save to table here is my code:

 Project.zip (33.54K)

public class Projektni extends JFrame {
public final JTextField ime = new JTextField(10);
public final JTextField prezime = new JTextField(10);
public final JTextField index = new JTextField(10);
public DefaultListModel podaci = new DefaultListModel();
public JList lista = new JList(podaci);
String kolone[] = {"ID","Name","Age"};

[Code] ....

View Replies View Related

Java GUI ActionListener - Determine Factors Of Input Placed At Number Text Field

Oct 12, 2014

I just started Java a few days ago and I'm having trouble with ActionListener..

Here are my codes so far , i'm having trouble with the

btnDetermineAction10686696_842067395825457_2521361553839739125_n.jpg:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
 
public class NumberAnalyzer extends JFrame{
private JButton btnDetermine, btnClear;
private JTextField txtNumber, txtFactors, txtPrime;
private JLabel lblNumber, lblFactors, lblPrime;
private JPanel pnlNumber, pnlNumber1,

[Code] ....

The output should be the one in the picture:

Input is placed at the NUMBER text field.

Identify its factors, write it at FACTORS text field.

Determine if it is prime. If prime, output at PRIME text field is “Yes”, “No” otherwise.

View Replies View Related

Age Calculation Based On Input (Date Of Birth)

Nov 9, 2014

I am trying to solve this problem but it is not working properly, when i enter the date of birth, such as 1993 12 14 it comes up as 21 years old instead of 20.

import java.util.*;
class Age
{
public static void main( String [] args)
{
Calendar rightNow = Calendar.getInstance();
 
[Code] ....

View Replies View Related

Enterprise JavaBeans :: Calling Singleton Bean From Session Bean Returns NullPointerException

Feb 23, 2013

I am doing this

@Startup
@Singleton
@ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)
@Lock(LockType.READ)
public class ResourceBean {

[Code] ....

And I call this singleton bean from a stateless session bean like this

@Stateless
public class ClientBean {
@EJB
ResourceBean resource;

public String create(String r)
{
String res=resource.returnString(r);
return res;
}
}

But resource.returnString(r); gives a org.apache.jasper.JasperException: java.lang.NullPointerException I started the glassfish server in debug mode and found out that "resource" was null. but @PostConstruct in singleton does print which means singleton bean exists.

Can we call singleton beans with no interface in such a way form a session bean? I actually want to acquire instance of singleton bean when a client invokes method in Client bean...

View Replies View Related

JSP / JSTL :: Page Set Bean Variables But Give NullPointerException When Bean Try To Merge In DB

Nov 21, 2013

I'm new to JSP but I've to use it to grab data coming from an external site, pass data to a Bean, write data in a DB and redirect the user to another page. Follow the JSP page.

<%@page import="EJB.getResponse"%>
<%
long paymentID = Long.parseLong(request.getParameter("paymentid"));
String responsecode = "9999";
getResponse g = new getResponse();

[Code] ....
 
This is the bean:

@ManagedBean
@RequestScoped
public class getResponse implements Serializable {
private Long paymentId;
private String result;
private String auth;

[Code] ....
 
On the console I see the prints but I receive the NullPointerException

WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at EJB.getResponse.printData(getResponse.java:72)
at org.apache.jsp.notify_jsp._jspService(notify_jsp.java from :60)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)

[Code] ....

View Replies View Related

Splitting Date String By Date And Time And Assigning It To 2 Variables?

Jul 17, 2014

I have an requirement of splitting a Date-Time String i.e. 2013/07/26 07:05:36 As you observe the above string has Date and Time with space in between them.

Now I want just want split the string not by delimiter but by length i.e. after 10th place and then assign it to 2 variable i.e. Date <----2013/07/26 and Time <---07:05:36 separately.

View Replies View Related

Algorithm That Asks User For Birth Date And Current Date

Sep 29, 2014

write the algorithms of the following problems.

1. Write an algorithm that asks the user for your birth date and the current date and displays how many days has passed since then (remember that April, June, September and November has 30 days, February has 29 on leap years, and the rest 31)

2. Write an algorithm that asks the user a number (save it as N) and displays the N term of the Fibonnacci series (take it as 1, 1, 2, 3, 5 ...)

View Replies View Related

How To Check For Todays Date When Writing Own Date Class

Dec 3, 2014

I am trying to write a date class and not use the built-in library. How do I check for today's date?

View Replies View Related

Transform Simple Date Format - Get Calendar Date

Apr 4, 2015

Given a Date such as this sampleDate (120, 08, 02), does SimpleDateFormat transform this given sampleDate using (sampleDate.get(Calendar.DATE)) ?

Issue is that without the SimpleDateFormat the days are outputting correctly but starting with 1,2,3,4 etc and when I apply the SimpleDateFormat to the above Date I only get 01,01,01 etc...

I am looking for 01,02,03 etc...

View Replies View Related

How To Use Date Mask For Date Column In JTable

Jan 23, 2015

inserting a date mask for the column Date in jtable when the user edits the value in the row,the mask should be shown in column Date.

View Replies View Related

JSF :: Page Validation Using Jquery Not Working?

Apr 8, 2014

I want to validate my JSF page using JQuery. I tried a piece of code. But it did not work. The foll is my code.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"

[code]....

View Replies View Related

JSP :: Delete Database Record With JQuery?

Nov 4, 2014

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String delete = ("DELETE FROM anagrafica WHERE Nome = ? And Cognome = ?");
ConnectionManager cm = new ConnectionManager();
String Nome = request.getParameter("nome");
String Cognome = request.getParameter("cognome");

[code]....

and this is my JSP.The problem is easy, when I click on the grid for deleting the record two things happen, or the record is deleted only on JSP but not in my Database or Nothing happens even on my JSP, it is because I don't know how to get values from my jsp and send them to replace the ? in my delete query I tried even to give a name to the <tr> which contains Name and Last name but obviously i guess it works only for input type ex. Textbox.

View Replies View Related

JSP :: JQuery Datepicker - Next And Previous Button

Nov 14, 2014

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JQuery Demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />

[Code] ....

The above code works great and displays date picker with next and previous button but when I use same code on a jsp page the buttons to go back to previous and next month does not show up.

View Replies View Related

JSF :: Sort Data Table Using JQuery 1.7

Mar 3, 2015

I'm using JSF1.2 and IBM websphere portal 7 (Core) not prime or rich faces. I would like to know to sort the JSF data table(<h:datatable /> using Jquery 1.7

View Replies View Related

JSP :: JQuery Library Is Not Working In File

Dec 17, 2014

I am using Spring to develop a web application.I have used JQuery ui in HTML page it is working fine a Dialog box appear with JQuery effect.But When I use the same procedure in jsp it is not working.Here is my code of jsp file

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Page</title>
<style>

[code]....

View Replies View Related

JSP :: Fetch Data From MySQL In JQuery Magnific Popup?

Jun 25, 2014

I am developing my college's project in JSP using jquery to open a magnific popup when user clicks on a link and the in the magnific Popup must be fetched from Mysql and i tried two approaches for this:

1. magnific Popup type is ajax here i passed the variable value in the link of href (after '?') to another JSP page where connection to database is created and queries are written in JSTL to fetch data and show this in magnific Popup .. But i failed in this approach, don't know in another JSP page the data without having database connection is loaded in the magnific Popup easily but not database data..

2. magnific Popup type inline here i need to pass the variable value in the same page between different tags..

View Replies View Related

Servlets :: How To Call JavaScript Function Or JQuery Modal Box

Mar 18, 2015

i don't need ordinary javascript alert box. so i was use the jquery modal alert box for different action like success, error etc.but i have problem to call the alert box within servlet.

out.println("<link href="css/jquery.modal.css" type="text/css" rel="stylesheet" />");
out.println("<script type="text/javascript" src="js/jquery-latest.min.js">");
out.println("<script type="text/javascript" src="js/jquery.modal.min.js">");
out.println("<script type="text/javascript" src="js/jscript.js">");
out.println("<script type="text/javascript" src="js/success.js">");
out.println("<script type="text/javascript">");
response.getOutputStream().println("success();");
out.println("</script>");

how to call the modal function in the js file?

otherwise how to show the modal alert box?

View Replies View Related

JSP :: JQuery To Update Table For Every 15 Secs - DB With More Than 20000 Records

Nov 17, 2014

I have a need to refresh my database for every 15 seconds. I have to work with jsp ajax and jquery. For small amount of db entries it is ok but My application is going to handle huge records more than 20000. In my present scenario, Im forwarding request to another jsp page which communicate db and returns a table as result. Instead of this what are things I need to do?? This is just a sample application only. On success I am gonna implement using Spring, hibernate. So instead of table returning json or arraylist like that will work??

Here is my code:

## index.jsp ##
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>

[Code] .....

View Replies View Related

JSF :: Using JQuery In Template File With Single And Double Quotes

Jan 5, 2015

I'm learning jQuery to integrate into a JSF application but finding some confusion on the correct syntax especially when it comes to combining double and single quotes in the jQuery scripts. So for this particular page I want jQuery to traverse through a list of documents and put icons next to each document to state what type of document each is (ie: PDF, doc, xls). I can get this to work using normal html markup but I get a Syntax Error - Unexpected Token exception in the browser.

I'm confused about whether this means I need to use the right html references for the JSF element I wish to traverse or whether this is a problem with the way I'm using my quotes.

Also I'm not sure how to correctly reference jsf tags inside jQuery scripts. So for an ordinary html page I execute the following jQuery script:

<script type="text/javascript">
$("document").ready(function () {
$("li a[href = ' .pdf']").after("<img src='myImage'/>");
});
</script>

</code>

Then I have a JSF page with the following commandLink:

<p:column>
<p:commandLink class="downLoadLink" value="Download" ajax="false">
<p:fileDownload value="#{projectDocBean.downloadedFile}"
contentDisposition="attachment"/>
</p:commandLink>
</p:column>

For this page I try to execute the following script:

<script type="text/javascript">
$("document").ready(function () {
$("#downLoadLink = ' .pdf']").after("<img src='myImage'/>");
});
</script>

I get the same syntax error no matter what I put into the script of the JSF page. How to correctly integrate jQuery with JSF.

View Replies View Related

Insert ImagePath Into Database And Using AJAX / JQUERY In JSP Servlet

May 21, 2014

If user register himself and will go to his own profile then he will be asked upload profile photo at that time when he uploads his photo dynamically... for this I have to insert imageurl/imagepath into table (mysql) using jquery/ajax and image to respective folder depends on userID?

View Replies View Related

Unable To Retrieve Popup Data To Parent JSP - JQuery Not Working In IE8

Jan 22, 2014

We created one web application which runs on tomcat 7.0.35 using spring mvc 3.0 . Its working perfectly on 32-bit windows machine in IE 8 on Windows 7 OS, when we tried to run this on 64-bit windows 2008 Server, jquery is not working. Also I populate data from Pop-up JSP to parent JSP, and it works 3/10 times only and does not work always.

We used the following jquery plugins in our project

jquery 1.8.3
jquery.ui.custom.1.9.2
jquery.ui.custom.min-1.9.

View Replies View Related

EJB / EE :: Session Bean Must Not Extend Another Session Bean?

Nov 9, 2014

I have tried this example ([URL].../) with CarDao extending the BaseDao, it works like a charm.However, from the CarDao class, my NetBeans underlined the class name “CarDao” with the error message “A session bean must not extend another session bean.” But I can compile, deploy and run the application without any problem.

I have also heard that a session bean cannot extend another session bean, but why it works here?

I am using Java EE 6, NetBeans 8.0.1 and WebLogic 12c for this code testing.

View Replies View Related

Make Date Column Show Only Date And TimeIn And TimeOut Column Only Show Time

Mar 11, 2014

How do i make the 'date' column show only the date and 'timeIn' and 'timeOut' column only show the time. In my database table my 'date' column is a date type and 'timeIn' and 'timeOut' column is time.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved