Different color bar chart with popup box in ADF

Similar documents
Different color bars chart with Popup Box in ADF

ADF Code Corner How-to restrict the list of values retrieved by a model driven LOV. Abstract: twitter.com/adfcodecorner

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

ADF Code Corner. 64. How-to implement a Select Many Shuttle with pre- selected values. Abstract: twitter.com/adfcodecorner

How To Create Employee With Designation Report In ADF Attractively

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

ADF Code Corner. 90. Filtering ADF bound lists. Abstract: twitter.com/adfcodecorner

Oracle Retail Accelerators for WebLogic Server 11g

CLASS DESIGN. Objectives MODULE 4

Domain-Driven Design Activity

Java Persistence API (JPA) Entities

First Name Last Name ID#

COMP 401 Spring 2014 Midterm 1

ADF Code Corner. 65. Active Data Service Sample Twitter Client. Abstract: twitter.com/adfcodecorner

Model-based Software Engineering (02341, Spring 2017) Ekkart Kindler

Dashboard provides a portal like layout with drag&drop based reorder capabilities. Name Default Type Description

Creating a Custom ListView

Authentication Layer

Advanced Programming - JAVA Lecture 4 OOP Concepts in JAVA PART II

CS61B Lecture #25: Java Generics. Last modified: Thu Oct 19 19:36: CS61B: Lecture #25 1

Problems. Java Generics. Example. Example. Often you need the same behavior for different kind of classes

CS108, Stanford Handout #8. Java Generics

CSE 331 Software Design and Implementation. Lecture 14 Generics 2

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Chair of Software Engineering. Languages in Depth Series: Java Programming. Prof. Dr. Bertrand Meyer. Exercise Session 8.

CS61B Lecture #25: Java Generics. Last modified: Thu Oct 18 21:04: CS61B: Lecture #25 1

Example cdi-interceptors can be browsed at

CSE 331 Software Design & Implementation

Notes on Chapter Three

Instructions. Quiz #2. Name: Solutions Student Number: Signature:

COMP 401: THE DUAL ROLE OF A CLASS. Instructor: Prasun Dewan (FB 150,

ADF Code Corner. 97. How-to defer train-stop navigation for custom form validation or other developer interaction. Abstract: twitter.

ADF Mobile : Data Services Java Beans. Ma Ping

Refactoring to Seam. NetBeans. Brian Leonard Sun Microsystems, Inc. 14o

CS1083 Week 2: Arrays, ArrayList

Parametric polymorphism and Generics

ENCAPSULATION AND POLYMORPHISM

The collections interfaces

AP CS Unit 7: Interfaces Exercises 1. Select the TRUE statement(s).

Advanced Java Exercises

//Title: EE/CIS 694T //Version: //Copyright: Copyright (c) 2000 //Author: Furrukh Khan //Company: OSU //Description: Final Solution

ADF Code Corner. Oracle JDeveloper OTN Harvest 01 / Abstract: twitter.com/adfcodecorner

1) Discuss the mutual exclusion mechanism that you choose as implemented in the chosen language and the associated basic syntax

Object Oriented Programming (II)

Programming II (CS300)

Collections, Maps and Generics

Programming II (CS300)

CSE 331 Software Design and Implementation. Lecture 14 Generics 2

Programming II (CS300)

Algorithmic Thinking and Structured Programming (in Greenfoot) Teachers: Renske Smetsers-Weeda Sjaak Smetsers Ana Tanase

RAIK 183H Examination 2 Solution. November 11, 2013

EJB - INTERCEPTORS. Interceptor methods can be applied or bound at three levels

Software Engineering. Prof. Agostino Poggi

Generating/Updating code from whole project

CIT Special final examination

Programming II (CS300)

JavaBeans. JavaBeans. Java. Java JavaBeans. JavaBeans. JavaBeans GUI. JavaBeans Builder (vitsual) Java. JavaBeans. Beans. Builder.

Java Language Features

CMSC 433 Programming Language Technologies and Paradigms. Spring 2013

Programming Techniques Laboratory 1 OOP Principles

ADF Region Interaction: External Train Navigation

CMSC 132: Object-Oriented Programming II

Chapter 4: Writing Classes

Principles of Object Oriented Programming. Lecture 4


