Wednesday, 24 October 2012

Forward OAF page with parameter using Hash map.


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);

                }
}

1 comment:

  1. My spouse and I love your blog and find almost all of your posts to be just what I’m looking for. Appreciating the persistence you put into your blog and the detailed information you provide. I found another one blog like you OA Framework.Actually I was looking for the same information on internet for Oracle OAF and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete