Open a Popup with commnadButtom

Hello,
can I open a Popup with a commnadButton? Und Load in the Popup a PDF`?
I can open a PDF but only in self window :-(
Thanks for help
   public String doActionShowPreview() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse();         
        response.setContentType("application/pdf");
        response.setHeader ("Content-disposition", "inline");
        response.setHeader("Expires:"," Wednesday, 27-Dec-95 05:29:10 GMT");
        response.setHeader("Pragma:"," no-cache");
        Documents previewDoc = getEditDocument();
        List tagListForCreator = new ArrayList();
        Set tagList = previewDoc.getText();
        Iterator iter = tagList.iterator();
        while(iter.hasNext()) {
            DocumentText docText = (DocumentText)iter.next();
            XMLParserTagInfo info = new XMLParserTagInfo(docText.getTag(),docText.getText());
            tagListForCreator.add(info);
        Collections.sort(tagListForCreator);
       XMLInDesignCreator xmlCreator = new XMLInDesignCreator();
       xmlCreator.createXML(tagListForCreator,previewDoc.getDocName(),previewDoc.getDocName());
    File file = new File("C:\\tm\\preview\\"+ previewDoc.getDocName()+".pdf");
   //convert the file content into a byte array
   FileInputStream fileInuptStream = null;
   try {
       fileInuptStream = new FileInputStream(file);
   } catch (FileNotFoundException ex1) {
   BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInuptStream);
   ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
   int start = 0;
   int length = 1024;
   int offset = -1;
   byte[] buffer = new byte[length];
   try {
       while ((offset = bufferedInputStream.read(buffer, start, length)) != -1) {
           byteArrayOutputStream.write(buffer, start, offset);
   } catch (IOException ex2) {
       ex2.printStackTrace();
    try {
        bufferedInputStream.close();
        byteArrayOutputStream.flush();
        buffer = byteArrayOutputStream.toByteArray();
        byteArrayOutputStream.close();
    } catch (IOException ex3) {
        ex3.printStackTrace();
    response.setContentType("application/pdf");
    response.setHeader ("Content-disposition", "inline");
    response.setHeader("Expires:"," Wednesday, 27-Dec-95 05:29:10 GMT");
    response.setHeader("Pragma:"," no-cache");
    try {
        response.getOutputStream().write(buffer);
        response.getOutputStream().flush();
    } catch (IOException ex4) {
        ex4.printStackTrace();
    return "";
    }

Do the following
1) window.open('somePath/YOUR_JSF_PAGE .jsf') in your javascript code.
2) Invoke doActionShowPreview() method in the constructor of your BackingBean.
Hope this helps.
Karthik

Similar Messages

  • How to open the popup with in Tab navigator  working area.

    Hi,
              I using the customized  panel to open it as popup by using  popup manager in the Tab navigator . The popup should be able to  move with in the tab navigator's  content area. Not outside of the tab navigator's  content area. How to do this? .What is the difference between opening the popup by using popup  manager and add children(); which one is best?
    Regards,
    Thiru

    It depends on your purpose. A popup displays information to the user, and it might be modal if the user should repsond to the popup before continuing, but why constrain it's movement to the space occupied by the TabNavigator.
    You could, in theory, check the x and y properties of the popup position, and then compare those with the x and y of the TabNavigator view area, though you might have to do some conversion between global and local coordinates.
    You might want to consider your design. Is a popup necessary? Perhaps not. If so, maybe do not consider constraining its movement as you have indicated.
    If this post answers your question or helps, please mark it as such.

  • Open LOV popup with a button click or image link click

    hi , a try the solution:
    11g: How to populate LOV from button click
    for open pòpup of lov , but don't works :
    first the others components block the submit of button
    i put the inmediate propertie but lov don't still open
    any ideas???

    Does this one help?
    Invoke lov popup window via keypress

  • Popup with open and save file option

    Hi,
    I have created a button on my page name as "Export File" and created a process and called on "EXPORT FILE" button. I am using utl file in this procedure and i want to download this file and file will be .ics file using for calendar.
    My page process code is
    begin
    pro_create_ical(:P6_START_DATE,:P6_END_DATE);
    end;when i click on export file button it should raise a popup with open and save file option.
    How i can do this?
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 25, 2013 1:59 AM
    Edited by: Vedant on Jan 25, 2013 2:00 AM
    Edited by: Vedant on Jan 25, 2013 3:49 AM

    Shiv,
    Have you installed any new Software/Spyware/Virus Scanner etc.Check it out.It might have caused the issue for last 5 days.
    This issue is fixed in Latest Support Package Versions.
    Which Version of Support Package you are using?
    If EP6 <SP19 you will face this issue.
    Just upgrade it to EP6, Support Pack-19,this will be resolved.
    Upgrade of Support Pack wont take much time.you can get the document under http://service.sap.com/instguides
    Hope it helps
    Regards,
    Karthick Eswaran
    *Reward Points for helpful answers.

  • I am having trouble with my mac book air. I think I have a virus because everytime i click on a link it openes up popup windows and other things. How do I reset teh computer?

    I am having trouble with my mac book air. I think I have a virus because everytime i click on a link it openes up popup windows and other things. How do I reset teh computer?

    Please post a screenshot that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • When i open iPhoto and want to share my photo on face book its popup with problem occur and ask me to repair when i repair it appears back again?

    when i open iPhoto and want to share my photo on face book its popup with problem occur and ask me to repair when i repair it appears back again?

    The Firefox Page Zoom feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • Flex mobile - close popUp with back hardware key - bug?

    Hi everyone,
    i am having a problem with a popUp in my firstView aka HomeView. I used a similar logic as provided by the DashBoardMobile reference example: (http://www.adobe.com/products/flex/examples/)
    when i open the PopUP i add a EventListener with the HandlerFunction to close the popUp if the device back-key is pressed:
    systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler, false, 1000, true);
    protected function deviceKeyUpHandler(event:KeyboardEvent):void
                    var key:uint = event.keyCode;
                    if (key == Keyboard.BACK)
                        event.stopImmediatePropagation();
                        event.stopPropagation();
                        closePopUp();
    So far this had worked fine (if a popUp is open its get closed, if no popUp is open the previous View is poped)
    Now i made a popUp for the firstView of my app, and there this doesnt works, if i press the back-kay the application is closed wether the popUp is open or not...

    You might want to try listening for the backKeyPressed event on the View instead: http://polygeek.com/4225_air-mobile_go-your-own-way-overriding-the-back-key-press-in-air-m obile-apps
    In that handler if your popup is open you'll want to preventDefault() on the event and call your close logic.

  • Error after close popup with swfloader

    Hi all, hope some one could help me with this i get this
    error ( Error: Unable to load '' ) each time after i close a popup
    with a swfloader the error popsup when i click on the datagrid
    *****************************main mxml
    private function ShowPano():void
    var SWFLoaderInstance:Panoramica2 =
    Panoramica2(PopUpManager.createPopUp(this,Panoramica2,true));//
    instantiate and show the title window
    PopUpManager.centerPopUp(SWFLoaderInstance);
    SWFLoaderInstance.mainAppPano = this //Reference to the main
    app
    scope
    *******************************this is the mxml Panoramica2
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="doInt()"
    cornerRadius="10" width="600" height="450">
    <mx:Script><![CDATA[
    import mx.controls.PopUpMenuButton;
    import mx.managers.PopUpManager;
    import mx.collections.ArrayCollection;
    import mx.controls.Button;
    [Bindable]public var mainAppPano:Object = null;
    //called by the close event raised byclicking the close
    button
    private function closeWindow():void
    PopUpManager.removePopUp(this);
    }//closeWindow
    private function doInt():void
    PopUpManager.centerPopUp(this);
    ]]>
    </mx:Script>
    <mx:TitleWindow layout="absolute" right="10" left="10"
    showCloseButton="true"
    close="closeWindow()" top="10" bottom="10">
    <mx:SWFLoader
    source="{mainAppPano.datagrid.selectedItem.pano..src}"
    scaleContent="false"
    horizontalCenter="0" verticalCenter="0"/>
    </mx:TitleWindow>
    </mx:Canvas>
    ********************************xml structure
    <catalog>
    <libro>
    <name><![CDATA[<b>Biblioteca Central
    </b> ]]></name>
    <desc><![CDATA[Se inauguró el 20 de noviembre
    de 1978 ]]></desc>
    <imagen>FOTOS/est/Biblioteca Central Manuel Bartlett
    Bautista.jpeg</
    imagen>
    <pano nombrePano="Biblioteca Central Bautista">
    <src>FOTOS/Panoramicas/PanoZoom642007.swf</src>
    </pano>
    <ico>BOTONES/gifs/video.gif</ico>
    <video nombreVid="Biblioteca Manuel Bartlet">
    <src>VIDEOS/Biblioteca Manuel Bartlet.flv</src>
    </video>
    <audio/>
    <pie>Biblioteca Central Manuel Bartlett
    Bautista</pie>
    </libro>
    </catalog>

    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>javascript does not wait for the current action to complete and then perform the next line.
    means in your function call
    doSubmit('SUBMIT');is triggered and it carry on's to next line that is
    $x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
    what you need to do is amend your js function like below
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    </script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
    and set the branch source to below
    htp.p('window.close();');
    htp.p('window.opener.doSubmit(''REFRESH'');');

  • Close popup with branch

    I have created a page with a "New party" button that opens a popup. It clears that cache for the popup and works fine.
    The new party can be entered and "create"d. The page branches to itself and the create button is not displayed. The new party data is saved in the table.
    The popup page has a computatoin to put the party_id into the calling page item. The Cancel button is a URL target: javascript:window.close();. This closes the window.
    Two questions;
    I want the branch to be a URL target that closes the page but I can't get it to work. The URL calls this in the Page HTML Header:
    <script language="JavaScript1.1" type="text/javascript">
    function passBack(){
    window.close();
    window.opener.location.reload(true);
    I made the only branch a URL and entered this as the url: -- javascript:passback() -- It never executed the function.
    I then tried -- javascript: window.close(); -- and the window did not close. This is the same code the Cancel button uses.
    What am I missing?
    Second question; I clicked the Cancel butoong, the window closed and on the calling page I looked at the session variables and the party_id was flagged as R but I did not see the value? Did it not write the session variable? Is there any way for me to check?
    Tia,
    Sam

    Sam,
    Why are you trying to take the user away from the current page? This can over complicate things. Have you considered a wizard approach where they could select "Create New" which would allow them to create the new entity?
    What I've found to work best is to provide a link to another action and bring the user back. For example, lets say I have a two step process: Create User and Assign User to Projects. In the wizard to Assign User to Projects I'll provide a link that says Create User. The link takes the user to the Create User wizard while setting the value of an item that the Create User wizard will later reference to bring the user back to the same spot in the Assign Users wizard.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • How to open a popup and get some data from a model class

    Hi experts,
    mi problem is the next.
    I am opening a popup from a view that is  controlled by a controller named identificador.do, the controller class is z_identity_cl.
    the window that is opened is other view controlled by nocupentes.do, with a controller class, z_nocupantes_cl.
    In the do_init event of the z_nocupantes class i have added the next code:
    <i>  DATA: cl_parent TYPE REF TO Z_IDENTtity_CL.
    Recuperamos el atributo parent
      cl_parent ?= me->m_parent.
    model is the class i want to recover, it is defined in the attibutes of the class z_identity_cl
      model     ?= cl_parent->get_model( 'mo' ).</i>
    When i open the popup i get the next error:
    <i>BSP exception : the object  numero_ocup.htm(this is the page i want to open) in URL sap/ZHR_PDWEB_GDPT/numero_ocup.htm is a view. Initialize the controller.</i>
    what do i have to do?
    any help?
    thanks in advance

    Hi Eduardo,
      you should be calling the Controller in the URL not the View. after calling the controlles in the URL create the view in the DO_REQUEST of the Controller. This should resolve the issue.
      In the the DO_INIT define the Parent class of the Controller.
    METHOD do_init.
      DATA: lr_my_parent TYPE REF TO zcl_hr_main_control.
    * set (MVC) model
      lr_my_parent ?= me->m_parent.
      set_model( model_instance = lr_my_parent->model
                       model_id = 'Z' ).
      me->model = lr_my_parent->model.
    ENDMETHOD.
    method DO_REQUEST.
    * datadeclaration
      DATA: abs      TYPE REF TO if_bsp_page.
    * if input is available, dispatch this input to subcomponent.
    * this call is only necessary for toplevel controllers.
      dispatch_input( ).
    * if any of the controllers has requested a navigation,
    * do not try to display, but leave current processing
      IF is_navigation_requested( ) IS NOT INITIAL.
        RETURN.
      ENDIF.
    * output current view (create, set attibutes, and call)
      abs = create_view( view_name = 'to_disp.htm' ).
    * set attribute model if needed
      abs->set_attribute( name = 'model' value = model ).
    * call master views
      call_view( abs ). "calls itself
    endmethod.
    Cheers
    Amandeep

  • Popup with fixed window size

    Hey, i'm really stuck with this and keep hitting a dead end.
    i've got a button in my flash website and i want it to open a popup
    window of 600x400 pixels when clicked. The popup contains a
    background image of this size so i dont want any white space in the
    background. I've tried putting the following into the actions
    window with the button selected but nothing happens when i click
    the link in the website.
    on (release) {
    getURL ("javascript:openNewWindow('
    http://www.mysite.co.uk/support.html','thewin','height=400,width=600,toolbar=no,scrollbars =no');");
    If I attach a behaviour to the button to geturl, it works but
    brings up the page full size. I'm new to flash so am just going on
    scripts i'm finding on various websites. Is there a simple way to
    do this? Its pretty straight forward in Dreamweaver but i cant see
    where to specify popup dimensions in flash. Thanks, Dren

    I found a script that works. If anyone comes across this post
    this is what you need:
    on (release) {
    var jscommand:String = "window.open('
    http://www.yourdomain.com/yourpage.html','win','height=600,width=800,toolbar=no,scrollbars =no');";
    getURL("javascript:" + jscommand + " void(0);");
    }

  • PopUp with selectMany List Box in JSF

    Hi,
    am a newbie to JSF....
    I have a page with a hyperlink which opens a popup that has two multi select list boxes (values need to be moved to and fro within select boxes). Then i have a select button in the popup which should send the selected value from popup to main page. Can anyone please send me a clear implementation for this I don't know how to implement this with JSF. I do want to know how should i have the in my main page to populate the selected values from popup. This will be of great help if u could provide me in detail for implementing the scenario.
    Note: My popUp page Implementation is like the one below and i don't have main page implementation other than the link calling javascript to open the popup....
    <body><table>< tr></tr><tr>< td>
    <h:selectManyListbox id="masterList" size="6">
    <f:selectItems id="master" value="#{populateList.masterList}" />
    </
    h:selectManyListbox></td>< td><table><tr>
    <
    h:commandButton id="MoveRight" value="MoveRight" ></h:commandButton >
    </
    tr><tr>
    <
    h:commandButton id="MoveLeft" value="MoveLeft" ></h:commandButton >
    </
    tr></table></ td><td>
    <
    h:selectManyListbox id="selectList" value="#{populateList.selectList}" size="6" > <f:selectItems id="select" />
    </
    h:selectManyListbox>
    </
    td></tr>< tr></tr><tr></ tr><tr>
    <h:commandButton id="selectButton" value="Select"></h:commandButton >
    </tr></table></body >

    any updates or help for this....
    i have a link in my main page that pops up a window with two select many list boxes where values can be moved to and fro. popup has a select button that has to send the list values in right hand side select many list box to the main page field....
    How should i achieve this in jsf....
    Any help with codelines will be greatful and guiding....
    Thanks
    Naadiya

  • Error when opening a workbook with mandatory variables

    BEx analyzer displays an error message window in the same time as the variable popup window.
    The worbook is linked to 1 query that uses 2 mandatory variables (month ?, year ?), and was defined in the test system.
    I assume that values are thus saved within the workbbok.
    The developper had 0bi_all autorisation.
    When a reporting user is opening it (also in the test system), the error message is displayed.
    This happens only the 1st time when Analyzer is started, and by clicking on the OK button, we are able to run the query.
    The next workbook refresh runs without the error message display.
    Question =  does anybody know the reason of this, and how to avoid the error message ?
    more infos:
    error message E019(R9E) appears for each variable (thus, 2 time with a query with 2 variables):
    Help type 5 is not valid for the platform NONE
    Exception 5 occured while calling IWB_HTML_HELP_URL_GET
    the details of this error message is:
    Diagnosis
       You tried to start the online help with help type on platform. Help type is not supported on this platform.
    System Response
       Profile parameter eu/iwb/help_type must contain a valid help type.
    Diagnosis
       The documentation is not correctly connected to the BI server.
    System Response
       The documentation cannot be displayed.

    i checked the query and authorisation with RSRV, but this didn't help, furthermore, a lot a functions are not implemented in the system, sorry.
    i also changed the query and workbook, and i think that it depends on the workbook release 3.x or 7.
    imagine following situations: same query 7.0, same workbook 7.0
    with BI7
    1) opening the query with variables doesn't display the error message
    2) refreshing the workbook with the query with variables displays the error message (only for a non mandatory variable - as soon as there is a variable, the error message is displayed)
    3) refreshing the workbook with the query without variables doesn't display the error message
    with BW 3.x
    4) refreshing a new workbook 3.x with the query with variables doesn't display the error message
    i also investigate in the function modules for workbooks (RS...), but nothing helped.
    i still think that it is linked to authorisations, because with sap_all, the message isn't displayed.
    how can i continue ?
    Edited by: Claire Mignerey on Mar 17, 2009 2:37 PM

  • How to give a popup with back end data in struts

    I have a page having information corresponding to a particular role..and there is a button for mapping/unmapping resources to that particular role...The problem is this button should open a pop-up with the whole resources' list with checkmark in already mapped resources' checkbox...and the user can then do map/unmap as he likes...i am using struts+spring dispatchactionsupport....
    i have given the button as..
    <html:button value="Map Resource" onclick="javascript:popitup('Role_Map_Resource.jsp')" property="mapping" styleClass="orangebtn"></html:button>
    and in script
    function popitup(url) {
         newwindow=window.open(url,'name','height=300,width=300');
         if (window.focus) {newwindow.focus()}
         return false;
    But even this pop-up is not working...it's giving 404 error....only after getting this i can think of pre-populating it....Pls help if anyone knows what's wrong in this code.....

    Well, thanks for your reply, but unfortunately that is not exactly what I meant.
    I want to open an PopUp like I usualy do in "classical" ABAP with "CALL SCREEN scr STARTING AT x1 y1", only with staying within the BDT using the View-eventing functions.

  • Opening a popup from custom button in a Form

    I have a requirement to open a popup from a custom button of a portal form and once the value is selected from the popup the control should return to the main form with the value selected and set it to some display only field in that same form. It can be done thru' popup of a field directly but how can I do this thru'a button ?.
    Help would be appreciated.
    Thanks
    -Krishnamurthy

    Works for me if I middle-click a bookmark on the Bookmarks Toolbar and browser.tabs.loadBookmarksInBackground is set to true.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • Apple Mobile Device Support won't install, keeps rolling back..

    I'm using Windows 7 64bit and i have everything updated. Since I've upgraded my iTunes to version 10.1, I can't sync my iPod Touch with it anymore. Each time I plug my iPod in, - the iPod could be detected by windows but not iTunes, and I keep gettin

  • Things an engineer can and can't do

    Hi, all.  Was hoping someone could help me with some clarification. I arranged to get BT Infinity installed for my elderly mother who is recovering from a brain tumour and who has very limited mobility.  I couldn't be there for the appointment becaus

  • Process for TDS

    Hi How can we map the TDS process for India in SAP Regards Kailash

  • Sending email from E71

    Please can someone tell me how to get my phone to show the full text of emails in my sent folder. Currently I get 'Email truncated to 0 characters'. Up until now this has not been a problem but I recently sent an email that I can't remember all the t

  • "Gear" Icon with message "Stop email image" what is this?

    I have am running a mac 10.6.3 - 2.4ghz. Recently in the top menu bar an icon which looks like a spinning gear has popped up. When I click on it the message says "stop 'email image'". I have clicked on the icon and selected stop, but nothing happens.