ElanBean for PulloutMenu


SUN MICROSYSTEMS (SUNW)
last:  71 7/8
change:  -8
today's high79 3/4previous close79 7/8
today's low71 3/4bid72 1/2
today's open78 5/8ask72 15/16
volume21,436,700earnings per shareNot Avail.
52-week high106 3/4dividend per share0.00
52-week low26 31/32dividend pay dateN/A
P/E ratio75ex-dividend dateN/A
Intra Day
1-Year
INTEL CORP (INTC)
last:  71 7/8
change:  -8
today's high119 7/8previous close118 3/8
today's low109 13/16bid109 5/8
today's open117 3/4ask109 11/16
volume25,192,900earnings per shareNot Avail.
52-week high145 3/8dividend per share0.04
52-week low50 1/8dividend pay date09/01/00
P/E ratio36ex-dividend date08/03/00
Intra Day
1-Year
ORACLE CORP (ORCL)
last:  71 7/8
change:  -8
today's high68 1/2previous close67 13/16
today's low62 3/8bid62
today's open67ask62 1/16
volume29,287,000earnings per shareNot Avail.
52-week high90dividend per share0.00
52-week low11 9/32dividend pay dateN/A
P/E ratio85ex-dividend dateN/A
Intra Day
1-Year
INTL BUSINESS MACHINES (IBM)
last:  71 7/8
change:  -8
today's high110previous close109 1/4
today's low107 1/8bidNot Avail.
today's open109askNot Avail.
volume5,978,900earnings per shareNot Avail.
52-week high139 3/16dividend per share0.13
52-week low89dividend pay date06/10/00
P/E ratio24ex-dividend date05/08/00
Intra Day
1-Year.
MICROSOFT CORP (MSFT)
last:  71 7/8
change:  -8
today's high65 9/16previous close64 3/16
today's low63 1/16bid62 3/4
today's open63 7/8ask63
volume28,981,300earnings per shareNot Avail.
52-week high119 15/16dividend per share0.00
52-week low62 7/16dividend pay dateN/A.
P/E ratio37ex-dividend dateN/A.
Intra Day
1-Year

Also please check out the following ElanBeans which uses DHTML/JavaScript

CollapseMenu

HierarchialMenu

MouseOver Buttons

ScrollObject


PulloutMenu Description

Explanation For the above Pullout Menu

You can see in the page the seamless integration in Action. Each "item" in the 'pullout-memu' can be an ElanBean. All the ElanBeans can be set to a Table cell. This Table can be a cell in a larger Component and so-on.

Imagin greate web applications one can build using this kind of integration, where each component may be build on remote servers and assembled like building blocks with 'Virtual Web server' that is discussed later.

/***********************Code for Pullout Menu*********************************/

//Assume that these mini-servlet components can generate HTML-code using run-time Stock-data.
StockCB s1= new StockCB("SUNW"); //generates stock quotes of Sun
StockCB s2= new StockCB("INTC"); //generates stock quotes of Intel
StockCB s3= new StockCB("ORCL"); //generates stock quotes of Oracle
StockCB s4= new StockCB("IBM");  //generates stock quotes of IBM
StockCB s5= new StockCB("MSFT"); //generates stock quotes of Micro Soft


//set Menu names on the left side of Pulloutmenu
String items[] = {"Sun","Intel","Oracle","IBM","MicroSoft"}; 

// This method changes Default colors.
String colors[]= {"#A5FED8","white","#FFC8A4","#A8BBFB"}; 
Object contents[] = { s1,s2,s3,s4,s5};

//Create Pulloutmenu object with the above defined properties
PulloutCB po = new PulloutCB(5,items,contents,colors ); 
po.setSize(585,380);
/*************************************************************************/

Code For the StockCB Component

<%
private float dayHigh = 79 3/4;
private float daylast = 71 7/8;
private float change = -8;
private float dayLow = 71 3/4;
private float dayOpen = 78 5/8;
private float previousClose = 79 7/8;
private float bid = 72 1/2;
private float ask = 72 15/16;
private float volume = 21436700;
private float eps = null;
private float dps = 0.00;
private float divPayDate = null;
private float exDivDate = null;
private float yearHigh 106 3/4;
private float yearLow = 26 31/32;
private float peRatio = 75;

private String tickerCode = "SUNW";
%>

//Above Variables can be initialized from the DataBase depending on the ticker code
//Below is the JSP code to display the table with the run time data

<table>
<tr>
  <td rowspan=4>SUN MICROSYSTEMS (<%=
tickerCode %>) </td>
</tr><tr>
  <td rowspan=2 bgcolor='pink'> last <%=
dayLast %> </td>
  <td rowspan=2 bgcolor='pink'> Change <%=
change %> </td>
</tr><tr>
  <td>Today's High</td><td> <%=
dayHigh %></td>
  <td>Previous Close </td><td> <%=
previousClose %></td>
</tr><tr>
  <td>Today's Low </td><td> <%=
dayLow %> </td>
  <td>Bid</td><td> <%=
bid %> </td>
</tr><tr>
  <td>Today's Open</td><td> <%=
dayOpen %>
  <td> Ask </td><td> <%=
ask %> </td>
</tr><tr>
  <td>Volume</td><td> <%=
volume %> </td>
  <td> Earning per Share </td><td> <%=
eps %> </td>
</tr><tr>
  <td> 52-week High</td><td> <%=
yearHigh %></td>
  <td> Dividend per Share </td><td> <%=
dps %>
</tr><tr>
  <td> 52-week Low</td><td> <%=
yearLow %></td>
  <td> Dividend pay Date </td><td> <%=
divPayDate %>
</tr><tr>
  <td> P/E Ratio</td><td> <%=
peRatio %></td>
  <td> ex-Dividend Date </td><td> <%=
exDivDate %>
</tr>
</table>

<%
private float intraDayClose[];
private float intraDayVolume[];
private String intraDayTime[];

%>

//The arrays above contains the values got from the database for the points for drawing the svg graph
// Below is the jsp code for building the chart
<%
//Number of Days passed as argument
DayStockMovement s1intraDay=new DayStockMovement(1);

s1intraDay.setClosingValues(intraDayClose);
s1intraDay.setVolume(intraDayVolume);
s1intraDay.setTime(intraDayTime);
s1intraDay.isDrawBarStock(true); // Plots the closing points for the stocks
s1intraDay.isLineVolume(true);  // Draws the volumes as lines
s1intraDay.buildWC(req,out);

//=============================================
private float intraYearClose[];
private float intraYearVolume[];
private String intraYearTime[];

//Number of Weeks passed as argument
WeekStockMovement s1intraYear=new WeekStockMovement(52);

s1intraYear.setClosingValues(intraDayClose);
s1intraYear.setVolume(intraDayVolume);
s1intraYear.setTime(intraYearTime);
s1intraYear.isDrawBarStock(true); // Plots the closing points for the stocks
s1intraYear.isLineVolume(true);  // Draws the volumes as lines

s1intraYear.buildWC(req,out);
%>