This discussion is archived
1 2 Previous Next 24 Replies Latest reply: Jan 9, 2013 1:20 AM by User415813 RSS

passing value from seeded page to multiple pages

User415813 Newbie
Currently Being Moderated
Hi,
i'm extending oracle paybles standard customer page (say page1)
the main page has a region say region1 which has massegechoice bean category,selected by user on create page.
after click of save button of main page(page1), it will be navigating to next page.then click details image on 2nd
will nevigate upto third page which has 5 tabs.
here on third tab i want to do customizations base on that category value.

so basically,
{region1(get val) ->page1(pass val)}-> page2 -> page3(get val and do customization)

oracle uses a function for navigation in seeded controller...
oapagecontext.forwardImmediately("FUNCTION_NAME", (byte)0, null, hashmap, false, "N");
     
my question is, how can i pass a value through my extenedde controllers successfully...

have used hashmap,oadbtransaction and fetching attributes through View object from page1..but didnt got value of
category in main page to pass to 2nd page...

please suggest...


thanks in advance,
Namrata
  • 1. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Namrata,

    Please share your code , and you can also make use of the "session variable" to carry the value from one screen
    to other screen in oaf .

    Keerthi
  • 2. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi Keerthi,
    thanks for your reply ...

    giving the code for region having GICCHzPuiAcctSiteDtailCO controller where im getting value of category(msg choice) and making customizations to make some fields mandatory..

    here..
    1. im using putTransientvalue and trying to print it in main page, however in diagnostics im getting it as null...
    2. my whole page is getting refreshed as soon as category value is selected which should not happen.i tried firePartialaction event, but then event is not getting
    fired..
    3. there are 3 navigations and user can navigate to other page/tab in between ..so will it be helpful to use session variable?


    public class GICCHzPuiAcctSiteDtailCO extends HzPuiAcctSiteDtailCO
    {
    public GICCHzPuiAcctSiteDtailCO() {}

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
    super.processRequest(oapagecontext,oawebbean);
    OAPageLayoutBean pgbean;
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
    OADBTransaction oadbtransaction = am.getOADBTransaction();

    //Customer classification,Trade License details, Trade License Expiry date validation.
    pgbean = (OAPageLayoutBean)oapagecontext.getPageLayoutBean();

    if(pgbean != null)
    {
    // finding category value
    OAMessageChoiceBean oaCategoryBean = (OAMessageChoiceBean)pgbean.findChildRecursive("AcctSiteCC");
    String strCategoryPageVal = (String)oaCategoryBean.getValue(oapagecontext);
    // Firing Action.....
    FireAction firePartialAction = new FirePartialAction("AcctSiteFireAction");
    oaCategoryBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
    oapagecontext.writeDiagnostics(this, " GICCHzPuiAcctSiteDtailCO : AcctSiteFireAction set.. " , 1);

    String StrCategoryVal = (String)oapagecontext.getParameter("AcctSiteCC");

    oapagecontext.writeDiagnostics(this, " GICCHzPuiAcctSiteDtailCO : StrCategoryVal in ProcessRequest by hashmap = " +StrCategoryVal , 1);
    --
         
    if ("CREDIT".equalsIgnoreCase(StrCategoryVal))
    {

    //some customizations...
         
    }
    }
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {        
    super.processFormRequest(oapagecontext,oawebbean);

    String strCategory = oapagecontext.getParameter("AcctSiteCC");
    HashMap hm = new HashMap();
    hm.put("CategoryVal",strCategory);

    oapagecontext.writeDiagnostics(this, " GICCHzPuiAcctSiteDtailCO : StrCategoryVal in PFR...= " +StrCategoryVal , 1);

    // putting category value
    String StrCategoryVal = (String)oapagecontext.getParameter("AcctSiteCC");
    oadbtransaction.putTransientValue("categoryTransValue", StrCategoryVal);

    if(("CREDIT".equalsIgnoreCase(strCategory)))
    {
    // refresh to the current page.
    if("AcctSiteFireAction".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    {          
    oapagecontext.writeDiagnostics(this, " GICCHzPuiAcctSiteDtailCO : fireaction fired....****" , 1);

    oapagecontext.forwardImmediatelyToCurrentPage(hm// passing hashmap
    ,true //Retain AM
    , ADD_BREAD_CRUMB_NO);
    }
    }
    oapagecontext.writeDiagnostics(this, " GICCHzPuiAcctSiteDtailCO : end of PFR.." , 1);
    }
    }

    its printing all category values as null...

    is there any other method , that can be used...

    thanks'
    Namrata

    Edited by: 933622 on Jan 3, 2013 11:08 PM

    Edited by: 933622 on Jan 3, 2013 11:09 PM
  • 3. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    this region is a part of ArCreCusPG(main page) whose extended controller is GICCArCreCusCO
    im trying to get value in this controller by,

    public class GICCArCreCusCO extends ArCreCusCO

    {
    public GICCArCreCusCO() { }

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
    oapagecontext.writeDiagnostics(this, "GICCArCreCusCO: in ProcessRequest... ", 1);
    super.processRequest(oapagecontext,oawebbean);
    OAPageLayoutBean pgbean;
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
    OADBTransaction oadbtransaction = am.getOADBTransaction();
    HashMap hashmap = new HashMap();
    String CategoryHash = (String)hashmap.get("strCategory");

    //Passing category value to AcctOviewPG
    pgbean = (OAPageLayoutBean)oapagecontext.getPageLayoutBean();

    if(pgbean != null)
    {
    oapagecontext.writeDiagnostics(this, "GICCArCreCusCO: pagelayout bean not null ", 1);
    // finding category value

    OAMessageChoiceBean oaCategoryBean = (OAMessageChoiceBean)pgbean.findChildRecursive("AcctSiteCC");
    String strCategoryPageVal = (String)oaCategoryBean.getValue(oapagecontext);
    String categorytrVal = (String)oadbtransaction.getTransientValue("categoryTransValue");

    oapagecontext.writeDiagnostics(this, " GICCArCreCusCO: strCategoryPageVal in ProcessRequest from bean = " +strCategoryPageVal, 1);
    oapagecontext.writeDiagnostics(this, " GICCArCreCusCO: categorytrVal in ProcessRequest from from page = " +categorytrVal, 1);              
    }
    }

    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {        
    //get credit value in hashmap
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);

    oapagecontext.writeDiagnostics(this, " GICCArCreCusCO : calling super.ProcessFormRequest..******1 ", 1);
    super.processFormRequest(oapagecontext,oawebbean);
    oapagecontext.writeDiagnostics(this, " GICCArCreCusCO : super.ProcessFormRequest called..******2 ", 1);
    String strCategory = oapagecontext.getParameter("AcctSiteCC");
    HashMap hashmap = new HashMap();
    hashmap.put("strCategory",strCategory);
    oapagecontext.writeDiagnostics(this, " GICCArCreCusCO :in PFR CategoryVal got from page = "+ strCategory, 1);

    oapagecontext.writeDiagnostics(this, "GICCArCreCusCO:in PFR end...", 1);
    }

    }
    }
  • 4. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Hi Namratha ,

    3. there are 3 navigations and user can navigate to other page/tab in between ..so will it be helpful to use session variable?


    YES you can use session variables , the value of the session variable lasts as long as the session exists .

    For partial fire action , please refer the below link .

    Fire Partial Action programmatically

    I didn't understand your entire requirement , you can document along with screen shot and mail me


    Keerthi
  • 5. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi keerthi,
    thanks for your quick reply..it was helpful.....

    my business requirement is, on customer page, category dropdown is there..
    it has 3 values cash,credit and null..
    when user selects credit, 6 fields on main page(3+3 on two different regions on main page) should be mandatory..

    again when user saves all the details on main page and clicks on save, page navigates to 2nd page.
    on click of details button 3rd page reopens.
    if the category value is credit, i want to make some fields on this page as mandatory...

    pls let me know if anything is missing...


    thanks'
    Namrata
  • 6. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Namratha ,

    I will highlight the steps ,

    1) Set the fire action for the message choice bean and capture the value and put it in session variable

    pageContext.putSessionValue("sessionvariable",value); // Value to be sent

    2 ) On the other screens you can obtain the value of the session variable using ( ProcessRequest () method of the controller class )

    pageContext.getSessionValue("sessionvariable")// to get the value on another page

    3 ) Check whether the value is null or not

    if (SessionVariable != null

    {

    Obtain the bean you wish make it mandatory

    OAMessageTextInputBean eduremb=(OAMessageTextInputBean)oawebbean.findIndexedChildRecursive("BeanID");
    eduremb.setRequired(true)
    }

    Keerthi
  • 7. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi Keerthi,
    what if the user saves their details on page1 and dont navigate to 3rd page..
    and again log in's and goes to page3 through page1->page2->page3 ?

    will the category value be stored for that session...?

    before this i have tried getting values through view object attached to category,
    but when i execute VO, i need a particular primary key to get only one row...

    please suggest.

    thanks'
    Namrata
  • 8. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    i Namratha,


    Session variable will expire once you log out , I don't know what exactly you are trying tell me with the below
    statement

    before this i have tried getting values through view object attached to category,
    but when i execute VO, i need a particular primary key to get only one row...

    A document along with the screen shot would help me to understand the requirement better .

    Keerthi
  • 9. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi Keerthi,
    sorry for delay...sending screen shots to your id keerthi801@yahoo.com as i ws unable to post them here....

    by below statement what i mean is..
    since i wanted a value of another page variable on different page i though tof taking that value from tables.
    so for that i have VO attache dto that table, which stores category value as attr,but execution of that VO will refresh it and fetch many rows,
    where i want category value for exact 1 customer in one row...

    i get the value of variable used in previous session.
    e.g.say if i used credit in last session transaction1 for category, and cash in transaction2.
    while updating transaction2 i get category = credit, which is wrong..

    that is why i need some more reliable method than session variable..as it doesnt guarentees after change in navigation sequence...

    thanks'
    namrata
  • 10. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Namratha ,

    I just wen through your document .

    i get the value of variable used in previous session.
    e.g.say if i used credit in last session transaction1 for category, and cash in transaction2.
    while updating transaction2 i get category = credit, which is wrong..

    I totally agree with the above statement , you need to handle the code in such way that each time you want to pick
    the latest change and store the most recent value in session variable you need to remove the older value, in your case
    you need to remove the value stored in session variable as soon as user navigate back to the first screen .

    To reset you can use
    pageContext.putSessionValue("pgmode",null) to reset the parameters.

    To remove
    pageContext.removeSessionValue("pgmode",null) to reset the parameters.

    (both should be handled appropriately in Process request your controller class in the first page )

    Let me know if its not clear

    Keerthi
  • 11. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi keerthi,
    im getting null while putting sessionvalue in processRequest() of page1..
    java.lang.NullPointerException
    at java.util.Hashtable.put(Unknown Source)
    at oracle.apps.ar.hz.components.account.site.webui.GICCHzPuiAcctSiteDtailCO.processRequest(GICCHzPuiAcctSiteDtailCO.java:50)

    public class GICCHzPuiAcctSiteDtailCO extends HzPuiAcctSiteDtailCO

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
    super.processRequest(oapagecontext,oawebbean);
    // putting category value
    String StrCategoryVal = (String)oapagecontext.getParameter("AcctSiteCC");
    oapagecontext.putSessionValue("strCategory", StrCategoryVal); // getting null here
    }

    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {        
    super.processFormRequest(oapagecontext,oawebbean);
    String strCategory = oapagecontext.getParameter("AcctSiteCC");
    event def
    {     
    oapagecontext.putSessionValue("strCategory",strCategory);
    }
    }
    }

    in page4..

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {     
    super.processRequest(oapagecontext,oawebbean);
    String strCategory = (String)oapagecontext.getSessionValue("strCategory");
    }

    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {        
    super.processFormRequest(oapagecontext,oawebbean);
    oapagecontext.removeSessionValue("strCategory");
    }


    please suggest......


    Namrata
  • 12. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Hi ,

    Try this and let me know

    if( oapagecontext.getParameter("AcctSiteCC")!= null)
    {
    String StrCategoryVal = (String)oapagecontext.getParameter("AcctSiteCC");

    if (StrCategoryVal != null)
    {
    oapagecontext.putSessionValue("strCategory", StrCategoryVal); // Now there should not be any null pointer exception
    }

    Keerthi

    Edited by: keerthioaf on Jan 8, 2013 1:06 AM
  • 13. Re: passing value from seeded page to multiple pages
    User415813 Newbie
    Currently Being Moderated
    Hi Keerthi,

    Thanks for all your suggestions..
    facing 2 issues..

    1) I am getting value of category (ID: AcctSiteCC) from page1 to page4(region1) but not to page4(region2 , region3).all regions have different CO's

    2) also I want to make these fields nonmandatory when category!= credit.

    But getting null at for all beans,

    StrCustClassification.setRequired("no");
    strTradeLicDet.setRequired("no");
    strTradeLicExpDt.setRequired("no");
    DtEstablishmentBn.setRequired("no");
    CustStatusBn.setRequired("no");
    CustCategoryBn.setRequired("no");
    CustLegalStatusBn.setRequired("no");

    Please suggest….
  • 14. Re: passing value from seeded page to multiple pages
    keerthioaf Expert
    Currently Being Moderated
    Namrata ,

    Try to extend the root controller class , instead of sub region controller .

    Keerthi
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points