<rw:getValue>
The rw:getValue
tag takes the name of a report object, such as
a column, system parameter, user parameter, command line keyword, and so on, retrieves
its value, formats it as required, and assigns its string value to a new Java
variable. The Java variable name corresponds with the value of the id
attribute. rw:getValue
cannot assign a value to an existing variable.
The variable is only valid from the rw:getValue
tag until the
end of the immediate enclosing scope. This can, for example, be the body of
an enclosing rw:foreach
tag.
<rw:getValue id="getvalue_id" src="field_name" [formatMask="format_mask"]>
[tag body]
</rw:getValue>
Attribute Value |
Description |
|
A unique identifier in the page scope. This is also the name of the new Java variable. |
field_name |
The name of a Report object, such as column, system parameter, user parameter, command line keyword, and so on. |
format_mask |
(Optional) The format mask applied to the report object value. It only applies to values of number or date data type. |
This example shows rw:getValue
inside a rw:foreach
tag.
<rw:foreach id="R_G_EMP_NAME_1" src="G_EMP_NAME">
<tr bgcolor="<rw:seqval ref="bgcolor" op="nextval"/>">
<td headers="<%= idEmpName %>">
<rw:getValue id="myEmpName" src="EMP_NAME"/><%= myEmpName %></td>
<td headers="<%= idEmpId %>">
<rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID"> F_EMPLOYEE_ID </rw:field></td>
<td headers="<%= idHireDate %>">
<rw:field id="F_HIRE_DATE" src="HIRE_DATE"> F_HIRE_DATE </rw:field></td>
<td headers="<%= idSalary %>">
<rw:field id="F_SALARY" src="SALARY"> F_SALARY </rw:field></td>
<td headers="<%= idCommision %>">
<rw:field id="F_COMM_PCT" src="COMMISSION_PCT"> F_COMM_PCT </rw:field></td>
<td headers="<%= idManager %>">
<rw:field id="F_EMPLOYEE_ID1" src="EMPLOYEE_ID1"> F_EMPLOYEE_ID </rw:field></td>
<td headers="<%= idTotal %>">
<rw:field id="F_TotalSALARY" src="TotalSALARYPerEMPLOYEE_ID"
formatMask="%NNNNN.00"> F_TotalSALARY </rw:field></td>
</tr>
</rw:foreach>
About JavaServer Pages and servlets
Copyright © 1984, 2005, Oracle. All rights reserved.