This discussion is archived
1 2 Previous Next 22 Replies Latest reply: May 9, 2012 6:22 AM by 599202 RSS

How to catch a event by button personalization

601073 Newbie
Currently Being Moderated
Hi,

I added a button in a standard page by Personalization. On click of button, I need to do some validations.
As this is not a “Submit Button”, I cannot get the event in processFormRequest.
So I need to define a event by setting “Action Type” as “Fire Partial Action”.
But in Personalization structure where I added a button, this option of defining a event is not there.

So what is the procedure to fire a event through button in case of personalization?

Please help. Thanks in advance.
  • 1. Re: How to catch a event by button personalization
    TapashRay Newbie
    Currently Being Moderated
    why cannot you add a submit button ?
    Thanks
    Tapash
  • 2. Re: How to catch a event by button personalization
    557833 Explorer
    Currently Being Moderated
    As tapash said, why don't you use the Submit button. After all, you want to submit the page, right? or is there some different scenario?

    --Shiv                                                                                                                                                                                                                                                                                                   
  • 3. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    by personalization, there is no option to create a Submit button.
    thats why i created a item with button style.
    im doing personalization in a seeded page
  • 4. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    on click of button, i need to do some validations by calling a package. to do this i extended the seeded controller.
    but i have no clue how to catch the event in process form request as i cant able to create a Submit button through personalizations.

    Thanks,
    Girish
  • 5. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    hi
    Any pointers how to do this?

    thanks,
    Girish
  • 6. Re: How to catch a event by button personalization
    TapashRay Newbie
    Currently Being Moderated
    I have to admit, I never gave this a thought, but this can be a very common requirement.
    As a workaround I can suggest this.

    1. Create the button
    2. Have the Destination URL set to a new OAF page
    3. In the PR of the new page, do the validation and redirect back to the page where you created the button.
    or
    In the PR of the new page, just redirect to the page where you created the button and in PR of the page do your validation.

    very crude solution I know, but cannot think of anything else.

    Thanks
    Tapash
  • 7. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    Thanks Tapash, I will try this.
  • 8. Re: How to catch a event by button personalization
    555256 Journeyer
    Currently Being Moderated
    Tapash,
    This can be achieved by a little use of javascript :).Basically, set destination url of the item button as:
    javascript:submitForm('DefaultFormName',1,{'XXX':'abc'});

    Now, you can catch this event in process form request as

    if((("abc").equals(pageContext.getParameter("XXX"))))
    {
    ///LOGIC
    }
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 9. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    Hi Mukul,
    what has to be given for ''DefaultFormName'' in the command
    javascript:submitForm('DefaultFormName',1,{'XXX':'abc'});

    i have tried with the same command.i created a new project and a page and i created only 1 button inside it.
    i have given a message in process form request inside if((("abc").equals(pageContext.getParameter("XXX")))).
    it is giving message in log and it is giving me the following error.

    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidObjNameException: JBO-25005: Object name for type View Object is invalid.

    also see the log
    JRAD_PERF : /xxx/oracle/apps/xxcc/cc/webui/DownloadPG - processRequest : 235ms

    JRAD_PERF : /xxx/oracle/apps/xxcc/cc/webui/DownloadPG - preparePage : 453ms

    JRAD_PERF : /xxx/oracle/apps/xxcc/cc/webui/DownloadPG - renderDocument : 31ms

    ----------after button click-------------------------

    got it ----this is message i given

    JRAD_PERF : /xxx/oracle/apps/xxcc/cc/webui/DownloadPG - preparePage : 47ms

    JRAD_PERF : /xxx/oracle/apps/xxcc/cc/webui/DownloadPG - renderDocument : 47ms

    Thanks,
    Girish
  • 10. Re: How to catch a event by button personalization
    555256 Journeyer
    Currently Being Moderated
    Girish,
    This is basically javascript function to submit page.I have used it many times, haven't faced any problem.
    Your problem, seems to be irrevelant of this.Just in your new page remove this javascript function and then run with submit button, still you should get the same error, essentially your error says " Object name for type View Object is invalid." which has nothing to do with javascript function.
    You don't have to enter anything for defaultformname, just keep it as it is. This function will just submit the page with parametre XXX value as "abc".Also remember attach this function only to item of "button" type and not "submit button" type.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 11. Re: How to catch a event by button personalization
    555256 Journeyer
    Currently Being Moderated
    Girish,
    If you are not clear of javascript solution you can create submit button programtically , extend the controller and then write your logic.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                       
  • 12. Re: How to catch a event by button personalization
    601073 Newbie
    Currently Being Moderated
    Hi Mukul,
    javascript solution is working.previously its mistake on my side.
    thanks for the solution.
  • 13. Re: How to catch a event by button personalization
    555256 Journeyer
    Currently Being Moderated
    Girish,
    Thats kewl, anyways your error suggested that its not coming from javascript function.
    --Mukul                                                                                                                                                                                                                                                                                                               
  • 14. Re: How to catch a event by button personalization
    TapashRay Newbie
    Currently Being Moderated
    Mukul, of course js is a solution, I really do not prefer using js in any code that I write, so was suggesting the standard way of doing it, but your solution is good, just the js part :-) .
    Thanks
    Tapash
1 2 Previous Next