This discussion is archived
9 Replies Latest reply: Nov 15, 2012 6:17 AM by Sushant Sharma RSS

Need help understanding syntax

user12294571 Newbie
Currently Being Moderated
Hi,
I need some help to understand the following syntax .
 
PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean); 
What is this PPARAMImpl?

I know "am " is a variable . And with pageContext.getApplicationModule(webBean) we are trying to get the AM name for that page, then why do we need to add (PPARAMImpl) before pageContext.getApplicationModule(webBean) ?
 
For example in plsql , apps.testpkg.mainproc(param1,param2) 
means 
schema.packagename.procedurename(parameter1,parameter2). 

So can you explain "PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean)" in that manner? 
 
pageContext.getParameter(EVENT_PARAM)) 

What is this ? 
What are the possible values for EVENT_PARAM ? 
And by the way , I need help on setting a default value for one of my search parameters in a search region .
Correct me If I am wrong, this is what I thought
1. EOImpl has setters and getters for that attribute. So call the setter method in controller and set the value , if this is right then I don't know how to right the code ,can you give me some sample code ?
or
2. get the view object name and then set the value for that . like viewobject.setattribute('att name',att value'),if this is right then I don't know how to right the code ,can you give me some sample code ?

Thanks
Sri.
  • 1. Re: Need help understanding syntax
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    pageContext.getApplicationModule return is for generic OAApplicationModule.
    So, (PPRAMImpl) is used for type-casting the AM to type PPRAMImpl.

    EVENT_PARAM contains any event fired on a page. So, if you want to perform any operation on an event, you can simply write as:

    if("eventName".equals(pageContext.getParameter(EVENT_PARAM))){
    // logic here
    }

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 2. Re: Need help understanding syntax
    user12294571 Newbie
    Currently Being Moderated
    Sushant,
    Thank you for your quick response.

    so PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean) equal to PPRAMImpl am = pageContext.getApplicationModule(webBean) ???
    , I am asking this because , we are defining the variable "am" of type "PPRAMImpl" and then assigning the AM name to that variable .

    Thanks
    Sri.
  • 3. Re: Need help understanding syntax
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    No. These are not equal.

    pageContext.getApplicationModule(webBean) return AM of type OAApplicationModule.

    It would be fine if your variable am, is of type OAApplicationModule:
    OAApplicationModule am = pageContext.getApplicationModule(webBean) // this would be fine.

    But as you are using of type PPRAMImpl, you must have to type-cast that externally using:
    PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean);

    If you are still not clear, then refer any java book or google for internal & external type-casting in java.

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
  • 4. Re: Need help understanding syntax
    user12294571 Newbie
    Currently Being Moderated
    Sushant,
    Nw I understand the difference between those two . Your explanation is really great.

    And by the way , I need help on setting a default value for one of my search parameters in a search region .
    Correct me If I am wrong, this is what I thought
    1. EOImpl has setters and getters for that attribute. So call the setter method in controller and set the value , if this is right then I don't know how to right the code ,can you give me some sample code ?
    or
    2. get the view object name and then set the value for that . like viewobject.setattribute('att name',att value'),if this is right then I don't know how to right the code ,can you give me some sample code ?

    Thanks Sri.
  • 5. Re: Need help understanding syntax
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    First of all, if you are using search fields on page, those should not be based on EO/VO.

    You can set their default values in PR method of controller.
    Get the handle of the bean and use method like setValue on that bean.

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 6. Re: Need help understanding syntax
    user12294571 Newbie
    Currently Being Moderated
    Sushant,
    I am missing something here .
    I created a simple search page with 10 columns to display and out of those 3 has search allowed flag=true.
    Then when I run the page these 3 appeared as search fields and I can search the data based on these.
    So search fields are based on EO/VO. How can they be not based on EO/VO ?

    And when I try to print messages using System.out.println("test2"); in controller , i am not able to see them on the form . Anything I am missing ??


    Sorry to bother you with so many questions . I am really new to java and framework.

    Thanks
    Sri.
  • 7. Re: Need help understanding syntax
    user12294571 Newbie
    Currently Being Moderated
    Sushant
    Can you please help me on this ?

    Thanks Sri.
  • 8. Re: Need help understanding syntax
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    This is not the right approach.

    For search region - Create 3 separate fields not based on any EO/VO.
    Create a VO having all the columns you require.
    For result - create a table region using wizard and select the VO created above.

    In controller check for go/search button and call logic of searching in AM.

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 9. Re: Need help understanding syntax
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    Also you can have a look at this video tutorial:
    http://oracally.blogspot.in/2010/05/oracle-ebs-11icreating-simple.html

    --Sushant                                                                                                                                                                                                                                                                                       

Legend

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