- If we close the systram icon for db2 manager, to activate again the icon the below cmd..
Wednesday, May 9, 2012
Basic DB2 commands
Thursday, January 5, 2012
Ajax and Struts1.3 Sample Example
Task: Populate states based on Country using AJAX.
In previous post its done using javascript. Now its based on Ajax.
In this example i used static data. we can do it using Database. Based on country it will get the corresponding states.
1). RegisterUser.jsp
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
<head>
<script type="text/JavaScript" src="javascripts/CommonAjax.js"></script>
</head>
<body> <h2>Struts1.3 - Ajax Example</h2>
In previous post its done using javascript. Now its based on Ajax.
In this example i used static data. we can do it using Database. Based on country it will get the corresponding states.
1). RegisterUser.jsp
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
<head>
<script type="text/JavaScript" src="javascripts/CommonAjax.js"></script>
</head>
<body> <h2>Struts1.3 - Ajax Example</h2>
Wednesday, January 4, 2012
Populating States based on country using javascript
Instead of Ajax call we can populate States based on country using javascript in struts1.3
RegisterUser.jsp:-
Its normal Jsp, in the form i have two select fields in Form. Country and State.
Country:<html:select property="region" styleId="region" onchange="getTerritories(this.form, this.value);">
<html:option value="">-- None --</html:option>
<html:option value="Central">Central</html:option>
<html:option value="East">East</html:option>
<html:option value="Enterprise">Enterprise</html:option>
<html:option value="West">West</html:option>
</html:select>
State:<html:select property="territory" styleId="territory" >
<html:option value="">-- Please Select --</html:option>
</html:select>
"getTerritories" is the javascript funtion that calls when onChange Event occurs.
required JS File:-
var territories=new Array();
territories.Central=new Array("North Central","Great Lakes","Great Plains");
territories.East=new Array("Mid-Atlantic","NY NJ Metro","WallStreet","South","Upstate NY/NE");
territories.Enterprise=new Array("IBM-TBD","SAP-TBD","Healthcare-TBD","Automotive-TBD","CSC","Accenture","IBM","Ford","Delphi Automotive","Target");
territories.West=new Array("Pacific NW","Pacific SW","South West");
function getTerritories(form,index){
var cntrySel=document.getElementById("region");
// alert("cntrySel"+cntrySel.value);
terrirotyList=territories[cntrySel.value];
if(terrirotyList!=null){
setTerritories("territory",terrirotyList,terrirotyList);
}
}
function setTerritories(fieldId,newOptions,newValues){
// alert(fieldId+"@@"+newOptions+"&&"+newValues);
var selectedField=document.getElementById("territory");
selectedField.options.length=0;
for(i=0; i<newOptions.length;i++){
selectedField.options[selectedField.length]=new Option(newOptions[i],newValues[i]);
}
}
RegisterUser.jsp:-
Its normal Jsp, in the form i have two select fields in Form. Country and State.
Country:<html:select property="region" styleId="region" onchange="getTerritories(this.form, this.value);">
<html:option value="">-- None --</html:option>
<html:option value="Central">Central</html:option>
<html:option value="East">East</html:option>
<html:option value="Enterprise">Enterprise</html:option>
<html:option value="West">West</html:option>
</html:select>
State:<html:select property="territory" styleId="territory" >
<html:option value="">-- Please Select --</html:option>
</html:select>
"getTerritories" is the javascript funtion that calls when onChange Event occurs.
required JS File:-
var territories=new Array();
territories.Central=new Array("North Central","Great Lakes","Great Plains");
territories.East=new Array("Mid-Atlantic","NY NJ Metro","WallStreet","South","Upstate NY/NE");
territories.Enterprise=new Array("IBM-TBD","SAP-TBD","Healthcare-TBD","Automotive-TBD","CSC","Accenture","IBM","Ford","Delphi Automotive","Target");
territories.West=new Array("Pacific NW","Pacific SW","South West");
function getTerritories(form,index){
var cntrySel=document.getElementById("region");
// alert("cntrySel"+cntrySel.value);
terrirotyList=territories[cntrySel.value];
if(terrirotyList!=null){
setTerritories("territory",terrirotyList,terrirotyList);
}
}
function setTerritories(fieldId,newOptions,newValues){
// alert(fieldId+"@@"+newOptions+"&&"+newValues);
var selectedField=document.getElementById("territory");
selectedField.options.length=0;
for(i=0; i<newOptions.length;i++){
selectedField.options[selectedField.length]=new Option(newOptions[i],newValues[i]);
}
}
Friday, December 2, 2011
Updating Table for Particular Records or Rows
Scenario : We have to update the particular column of a table for some rows range. Using csv data file.
| Address Table | ||||
| add id | add1 | add2 | Street | city |
| 100 | samp | samp2 | test | tstcity |
| 101 | samp | samp2 | test | tstcity |
| 102 | samp | samp2 | test | tstcity |
Subscribe to:
Posts (Atom)