:: Forum >> Version 2 >>

how to embed this in jsp

More information on this topic is available in the documentation section: /general.intro/.

hi

u gave an example but i am enable to get an idea ,how to embed that in a jsp file.Please give me the example which helps me well.

Thank U.
siva
Thursday, July 20, 2006
<b> This is an example of how I used the ActiveWidgets Grid in a JSP Page. This is assuming you have an understanding of using java with the web and tag libraries</b>
<br>
Hope this helps.

<br/>


<XMP>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<head>

<title>Job Functions</title>

<script language="JavaScript" src="/StaffDirectory/activewidgets32/runtime/lib/grid.js"></script>
<link href="/StaffDirectory/activewidgets32/runtime/styles/xp/grid.css" rel="stylesheet" type="text/css"/>

<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}

/* Columns */
.active-column-0 {width: 50px; text-align: left;}
.active-column-1 {width: 175px; text-align: left;}
.active-column-2 {width: 175px; text-align: left;}

/* Grid Lines */
.active-grid-row {border-bottom: 1px solid black;}
.active-grid-column {border-right: 1px solid black;}

/* Active Row */
.active-row-highlight {background-color: threedshadow;}
.active-row-highlight .active-row-cell {background-color: threedshadow;}

/* list div */
.listDiv {position:absolute; overflow:auto; height:200px; width:520px; border: thin solid Navy;}

</style>

<script type="text/javascript">
<!-- grid data -->



var myData = [

<logic:iterate id="jobFunc" name="sdJobFunctions" property="iterator" type="gov.###.advsys.dataobjects.jobDescription.JobFunction" indexId="index">
['<bean:write name="jobFunc" property="jobFunctionID" filter="true" ignore="true"/>','<bean:write name="jobFunc" property="jobFunctionName" filter="true" ignore="true"/>','<bean:write name="jobFunc" property="jobFunctionDesc" filter="true" ignore="true"/>'],
</logic:iterate>
];

var myColumns = ["Rec Key", "Job Func. Name", "Job Func Desc"];

</script>
</head>
<body>
<div class="listDiv">

<script>

function textSelected() {

var index = this.getSelectionProperty("index");
var strKey = this.getDataProperty("text", index, 0);
alert(strKey);
}



// create ActiveUI Grid javascript object
var obj = new Active.Controls.Grid;


// set number of rows/columns
obj.setRowCount(<bean:write name="sdJobFunctions" property="size" filter="true" ignore="true"/>);
obj.setColumnCount(3);


// provide cells and headers text
obj.setDataText(function(i, j){return myData[i][j]});
obj.setColumnText(function(i){return myColumns[i]});


// set click action handlervar index = obj.getProperty("selection/index");
obj.setAction("selectionChanged", textSelected);

//-- set multiple selections to false
obj.setProperty("selection/multiple", false);

//--- Mouse Over ---//
var row = new Active.Templates.Row;
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setTemplate("row", row);
//--- End of Mouse Over ---//

document.write(obj);

</script>
</div>


</div>

</body>
</html>


</XMP>
Raymond
Friday, July 28, 2006
whet is menat by <XMP>
</XMP> tag,where we will use this tag

Tuesday, December 26, 2006



This topic is archived.

Back to /general.intro/

Documentation:

Forum search