value="<s:property value='institutes.eiin'/>"
Wednesday, June 25, 2014
Radio Button value retrieve Syntax declare way in jsp page
Fresh Radio Button : :
<span><input name="isLearnEngMedium" type="radio" value="1" />Yes</span>
<span><input name="isLearnEngMedium" type="radio" value="2" />No></span>
Retrieve Radio Button :
<span>Yes
<s:if test='%{institutes.english_ver_yn !=null && institutes.english_ver_yn.equals("1")}'>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="1" checked="checked">
</s:if>
<s:else>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="1" >
</s:else>
</span>
<span>No
<s:if test='%{institutes.english_ver_yn !=null && institutes.english_ver_yn.equals("0")}'>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="0" checked="checked">
</s:if>
<s:else>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="0" >
</s:else>
</span>
Retrieve Radio Button fron other page(same) :
<table>
<tr>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td style="text-align:center;">
<s:if test='%{summaryInfo.htTrainingYn !=null && summaryInfo.htTrainingYn.equals("1")}'>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="1" checked="checked">
</s:if>
<s:else>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="1" >
</s:else> </td>
<td style="text-align:center;">
<s:if test='%{summaryInfo.htTrainingYn !=null && summaryInfo.htTrainingYn.equals("0")}'>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="0" checked="checked">
</s:if>
<s:else>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="0" >
</s:else> </td>
</tr>
</table>
<span><input name="isLearnEngMedium" type="radio" value="1" />Yes</span>
<span><input name="isLearnEngMedium" type="radio" value="2" />No></span>
Retrieve Radio Button :
<span>Yes
<s:if test='%{institutes.english_ver_yn !=null && institutes.english_ver_yn.equals("1")}'>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="1" checked="checked">
</s:if>
<s:else>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="1" >
</s:else>
</span>
<span>No
<s:if test='%{institutes.english_ver_yn !=null && institutes.english_ver_yn.equals("0")}'>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="0" checked="checked">
</s:if>
<s:else>
<input id="isLearnEngMedium" name="isLearnEngMedium" type="radio" value="0" >
</s:else>
</span>
Retrieve Radio Button fron other page(same) :
<table>
<tr>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td style="text-align:center;">
<s:if test='%{summaryInfo.htTrainingYn !=null && summaryInfo.htTrainingYn.equals("1")}'>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="1" checked="checked">
</s:if>
<s:else>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="1" >
</s:else> </td>
<td style="text-align:center;">
<s:if test='%{summaryInfo.htTrainingYn !=null && summaryInfo.htTrainingYn.equals("0")}'>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="0" checked="checked">
</s:if>
<s:else>
<input id="htTrainingYn" name="htTrainingYn" type="radio" value="0" >
</s:else> </td>
</tr>
</table>
Check box value retrieve Syntax declare way in jsp page
<span>
<s:if test='%{institutes.science_group == "1"}'>
<input name="scienceGroupMore1" id="scienceGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="1" checked>Science
</s:if>
<s:else>
<input name="scienceGroupMore1" id="scienceGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="1" >Science
</s:else>
</span>
<span>
<s:if test='%{institutes.arts_group == "2"}'>
<input name="humanitiesGroupMore1" id="humanitiesGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="2" checked>Humanities
</s:if>
<s:else>
<input name="humanitiesGroupMore1" id="humanitiesGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="2" >Humanities
</s:else>
</span>
<span>
<s:if test='%{institutes.commerce_group == "3"}'>
<input name="businessGroupMore1" id="businessGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="3" checked>Business
</s:if>
<s:else>
<input name="businessGroupMore1" id="businessGroupMore1" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" type="checkbox" value="3" >Business
</s:else>
</span>
</td>
Combo box value retrieve Syntax declare way in jsp page
Fresh Combo:
**********************
<select class="form-control input-sm" id="levelOfInstitute" name="levelOfInstitute" style="height:26px;font-size:12px;">
<option value="0">Select</option>
<option value="1">Option One</option>
</select>
get List by iterator tag :
--------------------------
<s:iterator value="educationLvList" status="status">
<option value="<s:property value="education_level_id"/>"><s:property value="education_level_name"/></option>
</s:iterator>
That Means:
<select class="form-control input-sm" id="levelOfInstitute" name="levelOfInstitute" style="height:26px;font-size:12px;">
<option value="0">Select</option>
<s:iterator value="educationLvList" status="status">
<option value="<s:property value="education_level_id"/>"><s:property value="education_level_name"/></option>
</s:iterator>
</select>
If Retrieve in list combo :
<select id="instituteBoardDivision" name="instituteBoardDivision" style="width:auto;">
<option value="0">---</option>
<s:if test='%{institutes.division_id != ""}'>
<option selected="selected" value="<s:property value="institutes.division_id"/>" ><s:property value="institutes.division_name"/></option>
<s:iterator value="divisionList" status="status">
<option value="<s:property value="division_id"/>"><s:property value="division_name"/></option>
</s:iterator>
</s:if>
<s:else>
<s:iterator value="divisionList" status="status">
<option value="<s:property value="division_id"/>"><s:property value="division_name"/></option>
</s:iterator>
</s:else>
</select>
If retrieve in not list combo : Yes , No and Not applicable
<select id="mpoValidInstitution" name="mpoValidInstitution" class="form-control input-sm" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" style="height:26px;font-size:12px;">
<s:if test='%{institutes.mpo_status == "1"}'>
<option value="1" selected="selected">Yes</option>
<option value="2">No</option>
<option value="3">Not applicable</option>
</s:if>
<s:elseif test='%{institutes.mpo_status == "3"}'>
<option value="2" >No</option>
<option value="1">Yes</option>
<option value="3" selected="selected">Not applicable</option>
</s:elseif>
<s:else>
<option value="3">Not applicable</option>
<option value="1">Yes</option>
<option value="2" selected="selected">No</option>
</s:else>
</select>
If retrieve in not list combo : Thana, District and Division
<select id="instituteLocation" name="instituteLocation" class="form-control input-sm" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" style="height:26px;font-size:12px;">
<s:if test='%{{institutes.area_status1 == "1"}'>
<option value="1" selected="selected">Thana headquarters</option>
<option value="2">District headquarters</option>
<option value="3">Divisional headquarters</option>
</s:if>
<s:elseif test='%{{institutes.area_status1 == "2"}'>
<option value="1">Thana headquarters</option>
<option value="2" selected="selected">District headquarters</option>
<option value="3">Divisional headquarters</option>
</s:elseif>
<s:elseif test='%{institutes.area_status1 == "3"}'>
<option value="1">Thana headquarters</option>
<option value="2">District headquarters</option>
<option value="3" selected="selected">Divisional headquarters</option>
</s:elseif>
<s:else>
<option value="1" selected="selected">Thana headquarters</option>
<option value="2">District headquarters</option>
<option value="3">Divisional headquarters</option>
</s:else>
</select>
Date Format from jsp page
Add below these line in head tag :
<!-- start for date format -->
<%@page import="java.util.Date" %>
<%@page import="java.text.DateFormat" %>
<%@page import="java.text.SimpleDateFormat" %>
<%
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
String formattedDate = df.format(new Date());
%>
<!-- end for date format -->
Start Date Format from jsp page:
<input id="schoolDate" name="schoolDate" type="text" value="<s:property value='institutes.establish_date'/>" placeholder="DD/MM/YYYY" maxlength="10" size="10" style="height:26px;text-transform: lowercase;font-variant: small-caps; font-size:14px;" class="form-control input-sm"/>
<input id="schoolDate" name="schoolDate" type="text" value="<s:date name='institutes.establish_date' format='dd/MM/yyyy' />" placeholder="DD/MM/YYYY" maxlength="10" size="10" style="height:26px;text-transform: lowercase;font-variant: small-caps; font-size:14px;" class="form-control input-sm"/>
value="<s:property value='institutes.establish_date'/>"
value="<s:date name='institutes.establish_date' format='dd/MM/yyyy' />"
Also see the below Link :
http://www.java-connect.com/jsp/how-to-use-scriptlets-in-jsp-page.html
<!-- start for date format -->
<%@page import="java.util.Date" %>
<%@page import="java.text.DateFormat" %>
<%@page import="java.text.SimpleDateFormat" %>
<%
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
String formattedDate = df.format(new Date());
%>
<!-- end for date format -->
Start Date Format from jsp page:
<input id="schoolDate" name="schoolDate" type="text" value="<s:property value='institutes.establish_date'/>" placeholder="DD/MM/YYYY" maxlength="10" size="10" style="height:26px;text-transform: lowercase;font-variant: small-caps; font-size:14px;" class="form-control input-sm"/>
<input id="schoolDate" name="schoolDate" type="text" value="<s:date name='institutes.establish_date' format='dd/MM/yyyy' />" placeholder="DD/MM/YYYY" maxlength="10" size="10" style="height:26px;text-transform: lowercase;font-variant: small-caps; font-size:14px;" class="form-control input-sm"/>
value="<s:property value='institutes.establish_date'/>"
value="<s:date name='institutes.establish_date' format='dd/MM/yyyy' />"
Also see the below Link :
http://www.java-connect.com/jsp/how-to-use-scriptlets-in-jsp-page.html
Monday, June 23, 2014
Saturday, June 7, 2014
Subscribe to:
Posts (Atom)