CS 307 Midterm 2 Fall 2008

COMP 401 Spring 2013 Midterm 1

Groovy Primer Chris Dail Groovy Primer (March 2010)

Functional. Pattern Embeding Regions inside PopUp Windows

What is an Iterator? An iterator is an abstract data type that allows us to iterate through the elements of a collection one by one

Oracle Exam 1z0-809 Java SE 8 Programmer II Version: 6.0 [ Total Questions: 128 ]

RAIK 183H Examination 2 Solution. November 10, 2014

JAXRS Testing. JAX-RS Testing. Embedded Jetty

Self-test Java Programming

Information systems modelling UML and service description languages

CMP-326 Total 120 Points Final Fall 2012

Wentworth Institute of Technology COMP1050 Computer Science II Spring 2017 Derbinsky. Recursion. Lecture 13. Recursion

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING

Java Server Faces - The View Part

Tutorial 12. Exercise 1: Exercise 2: CSC111 Computer Programming I

Practice exam for CMSC131-04, Fall 2017

ADF Mobile Code Corner

CIS 265 Exam 2 First Name Last Name

Object Oriented Programming. Java-Lecture 6 - Arrays

Grouping objects Lecture 7

APCS Unit 5 Exam. Assuming all four classes have a default constructor, which of the following statements would result in an error from the compiler?

EXAMINATIONS 2013 Trimester 1 SWEN221. Software Development. Closed Book. There are 180 possible marks on the exam.

CS 31 Discussion 1A, Week 8. Zengwen Yuan (zyuan [at] cs.ucla.edu) Humanities A65, Friday 10:00 11:50 a.m.

Announcements. Lecture 15 Generics 2. Announcements. Big picture. CSE 331 Software Design and Implementation

CSE 331 Software Design and Implementation. Lecture 15 Generics 2

Distributed Systems Recitation 1. Tamim Jabban


CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects

Manual for Advanced Java

Alternate Methods for Informatica Metadata Exchange SDK

Programming in Scala Mixin inheritance Summer 2008

A+ Computer Science -

ADF Code Corner How-to declaratively build a master-detail behavior with DVT components. Abstract: twitter.com/adfcodecorner

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015

Final Review Session #2. Brahm Capoor

Transcription:

Different color bar chart with popup box in ADF Department wise employee count graph with popup Box in ADF: (popup box shows Employees names and manager name for particular department). I am going to explain how we can create the model value for bar graph which we can pass in the tabular data attribute of bar graph and popupbox. 1.Get Data From Table 2.Mention Different colors and popup logic in bean. 3.Call your method in ADF bargraph tabular data attribute and listener. 1.Get Data From Table: a) Get Data for graph b)get Data for popup box information a) Get Data for graph Following code explains we are creating List<String> from VO, each element of the list holds particular Department Name and Employees count of the particular department. Because Name is the x-axis of the graph and Employees count is the bars length of the graph. public List<String> deptgraph()throws Exception{ int i=0; List <String> list1=new ArrayList<String>(); try{ ViewObjectImpl impl=getviewobj1_1(); impl.executequery(); while(impl.hasnext()){ Row row=impl.next(); i++; String st=row.getattribute("deptname")+","+row.getattribute("count1")+"";

list1.add(st); catch(exception e){ e.printstacktrace(); return list1; b)get Data for popup box information: 1.If I click particular department bar one popup box will open it should display employees name and manager name of the particular department. 2.following method should return particular department Employees names. public List<String> getemployees(string deptname){ List<String> list=new ArrayList<String>(); ViewObjectImpl vo=getviewobj3_1(); ViewCriteria vc=vo.getviewcriteria("findemployees"); vo.setnamedwhereclauseparam("pdeptname", deptname); vo.applyviewcriteria(vc); vo.executequery(); while(vo.hasnext()){ Row row=vo.next(); list.add(row.getattribute("name").tostring());

return list; 3.following method should return particular department Manager name. public String getmanager(string deptname){ ViewObjectImpl vo=getviewobj3_1(); ViewCriteria vc=vo.getviewcriteria("getmanager"); vo.setnamedwhereclauseparam("pdeptname", deptname); vo.applyviewcriteria(vc); vo.executequery(); while(vo.hasnext()){ Row row=vo.next(); return row.getattribute("managername").tostring(); return null; 2.Mention Different colors and popup logic in bean: a)different color bars Logic. b)popup box logic in Bean. a)different color bars Logic. public void setlistobject1(list<object[]> listobject1) { this.listobject1 = listobject1; public List<Object[]> getlistobject1() { try{

int j=0; AppModule1Impl impl=(appmodule1impl)configuration.createrootapplicationmodule("com.tad.model.eo.appmodule1", "AppModule1Local"); List<String> list= impl.deptgraph(); for(int i=0;i<list.size();i++){ j++; String[] st=list.get(i).split(","); Object[] obj1 = { st[0], "Series_"+j, Integer.parseInt(st[1]) ; listobject1.add(obj1); Configuration.releaseRootApplicationModule(impl, true); catch(exception e){ e.printstacktrace(); return listobject1; 1.In this existing code we just call the list which we prepared in Application module. 2. ADF bargraph tabular data attribute expecting List<Object[]>. Object[] should contain x-axis,color,bars. "maintenance", "Series_1", 7 :- i)it is x axis value ii)it is series name (here only one series is present and that is Series_1) iii)it is data point value or y axis value which always be integer or double. 3.So we generated setter and getter attribute for private List<Object[]> listobject1=new ArrayList<Object[]>();

4.Getter method of the listobject1 we need to mention colors of the bars. 5. Here series_1 represent one color and series_2 represent another color series_3.etc. 6.so when we iterate the list which we prepared in Application module We create one object array in this array we mentioned different color. For example: for(int i=0;i<list.size();i++){ j++; String[] st=list.get(i).split(","); Object[] obj1 = { st[0], "Series_"+j, Integer.parseInt(st[1]) ; listobject1.add(obj1); 7.Finally all the object arrays are added in list,each object array having puticular Deparment name, bar color, Department employee count. b)popup box logic in Bean: when click the any bar automatically this method will be called. public void onpieclick(clickevent clickevent) { String deptname = null; ComponentHandle handle = clickevent.getcomponenthandle(); if (handle instanceof DataComponentHandle) { DataComponentHandle dhandle = (DataComponentHandle)handle; Attributes[] groupinfo = dhandle.getgroupattributes(); if (groupinfo!= null) { for (Attributes attrs : groupinfo) { deptname = (String)attrs.getValue(Attributes.LABEL_VALUE);

AppModule1Impl impl=(appmodule1impl)configuration.createrootapplicationmodule("com.tad.model.eo.appmodule1", "AppModule1Local"); List<String> list=impl.getemployees(deptname); String managername=impl.getmanager(deptname); Configuration.releaseRootApplicationModule(impl, true); FacesContext ctx = FacesContext.getCurrentInstance(); FacesMessage msg = new FacesMessage("Employees in "+ deptname+" Department : " +list); FacesMessage msg1 = new FacesMessage( "Manager Name:"+ managername); msg.setseverity(facesmessage.severity_info); msg1.setseverity(facesmessage.severity_info); ctx.addmessage(null, msg); ctx.addmessage(null, msg1); 1)From the existing code (String)attrs.getValue(Attributes.LABEL_VALUE); explains, Get label value of the particular bar that means department name. 2) FacesMessage msg = new FacesMessage("Employees in "+ deptname+" Department : " +list); FacesMessage msg1 = new FacesMessage( "Manager Name:"+ managername); explains Employess names list and manager name are added faces message.

3.Call your method in ADF bargraph tabular data attribute and listener. <dvt:bargraph id="bargraph1" shortdesc="aa" threedeffect="true" subtype="bar_vert_clust" tabulardata="#{graphbean.listobject1" clicklistener="#{graphbean.onpieclick"> <dvt:background> <dvt:specialeffects/> </dvt:background> <dvt:graphplotarea/> <dvt:seriesset> tabulardata="#{graphbean.listobject1" <dvt:series linewidth="3"/> </dvt:seriesset> <dvt:o1axis/> <dvt:y1axis/> <dvt:legendarea automaticplacement="ap_never"/> </dvt:bargraph> a) tabulardata="#{graphbean.listobject1" Graph details b) clicklistener="#{graphbean.onpieclick"- when the user click any bar this method will be invoked.

Output: 1. 2. if the user click the production bar.