This discussion is archived
13 Replies Latest reply: Nov 19, 2012 12:05 AM by Gyan Darpan RSS

Dependent Poplist on a Standard Page

973049 Newbie
Currently Being Moderated
Hi,

I have the following requirement.

**Existing Function:**

In Standard Page, there are say 4 filters, and a clear and go button. So we put some values on those filter fields, and hit Go. So the TableRN shows the relevant data.

Expectation:_

Add a fifth filter, which will be a dependent poplist of another field. In Short, we will have a 5th field. select a value. Based on that a 6th poplist field will be populated. The value of that 6th field will go the TAbleVO.

My plan:_

1. Create 2 PVO ( for 2 new poplist fields) and a custom AM to retain it.
2. Create 2 message choice using personalization and pass, the PVO values (attributes/instance etc) created in the above step.

Now the problem is , I need a fireaction on the 1st poplist to trigger the 2nd one. If I was creating a page from scratch, it was not an issue but
1.poplist does not have a fireaction of it's own like lov
2. Using personalization we cannot attach a fireaction to a field.

Question:_
So to attach the fireaction to the new poplist1, shall I create the fireaction in the PR of the controller? If I can do that, will that get attached to an item which is created out of personalization?

Any suggestion or blogs with similar requirement will help. I need a case where it is to be attached to an existing page not creating from scratch.

