KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Computer and Communication Fundamental Basic web programming Lecture 8 Rina Zviel-Girshin.
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
The Web Warrior Guide to Web Design Technologies
Microsoft® Small Basic
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
Macromedia Dreamweaver 4 Advanced Level Course. Add Rollovers Rollovers or mouseovers are possibly the most popular effects used in designing Web pages.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
HTML Forms/Events (Instructor Lesson) The Event model HTML Forms Custom Events 1.
Goal: Ensure you have a working environment for the project 1 Lab 0: Confirm Working Training Instance Instructions 1) Install a copy of virtualbox (
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Chapter 19: Adding JavaScript
IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
Dreamweaver – Dreamweaver Extras Web Design Section 8-4 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
Scripts Chapter Scripts Small programs used to add interactivity to your web pages The backbone of Dynamic HTML (DHTML) Most scripts are written.
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
JavaScript - A Web Script Language Fred Durao
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Interactive Programs Java API. Terminology Event—an action or occurrence, not part of a program, detected by the program. Events can be Event—an action.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Event-Driven Programming Chapter Page Section: Section or division of an HTML page Generic block element Example: What's the difference between.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Looking at various Rich Message options in KRAD Kuali University: Apply Now Lab : Rich Messages Lab Objectives Understand what Rich Messages are and how.
JavaScript Challenges Answers for challenges
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Looking at various Rich Message options in KRAD Kuali University: Apply Now Lab : Rich Messages Lab Objectives Understand what Rich Messages are and how.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
Events Part I Mouse Events. Learning Objectives By the end of this lecture, you should be able to: – Understand what is meant by an ‘event’ – Appreciate.
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Let’s demonstrate some KRAD Action Components Kuali University: Apply Now Lab 3: Actions Lab Objectives Understand how to setup an action that invokes.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
SE-2840 Dr. Mark L. Hornick 1 Dynamic HTML Handling events from DOM objects.
Section 10.1 Define scripting
JavaScript is a programming language designed for Web pages.
Microsoft® Office FrontPage® 2003 Training
Section 17.1 Section 17.2 Add an audio file using HTML
Section 10.1 YOU WILL LEARN TO… Define scripting
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
Web Design and Development
JavaScript Basics What is JavaScript?
Presentation transcript:

KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are they? How to add javascript event handlers to components Add some event handling flair to our web page

2 Lab 6: HTML Events HTML Events- What are they? Dynamic HTML allows for interactive web-pages. HTML can process events from the keyboard and mouse, and also some other special events. Mouse Events onclickOccurs on a mouse click ondblclickOccurs on a mouse double clicked onmousedownOccurs when mouse button is pressed onmouseupOccurs when mouse is released onmouseoverOccurs when a mouse moves onto an element onmouseoutOccurs when a mouse pointer moves away from an element onmousemoveOccurse when a mouse moves while it is over the element

3 Lab 6: HTML Events HTML Events- What are they? Keyboard Events onkeydownOccurs when a key is pressed onkeypressOccurs when the key is pressed and released onkeyupOccurs when the key is released Other Events onfocusOccurs when an elements gains focus onblurOccurs when an element loses focus onchangeOccurs when a control loses foces and has been modified since gaining focus onsubmitOccurs when a form is submitted onloadOccurs when a window or frame finishes loading

4 Lab 6: HTML Events For processing of events we use JavaScript. KRAD components have properties defined to make adding event handlers to your page elements easy. For each event, there is a corresponding property. For example, to display an alert box when an element is clicked, simply set the onClickScript property. Let’s add some event handling to our page to liven it up a bit…

5 Lab 6: Fun with HTML events Instructions 1) Open up the view definition file TrainingApplicationView-Lab6-Events.xml We’ll start with something simple but not so exciting. We’ll display an alert box when the “Gender” radio component is clicked. 2)Locate the InputField bean with the label=“Gender” 3)Add the onClickScript property to the component to display an alert box with a fixed message. (Tip: see the previous screen for an example) 4)Re-load the page and test it out

6 Lab 6: Fun with HTML events Let’s try something a little more exciting. 5) Add a drop down select box component labeled “Affiliation” into the CampusInfo section right after the “Campus” drop down box. Note that this select box uses a different approach to setting it’s options. The list of options is defined near the bottom of the TrainingApplicationView- Lab6-Events.xml file. 6) Add an onChangeScript property to the Uif-DropdownControl bean, with the following java script: 7) Re-load the page and test it out

7 Lab 6: Fun with HTML events Embedding JavaScript in your view definitions like that is a bit sloppy and not considered a “best practice”. It leads to maintenance hassles and isn’t re-usable. Let’s change our event to call a javascript function instead. 8) Go back to the “Affiliation” component in our view definition. 9) Let’s cut out the script and call a.js function instead. 10) Re-load the page and check it out

More Fun: If you have more time, Let’s add some other events

9 Lab 6 Extra Exercises With JQuery and CSS, you can quickly and easily add all sorts of animations to your page. Of course you could add serious business to your application, but for today, let’s try a couple of silly exercises.

Lab 6: Extra Exercises Extra Exercise 1: onMouseOver event 1) Change your page so that when the user moves the mouse over the “About Me” section, all of the text in the section changes to red (or some other color). 2) And change it back to black when the mouse leaves the section. Yep, most events apply to groups and sections as well as individual elements. 10

Lab 6: Extra Exercises Extra Exercise 1: Solution 1) Change your page so that when the user moves the mouse over the “About Me” section, all of the text in the section changes to red (or some other color). 2) And change it back to black when the mouse leaves the section. 11 <bean id="Training-StudentInfo-Lab6" parent="Uif-HorizontalBoxSection" p:onMouseOverScript="jq(this).stop().css({ 'color': 'red'});" p:onMouseOutScript="jq(this).stop().css({ 'color': 'black'});">

Lab 6: Extra Exercises Extra Exercise 2: onMouseOver event Add a trick button to the page. 1. Create a button offering “Click here for a free scholarship” 1a. Create a separate group for the button 1b. Add the button to the group. 2. Add a mouse over event handler to the button which moves the button before they get a change to select it. 12

Lab 6: Extra Exercises Extra Exercise 2: Solution Add a trick button to the page. 1. Create a button offering “Click here for a free scholarship” 1a. Create a separate group for the button 1b. Add the button to the group. 2. Add a mouse over event handler to the button which moves the button before they get a change to select it. 13

Lab 6: Extra Exercises Extra Exercise 3-n: Create your own events Use your imagination to create your own event handlers! 14