1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

OAF Page Personalization for Prompt

Discussion in 'JAVA, SOA and Application Development' started by Bharat, Dec 8, 2012.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi all,

    Is it possible to get prompt message when we click on button on OAF Page through personalization or customization.
     
  2. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi Bharat,

    Yupp !! its possible through OADialogPage ..
     
  3. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi Ari,

    Can you please provide some more info on it. Like where should we need to write that or what we need to do for that?
     
  4. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi Bharat,

    Yeah !! Y not? :) But i need to know ur scenario n ur requirement. We usually use it in the page controller. Its pretty much similar to fnd_message.question in d2k forms.

    The difference is that, here after the dialogPage is submitted it returns to the base page where we need to capture the event of the dialogPage in the PR method of the base page controller.

    *I could be a li'l more descriptive if u explain me the scenario ..
     
  5. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi Ari,

    Thanks for your reply.

    Actual scenario : -
    we have one page called create time cards in Self Service Time Responsibility. So in this we ever user enters less than 40 hrs per week then we need to display one message box saying that you have entered less than 40 hrs.

    This is the scenario, Can you please help on this.
     
  6. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi Bharat,

    I got ur scenario pretty much. Just 1 confirmation .. Do you just need to display this message or u wanna have some decision from the user regarding this? For e.g: "Do you want to proceed?" with "Yes/No" buttons, kind of stuff?

    If u just wanna display the message which won't "pause" the execution process... then i would suggest u to use OAException.INFORMATION or WARNING rather than dialogPage.
     
  7. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Yes Ari, Just we need to place Yes/No buttons or OK button on that message box.
     
  8. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi Bharat,

    The Yes/No and Ok are two different type of input junctions. I believe prompting a message with Ok button is much similar to just showing a message, coz it doesn't diverts your program flow rather just pauses it or holds it for a while. Whereas Yes/No buttons are a decision point where the program diverts according to the user input. So these r completely different logics.

    Anywayz, try the following .. i believe it'll work.

    Customize this piece of code according to your need in PFR.
    Code (Java):

    OAException Message = new OAException("Do you want to proceed?");
    OADialogPage dialogPage = new  OADialogPage(OAException.INFORMATION,Message,null,"","");
    dialogPage.setOkButtonItemName("YesButton");
    dialogPage.setNoButtonItemName("NoButton");
    dialogPage.setOkButtonToPost(true);
    dialogPage.setNoButtonToPost(true);
    dialogPage.setPostToCallingPage(true);
    pageContext.redirectToDialogPage(dialogPage);
     
    And then, capture the controlling event of the user input from PR.
    Code (Java):

    if (pageContext.getParameter("YesButton") != null)
    {                    
      //do something
    }  
    if (pageContext.getParameter("NoButton") != null)
    {                    
      //do something
    }
     
    I hope this would help u to some extent. :)
     
  9. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi Ari,

    Thanks for the logic. Can you please provide same kind of logic for OK Button how to write. It may helps me to reduce the customization of the page.
     
  10. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi Bharat,

    That's very simple, just do the following..
    dialogPage.setNoButtonToPost(false);
    instead of
    dialogPage.setNoButtonToPost(true);
     
  11. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Thanks a ton Ari.. Will update status here soon.
     
  12. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hey u forum guru!! there's another way to say thanks in this forum .. ;) :p
     
    Bharat likes this.