® IBM Software Group © 2006 IBM Corporation JavaScript – and EGL and.JSP Pages This learning module describes the use of JavaScript in your EGL and.JSP.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

® IBM Software Group © 2006 IBM Corporation JSF dataTables – Basic Properties and Development Techniques Part I – of a 3-part section on the use of the.
DLC-MODS Workbook 1.2 Pinky says, “Hello.” Presented by University of Tennessee Libraries Digital Library Center Melanie Feltner-Reichert, Metadata Librarian.
The Web Warrior Guide to Web Design Technologies
® IBM Software Group © 2006 IBM Corporation Additional AJAX Examples and Workshops This learning module provides additional AJAX use cases and examples.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
® IBM Software Group © 2006 IBM Corporation EGL / SOA – Creating and Consuming EGL Web Services This Learning Module shows how to utilize the RBD tooling.
® IBM Software Group © 2006 IBM Corporation JSF dataTables – Advanced use of Properties and Development Techniques Part III – of a 3-part section on the.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
® IBM Software Group © 2006 IBM Corporation JSF Menu Component How to create and use JSF Menu components to add custom static and programmatic (dynamic)
Introduction to scripting
® IBM Software Group © 2006 IBM Corporation How to read/write XML using EGL This Learning Module shows how to utilize an EGL Library to read/write an XML.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
® IBM Software Group © 2006 IBM Corporation Display contents of a Data Table in Excel right from the browser – No POI needed This section describes how.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
A guide for UICET for using Wikispaces.  A wiki is a web page or collection of web pages that can be linked together as a website.  Wikis are often.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
® IBM Software Group © 2006 IBM Corporation JSF Tree Control This Learning Module describes the use of the JSF Tree Control – for hierarchical organization.
® IBM Software Group © 2006 IBM Corporation EGL Programming – Data Parts and Assignment Statements – 4 – Arrays These slides walk you through the terms.
Web Technologies Website Development Trade & Industrial Education
® IBM Software Group © 2006 IBM Corporation Web JSF Overview – Dynamic Content Web Pages – for EGL/JSF Developers This unit introduces you to the technical.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
® IBM Software Group © 2006 IBM Corporation Programmatically Rendering and Hiding JSF Controls This section describes how to hide and show JSF controls.
PHP meets MySQL.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
® IBM Software Group © 2006 IBM Corporation JSF/EGL Component Properties Deep Dive This section walks you through the options and settings for JSF Component.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Tutorial 10 Programming with JavaScript
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
® IBM Software Group © 2006 IBM Corporation Web JSF Overview – Internet “101” for EGL/JSF Developers This unit introduces you to the technical concepts.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
® IBM Software Group © 2006 IBM Corporation “Essential” HTML Tags and Page Development Techniques This Learning Module describes the standard HTML tags.
® IBM Software Group © 2006 IBM Corporation JSF Progress Bar This Learning Module shows how to integrate EGL/JSF functionality into a run-time progress.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 2 of 4 – Creating the Business Logic Layer These slides walk you through the process.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
® IBM Software Group © 2006 IBM Corporation Individual Cell Coloring – in a JSF dataTable Control You may need to programmatically (using EGL) change the.
Introduction to JavaScript CS101 Introduction to Computing.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
® IBM Software Group © 2006 IBM Corporation Using JSF Mini-Calendar Controls This section describes how to use a JSF Mini-Calendar Control with EGL It.
® IBM Software Group © 2006 IBM Corporation JSF File Upload Control This Learning Module describes the use of the JSF File Upload component – for allowing.
® IBM Software Group © 2006 IBM Corporation Web JSF Overview – RBD Tooling – for Web Development This unit introduces you to the aspects of the RBD tooling.
® IBM Software Group © 2006 IBM Corporation “Essential” JSF Components and EGL Bindings This Learning Module describes the foundation terms and concepts.
HTML Concepts and Techniques Fifth Edition Chapter 4 Creating Tables in a Web Site.
® IBM Software Group © 2006 IBM Corporation Finding Out Which Submit Button Was Clicked – and Other JSF Command Button Techniques This section describes.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 1 of 4 – Creating the Data Access Layer These slides walk you through the process.
® IBM Software Group © 2006 IBM Corporation JSF Panel – Section Controls This Learning Module shows how to develop server-side EGL applications with dynamic.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
® IBM Software Group © 2006 IBM Corporation JSF Rich Text Area Component This Learning Module describes the use of the JSF Rich Text Area component – for.
HTML Concepts and Techniques Fifth Edition Chapter 3 Creating Web Pages with Links, Images, and Formatted Text.
® IBM Software Group © 2006 IBM Corporation AJAX-Enabling Your JSF Components and Web Pages This learning module covers the use of AJAX technology to enable.
Creating and Editing a Web Page
® IBM Software Group © 2006 IBM Corporation Dependent Combo-Box U.I. Development This Learning Module walks you through the options and development techniques.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
® IBM Software Group © 2006 IBM Corporation EGL.CSV (Excel) File Reading and Writing This section describes how to access.CSV (Excel Spreadsheet) files.
Integrating JavaScript and HTML
Presentation transcript:

