Hash map is used to store values like ‘key’ and ‘value’. This
also used to call the PR when we need it .Write code for the PFR in PR when we
load it. Jus check the code.
Background:
To return
a error message and also retain the selected value in a datefield Bean.
com.sun.java.util.collections.HashMap
hash= new com.sun.java.util.collections.HashMap(2);
PR
{
if
("true".equals(pageContext.getParameter("DisDate")))
{
OAMessageDateFieldBean
dateFieldBean
=(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("HrEffectiveDate");
dateFieldBean.setText(pageContext.getSessionValue("RetainEffDate").toString());
throw new
OAException("Effective date must be the first date of a pay period.
Possible date
"+pageContext.getSessionValue("PossibleDate").toString(),OAException.ERROR);
}
}
PFR
{
if(pageContext.getParameter("HrContinue")!=null)
{
pageContext.putSessionValue("RetainEffDate",dateFieldBean.getText(pageContext).toString());
pageContext.putSessionValue("PossibleDate",convertedDateString.toString());
hash.put("DisDate",
"true"); // setting Key value
pageContext.setForwardURLToCurrentPage(hash,
true, // retain the AM
"Y",
(byte)99);
}
}