Perform different actions on click of popup buttons

Hi,
I am Using <af:popup id=""><af:dialog type="okCancel" title=""> combination pop up.
I want to navigate to different pages, say "one.jspx" and "two.jspx" when i click on 'OK' and 'cancel' buttons.
can any one help on this please...
Regards
Syamala.

Hi,
........ I use JDeveloper 11g .........
You can use type YesNo in dialog and in DialogListener write a method in backing bean :
public void dialogListener(DialogEvent dialogEvent) {
if(dialogEvent.getOutcome().toString().equals("yes")){
// Yes action
}else{
// No Action
in OkCancel dialog will execute the method only if you press ok
for navigate to page you can use
HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
HttpServletRequest request = (HttpServletRequest)ectx.getRequest();
try this code:
public void dialogListener(DialogEvent dialogEvent) {
ExternalContext ectx =
FacesContext.getCurrentInstance().getExternalContext();
HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
HttpServletRequest request = (HttpServletRequest)ectx.getRequest();
if (dialogEvent.getOutcome().toString().equals("yes")) {
System.out.println("yes action");
RequestDispatcher rd =
request.getRequestDispatcher("/untitled2.jspx");
try {
rd.forward(request, response);
} catch (ServletException e) {
} catch (IOException e) {
} else {
System.out.println("no action");
RequestDispatcher rd =
request.getRequestDispatcher("/untitled3.jspx");
try {
rd.forward(request, response);
} catch (ServletException e) {
} catch (IOException e) {
I hope it can work with you ...
Sameh

Similar Messages

  • Clickable Images with different sections of image perform different actions

    Hi All,
    I am trying to achieve an image where different parts of the image perform different functions.
    For ex. pls refer link : http://www.zoho.com/crm/images/account-management.jpg
    Say I need an image like this where it performs different actions when we click 'Quick create' , 'Manual Filling'
    etc. Can we achieve this in ADF ?
    Thanks

    The good old html image map ...
    I guess you have to set the imageMapType property of af:image to server. Read the component help and http://programming.itags.org/development-tools/6258/ might help
    Timo

  • Calling an action on Click of Radio Button

    Hi,
    We have a form in which we need to display two radio buttons and two dropdown lists. Depending on the selection of Radio Button the drop down list should change.
    To get the different data in the dropdown based on the selection of radio button, what would be the best method?

    a.If the data is fairly static and little, then you could get it all at once and use standard javascript (or a toolkit like jquery)
    b. If the data is potentially large, then you could use javascript + ajax + dhtml using a toolkit like jquery
    c. If you cant use javascript , then you would have to first change the UI to have a submit button , then its like any other pageflow action.
    what would be the best methodDepends on what attributes you wish to measure best , development time, accessibility, response times etc.
    regards
    deepak

  • Is there a way to change the default action for clicking a "Print" button on a website to open Print Preview instead of the default system printer?

    When I am at a website that contains a button for printing (Gmail, for example), is there a way to change the way that functions, so that when I click "Print", Firefox will open Print Preview instead of taking me to the default system printer?

    You can apply  system-wise "negative" color effect under Settings > General > Accessibility, by toggling the White and Black switch - and, in iCab Mobile (and some other, better browsers / PDF readers), its own "night mode" negative color scheme.
    Otherwise, no, you can't do anything else except for asking third party app authors to add selectable back/froeground (=text) colors to their apps.
    There is an article dedicated to this question: http://www.iphonelife.com/blog/87/do-you-find-your-idevices-screen-be-too-blueis h-or-just-too-harsh-bedtime-reading

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • How to perform action when clicking button of NSAlertSHEET

    How can I perform an action when people click on "Update"?
    NSAlert *alertSheet = [NSAlert alertWithMessageText:@"New update available"defaultButton:@"Update"alternateButton:@"Remenind me later" otherButton:nil informativeTextWithFormat:@"There is a new update available."];
        [alertSheet beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil];
    I tried this:
    (but this doesn't work)
    NSAlert *alertSheet = [NSAlert alertWithMessageText:@"New update available"defaultButton:@"Update"alternateButton:@"Remenind me later" otherButton:nil informativeTextWithFormat:@"There is a new update available."];
        [alertSheet beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil];
    if ([alertSheet runModal] == NSAlertFirstButtonReturn){

    Your first step is wrong.
    yourInternalFrame.addInternalFrameListener(
         new InternalFrameAdapter(){
      public void internalFrameClosing(InternalFrameEvent e){
        // do part
    });

  • Setting different action urls to different buttons

    Hello everyone
    I have 2 buttons on my jsp page, 'submit' and 'reset'. I need to link each button to different urls when user clicks on it. For example, when user clicks on submit button, it should go to confirmation.jsp and when the user clicks on reset button, it should go to registration.jsp. I dont want to use javascript or any other programming language but rely only on jsp and html. Is there a way to do it? Thanks. I need to solve this for an assignment. Much appreciated.
    Bawa

    hope you use struts, put these action mapping in the struts-config file.
    Call submitaction.do in 'submit' button click.
    and call resetAction in 'reset' button click. You action class will forward the page.
           <action path="/submitAction"
                type="com.admin.manage.action.SubmitAction"
                name="manageForm"
                scope="request">
         <forward name="success" path="/jsp/confirmation.jsp" />     
           </action>                                       
           <action path="/resetAction"
                type="com.admin.manage.action.ResetAction"
                name="manageForm"
                scope="request">
         <forward name="error" path="/jsp/registration.jsp" />          
           </action>  If you don't use struts, call corressponding jsp's in each button click directly.

  • Can I associate a right-click action w/ a text entry button?

    Is there a way to associate a right-click action with a text
    entry button? I tried to do a shift-F10 (windows equivalent) but it
    wasn't recognized. I suspect it is not possible, but thought I
    would ask.

    Ahhhh, the fog is lifting now!
    Thanks for fleshing that out a bit. There are a few different
    ways to handle right-click in Captivate. See the links below for
    more.
    Adobe
    Developer Center Article 1
    Adobe
    Developer Center Article 2
    Paul
    Dewhurst's Right-Click widget
    Hopefully something there will help... Rick

  • How to close main window on click of a button on popup window

    Hi All,
    I have created a web page which on certain condition display a popup window to to provide information. Wht i want is that when i click on close button on my popup window, my main window should also close.
    Can anyone please help with this requierment!!!
    Regards,
    tushar

    Hi All,
    Could anyone of you please help me by answering the thread
    WDDOEXIT method not called when the application is closed from the portal
    Thanks,
    Subash M

  • Print button should not perform its action in  report previewer

    Hi all,
    Report version 6i
    I am invoking a report from a form , the form has one status field ,the value can be NEW,APPROVED,CANCEL
    i just want take the print of the report if the status is approved , in all other cases the print button should be perform its action.
    that is , when user tries to print the report , its function should not happen.
    Please Guide.
    Thanks
    :8}
    Edited by: elegant on Jul 13, 2010 12:49 PM

    ADD_PARAMETER(param_list,'DISABLEPRINT','YES');
    ADD_PARAMETER(param_list,'DISABLEMAIL','YES');
    if you want to enable it give
    ADD_PARAMETER(param_list,'ENABLEPRINT','YES');
    ADD_PARAMETER(param_list,'ENABLEMAIL','YES');

  • How can I get one Submit button to perform three actions?

    I have a 2-page form. One page is completed by an HR person, entering fields that describe a new role, new pay, new hours or a new location for an existing employee. The second page automatically repeats the name, location and job role fields, but also completes the IT requirements linked to the job role (such as whether or not the role needs access to a particular piece of software or not).
    The users of the form will have varying degress of IT capability. I wan to enable them to press a single Submit button that does three things: first, print the first page of a two-page form AND e-mail the same page to one e-mail address. Second: e-mail the second page only to a DIFFERENT e-mail address.
    I am not a Javascript expert - or even a beginner. Can anyone help? I need to get this ready for Tuesday! Thanks in advance

    You will need two buttons on your form to be able to do this.
    One is the actual submit button (this will interact with th email system and do the submit). Note that you cannot write programs on a submit button. You will need to make this button invisible to the user. The second button will be a regular button which you can write programs on. Use teh click event of that button. This one will have logic to accomplish the things that you want ...here is some pseudo code to do this:
    use print command and one of the parms indicates which pages to print.
    Set up the submit button to hold the email address of the person recieving it.
    Programmatically click the hidden submit button.
    Note that the user will recieve a dialog from the mail client to OK before teh form will be sent.
    Set up the submit button to change the email address
    Programmatically click the submit button again
    User will recieve another dialog to OK the email submission
    Also you cannot email part of the form it will have to be the whole form. You coudl get a little more sophisticated and hide parts of the form but the whole form will be sent with the emails. This will need more programming on your part.
    Paul

  • How to show Popup window in OAF on click of a button

    How to show Popup window in OAF on click of a button (Without using Javascript)
    1. I have one OAF page on which i should have button Called "Next"
    2. On clicking of this button a new window/page should be displayed with the image stored in database. on clicking on this "Next" button again next image from the database should be displayed on the newly opened window/page.
    3. Is it possible to configure OAF to render window_II in the opposite screen of window_I where the OAF client resides? (If the OAF-client resides in screen_I render window with image in screen_II). That is, at the first click on the Next-button, window_II appers on screen_II and not some random location. The user will have 2 screen/monitors on his work place.
    4. Given that the two windows reside on each screen, is it possible to make OAF remember the position of window_II ? The goal of this is to force the window to pop up on the same location on the same screen next time the Next-button is pressed.
    5. If window_II is closed (eg. by using X) and the Next-button in window_I is pressed again, will window_II pop up in the same location and screen as previously ?
    6. Is it possible to have a Print-button in window_I what prints the scanned picture in window_II ? Is it possible to have the click on this Print-button to open the standard print dialog on top of window_II ? Could the button be placed in window_II as well, having the same functionality ?

    I have tried to open home page window. You can change the URL according to your requirement.
    import oracle.apps.fnd.framework.webui.OAUrl;
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE"; // Calling Oracle Home Page
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:750, height:550},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    Above code will open the new page in new window.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HT1386 It says to click the device button in the upper right corner....there isn't one.  Itunes doesn't even recognize my devices since I did the most current update.  I have two iPhones, thru different carriers, and neither one works now!

    I did the latest iTunes update...I have 2 iPhones--each thru a different provider.  Now, I can't sync to download any music from iTunes.  iTunes doesn't recognize either device now.  I went thru diagnostics, didn't work.  I tried the suggestions from Apple...it says to click the device button in upper right corner....there isn't one.  When I connected each for the first time after update, it "installed device drivers".  I have checked for further updates on iTunes--nothing.  I made sure there were no updates listed for iPhones...all up to date.  I get an error code and from what I have looked through in forums etc, it seems like a lot of people are getting it...0ex000084 I believe it was.  Windows opens to download photos but that's it.  Devices are not listed at all.  I have tried all 3 USB ports in computer too.  I have never had any problems before this update!!  HELP!  I just bought $15 worth of music I can't download to phones now!

    On the left hand side of iTunes do you have the sidebar up left hand side?
    If this is not up then try this, with iTunes open press "Control" and "s" together and it should bring it up. From the sidebar it should show an option devices with the iPhones underneath it.

  • How to close the detach popup on click of a button in the panel collection

    Hi,
    I'm using Jdeveloper 11.1.2.3.0.
    I have an af table surrounded by panel collection. There is a button on panel collection to commit the changes in the table.
    Clicked detach button to view the table in full browser.
    On click of Commit button, the detach popup is not closed. I have set partialSubmit of that button to false. Then also detach popup is not closed.
    Can anybody suggest me how to close the detach popup on click of a button in the toolbar.
    Thanks,
    Vinod

    Hi Frank,
    Thanks for your response. Popup is not closed.
    I tried this approach, when the view tree is navigated on the Detach, I see that the tree is same as if it is traversed on the page without detach.
    Printed client id and UI component class in the while loop, result is as below.
    r1:0:pc1:t3 class oracle.adf.view.rich.component.rich.layout.RichToolbar
    r1:0:pc1 class oracle.adf.view.rich.component.rich.output.RichPanelCollection
    r1:0:ph2 class oracle.adf.view.rich.component.rich.layout.RichPanelHeader
    r1:0:pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    r1 class oracle.adf.view.rich.component.rich.fragment.RichRegion
    pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    db2 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    db1 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    psl1 class oracle.adf.view.rich.component.rich.layout.RichPanelStretchLayout
    ps1 class oracle.adf.view.rich.component.rich.layout.RichPanelSplitter
    f1 class oracle.adf.view.rich.component.rich.RichForm
    Tried with setting partialsubmit property to false on the command button, still the popup is not closed and my Faces Message are shown behind the detach popup.
    Thanks,
    Vinod

  • Doubt in Opening a OA page as a popup from OA page on click of a button

    Hi All,
    I need a help.
    I have a OApage,
    from the OA page i want to open one more OA page as an popup on click of a button, So a took the button as normal button not a submit button
    So in the buttons Destination URI property I have set the property as
    javascript:window.open('OA.jsp?page=/oracle/apps/misibe/cust/webui/MisibePOPCreateCustomerPG&retainAM=Y', 'a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no'); a.focus();
    So when I am clicking the button on the base page to open the pop up I am getting the following error:
    You have insufficient privileges for the current operation. Please contact your System Administrator.
    You cannot run a page which is not SelfSecured when the MAC fails.
    Can you please help in this.
    Regards!
    Smarajeet

    Hi, not sure if this is still relevant to you Lakshman; if not it can perhaps help someone else.
    I solved this by copying the JavaScript
    function addrSearchDialog(fieldId,searchStr,multiSelect)
    from the include CRM_EMAIL_ADDRESS_INPUT into the .htm of the mail component, changing its name to addrSearchDialogZZZ and telling the 'To', 'CC' and 'BCC' buttons to execute addrSearchDialogZZZ onClientClick instead of addrSearchDialog.
    In my function, addrSearchDialogZZZ, I simply told the select option for Exchange Addresses to be selected:
    I changed the line
    '<option value=\"OUTLOOKGALID\" id=\"OUTLOOKGALID\">'
    to
    '<option selected value=\"OUTLOOKGALID\" id=\"OUTLOOKGALID\">'
    I hope this helps,
    Patrick.

Maybe you are looking for