® IBM Software Group © 2006 IBM Corporation JavaScript – and EGL and.JSP Pages This learning module describes the use of JavaScript in your EGL and.JSP pages – to provide enhanced, dynamic U.I. behavior.

2 Last update: 12/04/2007  You will most likely – in the course of your application development, need to learn how to use JavaScript, to do certain standard web-U.I. functions. These would be things like:  In the user’s browser (that is, on the client’s machine, NOT on the server):  Validate data entry values  Move (copy) field values entered (ex. Shipping address = home address for an online retail store)  Do not allow users to click Submit twice,  Etc. use  Notice that we’re saying, “use JavaScript”- not write JavaScript (why’s that?)  JavaScript is a fairly deep and lengthy study (certainly to learn how to write to the level of production standards) – and while it’s not something would kill you to know ( ), for the vast majority of your needs, you can usually find what you want on the Internet (often for free), and you can a few techniques in the tooling as well.  So in this section, you will learn how to use JavaScript inside of your.JSP pages – and to connect JavaScript with the data values rendered from your EGL server-side business logic JavaScript and JSF and EGL

3 Last update: 12/04/2007  Using JavaScript is a fairly straightforward process. Steps include: 1.Getting (or writing  ) the JavaScript function 2.Understanding where JavaScript functions reside 3.Creating JavaScript functions and embedding them in your pages 4.Calling JavaScript functions from a user/browser action (event), such as:  Onclick  Onblur  Onchange  Etc. 5.Learning how to reference:  JSF components  JSF component values 6.Debugging your JavaScript functionality Using JavaScript (in your.JSP Pages) – The Background

4 Last update: 12/04/2007 Getting JavaScript Functionality (from the Internet) There are dozens (maybe even hundreds) of high-quality sources for JavaScripts on the Internet. We’ve included a few links – but you might be just as well served using GOOGLE to search for specific JavaScript functionality: Learn JavaScript Here are a few good starter-sites:         

5 Last update: 12/04/2007 Understanding Where JavaScript Elements Reside in Your.JSP Page From the tooling, you can enter JavaScript functions through the Script element, under HTML Tags in the Palette To call these functions – or to create new functions for specific user/browser events, you will: 1. Set focus to the JSF component you wish to code for, 2. Go to the Quick Edit view, select an event and code your JavaScript…which will end up in your.JSP source

6 Last update: 12/04/2007  Creating and Calling JavaScript Functions – 1 of 6  Create a new page, named: jscriptPage.jsp  Edit the page heading boiler-plate text  From Project Explorer:  Right-click over the new page  Select: –Page Template –Merge Template into Page  Click OK at the prompt The reason you are merging the template into the page is so you can over-ride a reserved function in the page’s HTML tag (onload event)

7 Last update: 12/04/2007  Creating and Calling JavaScript Functions – 2 of 6  Edit the Page’s EGL JSFHandler, and add the variables and functions shown here:  Comments optional  Source code in the *** Notes section of the slide  Save (Ctrl/S) your code

