How to pop up a browser window from a managed bean?

I have a user case like this:
User login our home website. He/she clicks a button. Control flow goes to a managed bean (MB here after) to check some conditions. If conditions are met, instead of sending the user back to the home page, the user will be presented a new web site (e.g. forums.oracle.com) in a popup window on top of our home site.
Can we invoke a website in a adf popup? If so, how to do that? If not, any idea on how to develop this use case?
Any idea is appreciated.

Sorry, I have updated the previous reply with the required inputs.
For convenience, putting it again;
if you need to check for some condition and then invoke the browser, you could use the following code in your managed bean for af:commandButton for Action.
import javax.faces.context.FacesContext;
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
public class TestURLPageBean {
public TestURLPageBean() {
super();
public String onClick() {
*// Check for the condition here and invoke the browser only if it is true*
if (true) {
ExtendedRenderKitService erks =
(ExtendedRenderKitService)Service.getRenderKitService(FacesContext.getCurrentInstance(),
ExtendedRenderKitService.class);
StringBuilder script = new StringBuilder();
script.append("window.open('http://www.google.com');");
erks.addScript(FacesContext.getCurrentInstance(),
script.toString());
return null;
Thanks,
Navaneeth

Similar Messages

  • How to open a new browser window from a JSP page?

    Hi,
    I am picking up records from the database and displaying each record in a seperate text area field using the JSP code. I should be able to display the content ( available in the text area) in a seperate window if the user clicks on one icon.
    Is it possible to open a new browser window using JSP? If yes, how can I write information on the new browser window?
    Thanks in advance.

    Is it possible to open a new browser window using JSP?a JSP page is also an HTML page, this is client side stuff, you can do it with JavaScript.

  • How to open a separate browser window from Captivate 2.0

    Hello Captivators,
    Thanks for a very responsive forum. I participate in an Adobe
    Flash forum as well and never get a response to any questions.
    I would like to know if I can open a new browser window in
    from a Captivate presentation, without killing the Captivate
    session.
    Thanks,
    eholz1

    You can, but without creating a custom widget in Flash, the
    user must click to make it happen.
    The easiest way is to add a button to your slide and in the
    button properties:
    On success: Open URL or file
    URL: <enter the URL to open>
    URL Window (down arrow button to the right of the URL field):
    New
    If you don't want the slide to remain paused after the user
    clicks, deselect the Continue playing project option at the bottom
    of the URL Window dropdown.

  • How to open a new browser window from a link on the navigation bar

    Hi,
    I entered a URL in the 'URL Target' field for the Navigation Bar Entry. As expected when the I clicked on the link in the Navigation Bar my browser refreshed with the target URL.
    I want to be able to actually open a new window rather than refresh my current window. The help text says, and I quote ...
    "In the link generated for this icon include the following onClick javascript. Use of the onclick javascript could popup a help page in a new window (see example 1).
    Example 1:
    window.open('US/asfhhome.htm','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');return false
    Set the Icon Target attribute to # if you are using OnClick JavaScript. Set the Image Alt Text attribute to the text the user will see to click on."
    So I created similar Javascript as to the example and placed in the 'OnClick Javascript' field, and placed a '#' in the 'URL Target' field.
    When I run it doesn't work, the '#' is picked up and the Javascript is ignored. Can somebody please tell me what I'm doing wrong.
    Thanks

    I had the same problem. I finally ended up just using the standard popupURL javascript. In the URL Target I have:
    javascript:popupURL('<link>')
    This opens a new window but since it is for popups the menus are missing. You may want to write your own javascript function to open the new window with your own settings.
    Search the forums for popupURL for more ideas.
    javascript:popupURL()
    --Jeff                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Invoke a Browser Window from any screen.

    I've added my own menu after "System Help" on all screens by adding it in MENUSYST status MEN. I want to call Function Module CALL_BROWSER to start a Browser in Windows which will provide Training information for Users. I'm doing this by using 'T' type menu entries to Call a Report Transaction to call the FM but this resets the original SAP transaction (as if you'd typed /N in the OKCODE). This is possibly becuase my calling transaction is not in a new task. I can't find a suitable Exit in SMOD as an alternative.
    How can I invoke a Browser Window from any screen (that a User might use) without resetting the calling transaction?

    A

  • How do i stop the keychain window from popping up it is really annoying?

    How do I stop the keychain window from popping up, it is really annoying?

    What is the specific message you are getting?
    If it's asking for a password, then enter it and you should be good. If you don't know the password, then I would probably recommend reseting your keychain entirely. Your keychain keeps saved password for certain websites and programs but in my expereince the average user is not tremendously affected by reseting the keychain. It's just a matter at that point of reentering your passwords manually if you've gotten used to them populating automatically.
    Check out http://support.apple.com/kb/ts1544 for an article on how to reset the keychain.

  • How can I open a new browser window from UIX?

    I need to open a new browser window from an event handler. How that can be done? HELP!
    Thanks!
    Martin Patrici

    HTML doesn't really let you do this on the server side; the client is in charge
    of creating new windows, not the server.
    If you know that clicking a certain link/button, etc. will always raise a new window,
    then you should use Javascript or "targetFrame" accordingly.
    If the decision will only be made on the server side, then you could reload the current
    window, only this time use an "onLoad" on the <body> to raise a window.

  • How do I open a new browser window from Flash

    I wish to open a new browser window from Flash and when the new window closes to return to the location from whence I started.
    ThomasChen

    The command to open a new window would be the "_blank" part of a command to link to a web page in the code below.
    navigateToURL(new URLRequest("http://www.anothersite.com", "_blank"));
    As far as the new window closing and getting back to where you were in the original window, I don't understand where that original window might have gone to... You should be wherever you last left it.

  • How do i stop the icloud window from poping up everytime i start iTunes ? i do not have an icloud account and don't want one., how do i stop the icloud window from poping up everytime i start iTunes ? i do not have an icloud account and don't want one.

    how do i stop the icloud window from poping up everytime i start iTunes ? i do not have an icloud account and don't want one., how do i stop the icloud window from poping up everytime i start iTunes ? i do not have an icloud account and don't want one.

    If you don't have an icloud account, then icloud is not the thing that's popping up a window.
    If you are being asked to enter a password when accessing itunes, then the problem may be that you have purchased items (apps, songs, etc) on the device that were purchased using a different itunes account than the one you currently have defined on your device. 
    Purchased items are forever associated with the itunes account (the apple ID) that was used to make the purchase.  If you change the ID on the device, you won't be able to update any of them.  You'll have to purchase them again.

  • How do you keep the browser heading from showing?

    How do you keep the browser heading from showing in the
    output? I did this once but can't figure out how!
    Thanks in advance,
    Rosie

    You asked...
    quote:
    Is there a way to shrink the application you're capturing so it
    fits within a given capture window rather than requiring scrolling,
    or would I have to go back to the application developers for that?
    (I realize that would shrink the size of everything on the screen,
    but in some cases, that would be worth it to be able to show a
    window without scrolling.
    If, by "shrink" ... you mean by using the AppSizer, the
    answer is "not really". You can configure AppSizer to a defined
    size, then with the mouse pointer double-arrowed on the "edge" of a
    window, right-click and your window-size selections will appear in
    the AppSizer "list" (that you set up) and can be selected there.
    But there is no re-scaling of the window contents, if that is
    what you mean, so the smaller window may now require scrolling.
    But keep in mind that if you use the recording option for
    "Software Simulation" > "Custom Size", you can then snap the
    application window to that size...

  • New browser window from uix

    How can I open a new browser window from an event handler in UIX?
    Thanks in advance,
    Martmn Patrici

    I just tried your suggestion. Unfortunately, it did not work. Here's the UIX code I used:
    <tableSelection>
    <singleSelection model="${bindings.MPOOrdersView1Iterator}" text="Select">
    <primaryClientAction>
    <firePartialAction targets="_uixState MplistsView11" source="MPOOrdersView10" event="select"/>
    </primaryClientAction>
    <contents>
    <submitButton formName="mlrhomeform" text="Print Lists" event="print" />
    <submitButton text="View Merge Reports" event="mergerpts" formName="mlrhomeform" targetFrame="_blank"/>
    </contents>
    </singleSelection>
    </tableSelection>
    The only difference from the original code is the addition of the targetFrame="_blank" in the submitButton.
    It had no effect. My redirected page showed up in the same browser window. This left me with an expired page when I press the Back button on the browser.
    My assumption is the response.sendRedirect() call wipes out the targetFrame setting.
    Does anyone know how the browser (Internet Explorer in this case) actually gets notified to open a new window? There's got to be something that the targetFrame="_blank" sets up to cause it.
    I know that Netscape supports a "Window-target:" header, but unfortunately IE doesn't. Is there some "standard" header that I can put in a response.addHeader() call that would tell all browsers to open a new window?
    Of course, a UIX solution would be preferrable!
    Any other ideas?

  • How can I keep the browser window stretched across my two displays?

    I run am trying to run dual monitor setup and have the Firefox browser span the two monitors. Whenever a Firefox dialog opens, such as Preferences or Print, the window zooms to fit the one primary monitor. How can I keep the browser window stretched across my two displays?

    Thanks very much for your response to my question -very helpful.
    Do you have any recommendations for a good book on Edge Animate?
    Thanks,
    Shaun
    Date: Thu, 25 Oct 2012 17:10:43 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I change the browser window background color when playing an Edge animation?
        Re: How can I change the browser window background color when playing an Edge animation?
        created by heathrowe in Edge Animate - View the full discussion
    ADD this to compositionReady handler, change the hex color code to your desired color //Force body of webpage to a specific color$("body").css("background-color","#5d5e61"); Darrell
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4801409#4801409
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4801409#4801409
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4801409#4801409. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Edge Animate by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How i can open a browser windows using a button in jsf ?

    Hi
    Thank you for reading my post
    how i can open a browser windows using a button in jsf ?
    for example if i want to open a window which will show http://www.mywebsite.com?name=TestName&family=TestFamily
    and before opening the window i need to set those two variables.
    can some one help me with a solution ?
    thank you

    Hi Legolas,
    Please refer to the answer provided by Chris in the EA forums.
    Cheers
    Giri

  • How do I get the browser windows at the top to come back

    how do i get thge browser windows at the top to come back

    How to get all the iWork apps, iPhoto, and iMovie for free on an eligible iPhone or iPad
    http://www.imore.com/how-get-all-iwork-apps-iphoto-and-imovie-free-eligible-ipho ne-or-ipad
     Cheers, Tom

Maybe you are looking for

  • How to create a Web ADI template and save it in our apps?

    Hi all, I want to create a user enrollment template it Web ADI so that I can send the form to the client and they will just fillup the spreadsheet with all the users they want to add to the system then load it using Web Adi. For example this form is:

  • Automating a print workflow

    Hello, I have been trying to use automator to create a print workflow. About 20 times a day I send a new document to a combined fax/printer to fax to another associate at a remote location. I use the same printer, select send print from the tool bar,

  • Reg: Selectively Commenting Script Logic

    Dear Experts, I have a situation where in the Default Logic file comprises of Allocation Logic and Currency Translation Logic, and it works fine. But for just one of my reports I have created an Data manager package for Allocation as it uses a differ

  • Sd n mm

    what is the link between SD and MM?is there any table or any field?

  • New to HR

    Hi all, Am a BI Consultant and i am intersted for SAP-HR so please guide me how it will. Let me have some links reagarding study materail and scope in HR. Ur help will be rewarded. Regards Ashwin