File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Need kind of ActionListeners,keyListeners in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Need kind of ActionListeners,keyListeners in servlet" Watch "Need kind of ActionListeners,keyListeners in servlet" New topic
Author

Need kind of ActionListeners,keyListeners in servlet

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
In swing we have action listeners, key listeners. So its easy if we have many buttons, and also textfied value is dependent on other actions through keylisteners. So, how can i do something similar in servlet, jsp? Suppose there is 3 textfields. value in 2 textfield is enetered by the user and it automatically generates value for the third textfield (quite simple using keylistener in swing) or something like i enter the id number and it gets me the data(offcourse in html page) from db having that id number. How can i do it in Servlet?


kunal
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1064
    
  10

I don't see the Servlet or JSP involved in this since they run on the server and the data entry is running on the client. I think you need to look at Javascript within HTML.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61309
    
  66

All servlets and JSP do is to create the HTML page to be sent to the client. Once the page is sent to the client, they are done with their job on the server and have nothing else to do with the page.

As pointed out, you'll use JavaScript to handle events at the client.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Thanks Richard Tookey, Bear Bibeault for your reply.

I am looking forward to javascript. Someone said that smartgwt will help,as its a html,javascript generator. Is it so?? Also, Jquery can help

Which of these(javascript/JQuery,smartgwt) i must use, keeping in mind, that the web application must be completed in within 30days (i am done with analysis of requirement,db designing)?
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Using pure javascript requires more effort than JQuery since JQuery is based on Javascript but it is at a higher level and comes with many cool features.
Smartgwt - I have never used it before.


PM Me If You Want to get Urgent Help on Java Programming
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Thanks Nam Ha Minh for your reply. Someone do comment on smartGwt
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1064
    
  10

Kunal Lakhani wrote:Thanks Nam Ha Minh for your reply. Someone do comment on smartGwt


Nothing you have described seems to warrant the inclusion of a major third party Javascipt based library such as "Smart GWT" . Your requirement is standard Javascript. There are plenty of online books and tutorial that cover your requirement.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
I guess smartgwt will be good for ui too. But, i have started going through javascript. Have started reading Head First Javascript
 
GeeCON Prague 2014
 
subject: Need kind of ActionListeners,keyListeners in servlet