8 Last update: 12/04/2007  Creating and Calling JavaScript Functions – 3 of 6  From Page Designer, Add an HTML Table to the page (2 rows/2 columns).  Drag the siteUser1Rec into the top left row/column (all input fields – except for:  SiteUserID – output field  SuType – Radio button, with Properties/Choices hard-coded as: Manager | 1, Admin | 2, User | 3  ReceiveUpdates – checkBox – note that you may need to declare the ReceiveUpdates DataItem with the isBoolean=yes property  Drag the repeatPwd string field into the inner HTML table, below PassWord  Drag the siteUser2Rec into the top right row/column – and create the controls as shown  Drag the Customers array into the bottom row of the HTML table, and create the controls in the dataTable as shown below:  Run the page (Ensure it works) Customers Note: customerID as an output field siteUser1RecsiteUser2Rec

9 Last update: 12/04/2007  JavaScript Functions – How do they work? There are quite a few things that people use JavaScript for. And as mentioned at the beginning of this section, you can learn about this on the web. For our purposes (and for the purpose of entry-level business U.I. JavaScript development, you need to understand the:  User/Browser events…that fire off calls to…  JavaScript functions  Essentially - you will:  Code a JavaScript function …which is…  Called from some user/browser event  What are these user/browser events?  Windows keyboard or mouse actions  Available from the Quick Edit view  Defined to JavaScript (as reserved words)  More or less self-explanatory by their names  Can research on the web: GOOGLE: JavaScript onblur event  So:  You will code a JavaScript function  And make it part of your  And call that function from

10 Last update: 12/04/2007  Creating and Calling JavaScript Functions – 4 of 6 Let’s create a simple JavaScript function that makes changes a field to upper case  Step 1  Step 1 – Create the JavaScript Function  Copy the JavaScript code in the ***Notes section of this slide  From the Palette/HTML Tags – drag a Script tag onto the bottom of the page  (With the Script in focus) From the Quick Edit view  Click into the edit area  Completely replace the contents of the Quick Edit, with the copied JavaScript  Step 2 – invoke (call) the JavaScript function from a user/browser event:  Select the LastName field in the siteUser1Rec  From Quick Edit upperCase();  For the onblur event, click in the edit area, and code the following: upperCase();  Run the page and enter some (lower-case) value in the siteUser1Rec.LastName field. Then tab or click out of the field.

11 Last update: 12/04/2007 Let’s Have a Closer Look at this Function (and Call) – Breakdown of the Elements 1 – Boilerplate – identifies the beginning of a JavaScript to the browser 2 – Unique JavaScript function name (unique within the.JSP file) 3 – { … } curly braces mark and bound statement blocks 4 – document.getElementById(“form:JSFIDFieldname”) – used to refer to a fully-qualifed HTML field on the page (by its JSF ID – not by its EGL variable name) 5 –.value; - returns the value part of the field (this would be as opposed to a property) 6 – toUpperCase() – is a call to a JavaScript language (built-in function) upperCase(); 7 – The call to the upperCase(); function – when the browser/onblur event occurs at run-time

12 Last update: 12/04/2007  Creating JavaScript Functions – 5 of 6  Let’s have a look at some of the tooling for JavaScript:  Each form field has two reserved identifiers you can use to simplify one-off JavaScript behavior:  thisObj  thisEvent  You can refer to either of these inside of Quick Edit browser/user events and simplify coding (see this example – where we call a built-in JavaScript function to do what we did in the previous example, calling a custom JavaScript function)  Try this example out – and see  Note that the only down-side to doing this sort of work, is that it ties your business logic to form fields – making subsequent maintenance, testing and support potentially more complicated (than if you centralized your U.I. business rules in EGL JSFHandler code)

13 Last update: 12/04/2007  Creating JavaScript Functions – 6 of 6  So – now we’ll add a large number of JavaScript functions that could be of use in your production requirements – including:  Input-Required field validation  Comparing values (for equality)  Moving values (from one fields in a form to another)  To do this:  Copy the enormous JavaScript function set in the Slide Notes  Enter your Page in Source mode  Scroll down to the bottom of the file, and paste the JavaScript below the tag as shown  Save your changes  Read through the comments  Run the page and note the various JavaScript messages and functionality  Important Final Note on JavaScript: In this section you learned how to use, not how to code JavaScript. Coding JavaScript is a challenging discipline in and of itself, and will require you to spend many hours learning this complex and O-O language.

14 Last update: 12/04/2007  Now that you have completed this unit, you should have:  Described the concepts and functions of AJAX and JavaScript  Used different types of AJAX to make your pages respond faster  Request Refresh  Submit Refresh  External Refresh  Leveraged JavaScript to invoke Ajax engine for creating better response web applications JavaScript Topic Summary