Thanks
  • 1. Re: Dependent Poplist on a Standard Page
    keerthioaf Expert
    Currently Being Moderated
    Hi ,

    Please refer these links ,

    OAF: LOV and Dependant poplist(based on LOV input)???

    How to set the fire Action For LOV

    For programmatic PPR :

    https://kr.forums.oracle.com/forums/thread.jspa?threadID=1125992

    Keerthi
  • 2. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Hi,

    Thanks for the prompt reply.

    I have gone through the notes, but in my case both the fields are poplist. If it was a LOV , I am sure it would trigger a fireaction on it's own. But since this is a poplist, I am not sure.

    From the 3rd link, it shows how to attach a fireaction on a field. Do you mean, that is the way to attach a fireaction to an item created through personalization.

    Thanks
  • 3. Re: Dependent Poplist on a Standard Page
    Gyan Darpan Guru
    Currently Being Moderated
    HI,

    This page must be based on Query Region.

    If the Query Region is of Type Auto Customization Criteria then you can easily add the 3rd and 4th parameter but if its of type Result Based search then its not possible.

    Check with the page.xml file about this. Will guide you once u will share the same.

    Note - You can attach a event to poplist bean. Refere Jdev Guide.
    Regards,
    Gyan
  • 4. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Thanks Gyan.

    Yes it is a queryRN.

    What I did is :

    Created 2 poplist on the page. Created 2 VOs and attached to the poplist and in the PR of the CO attaching the VOs to the AM. Till here it works fine.

    I am trying to attach a firection on poplist1, so that based on the value of POP1 I will change the VO of the Pop2. It is not working. The fireaction is somehow not getting created:

    public void processRequest (OAPageContext pageContext, OAWebBean webBean)
    {

    // Attaching an event to the first Message Choice

    OAMessageChoiceBean msgchc1 = (OAMessageChoiceBean)webBean.findChildRecursive("xxtorexptemplate"); -- Have printed this bean. It is comeing correct.
    FireAction uNameAction = new FireAction("tempEvent");
    msgchc1.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,uNameAction);

    pageContext.writeDiagnostics(this,"PR: Created fire-action is:"+uNameAction,3);

    super.processRequest (pageContext,webBean); -- Tried it after PR also.

    neither the page refreshes after I select a value from Pop1, nor the action is identified in PFR. In fact PFR is not called at all.
  • 5. Re: Dependent Poplist on a Standard Page
    aravindan.v Newbie
    Currently Being Moderated
    Hi,

    Could you try using the "setFireActionForSubmit" method on the bean?

    I had made use of this method in such a scenario and I was able to capture the event.

    -Aravindan
  • 6. Re: Dependent Poplist on a Standard Page
    Gyan Darpan Guru
    Currently Being Moderated
    Hi,

    Make use of below code

    OAMessageChoiceBean segment1 = (OAMessageChoiceBean)dffBean.findChildRecursive("xxtorexptemplate");//put some sop to check whether segment1 is returning null.
    segment1.setFireActionForSubmit ("tempEvent",null, null,true, true);

    Regards,
    Gyan
  • 7. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Hi Gyan,

    Even this doesn't work.

    i used the below code:_

    OAMessageChoiceBean msgchc1 = (OAMessageChoiceBean)webBean.findChildRecursive("xxtorexptemplate");
    pageContext.writeDiagnostics(this,"PR: Msg Choice Bean is:"+msgchc1,3);
    FireAction uNameAction = new FireAction("tempEvent");
    //msgchc1.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,uNameAction);
    msgchc1.setFireActionForSubmit ("tempEvent",null, null,true, true);

    IN the page diagnostics I get :_

    PR:_ Msg Choice Bean is:OAMessageChoiceBean, localName='messageRadioGroup'

    But When I print the fireaction:

    Code:_
    String flaction = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
    pageContext.writeDiagnostics(this, "PFR:Inside PR. Fire Action initiated:"+flaction, 2);


    SOP:_ PFR:Inside PR. Fire Action initiated:null

    I have tried both in PR and PFR. For both it is null. I have earlier attached a fireaction to a standard poplist, it was working. probably for an item created by poplist is giving this issue.
  • 8. Re: Dependent Poplist on a Standard Page
    SumitSharma Expert
    Currently Being Moderated
    Selecting a value from a poplist is a form submit action. You can try catching the same and do the needful in controller. Please check and let me know if this works.
  • 9. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Hi Sumit,

    I tried it. But it is not working. The code is given below. If you find, I am missing somthing pls let me know.

    In PR initiating the fireaction:_

    OAMessageChoiceBean msgchc1 = (OAMessageChoiceBean)webBean.findChildRecursive("xxtorexptemplate");
    pageContext.writeDiagnostics(this,"PR: Msg Choice Bean is:"+msgchc1,3);
    FireAction uNameAction = new FireAction("tempEvent");
    //msgchc1.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,uNameAction);
    msgchc1.setFireActionForSubmit ("tempEvent",null, null,true, true);

    IN the page diagnostics I get :_

    PR: Msg Choice Bean is:OAMessageChoiceBean, localName='messageRadioGroup'

    But When I print the fireaction ( tried both in PR and PFR), It returns null._ :

    Code:
    String flaction = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
    pageContext.writeDiagnostics(this, "PFR:Inside PR. Fire Action initiated:"+flaction, 2)

    The above diagnostics returns null.

    It means the fireaction is created, but not working when I am selecting a value from the poplist.
  • 10. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Hi,

    Any pointers on this??

    I tried the below approach.. Still not working:

    public void processRequest (OAPageContext pageContext, OAWebBean webBean)
    {
    super.processRequest (pageContext,webBean);

    // Attaching an event to the first Message Choice

    OAMessageChoiceBean msgchc1 = (OAMessageChoiceBean)webBean.findChildRecursive("xxtorexptemplate");
    pageContext.writeDiagnostics(this,"PR: Msg Choice Bean is:"+msgchc1,3);
    msgchc1.setFireActionForSubmit ("tempEvent",null, null,true, true);


    public void processFormRequest(OAPageContext paramOAPageContext,
    OAWebBean paramOAWebBean)
    {
    super.processFormRequest(paramOAPageContext, paramOAWebBean);
    paramOAPageContext.writeDiagnostics(this, "PFR::Entering PFR:", 2);

    if ("tempEvent".equals(paramOAPageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    {
    paramOAPageContext.writeDiagnostics(this, "PFR: The event is triggered",3);
    }

    But the PFR itself is not triggered, when I select a value from teh poplist.
  • 11. Re: Dependent Poplist on a Standard Page
    Gyan Darpan Guru
    Currently Being Moderated
    Hi,

    Modify your PFR code to below one.
    public void processFormRequest(OAPageContext paramOAPageContext, 
    OAWebBean paramOAWebBean)
    {
    
    paramOAPageContext.writeDiagnostics(this, "PFR::Entering PFR:", 2); 
    if ("tempEvent".equals(paramOAPageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) 
    {
    paramOAPageContext.writeDiagnostics(this, "PFR: The event is triggered",3);
    }
    super.processFormRequest(paramOAPageContext, paramOAWebBean);//moved super call to last.
    Regards,
    Gyan
  • 12. Re: Dependent Poplist on a Standard Page
    973049 Newbie
    Currently Being Moderated
    Thanks Gyan.

    But it din't work even after making those changes.
  • 13. Re: Dependent Poplist on a Standard Page
    Gyan Darpan Guru
    Currently Being Moderated
    Hi,

    Send me a test mail at gyan.ebs@gmail.com

    Regards,
    Gyan

Legend

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