Applet loading as seperate window

Hi,
I'm porting jEdit's help system into an applet form. Its complete, except for an annoyance - it loads as a seperate window, leaving a dead HTML page behind. I'd like to instead embed the applet inside the HTML page, so I can have a link create a popup window. As it is now, if you close the HTML page it closes the applet.
I used the generic jBuilder code to create the applet, and added this like to start()
HelpViewer frame = new HelpViewer();
The GUI is created using in the HelpViewer's constructor:
/** HelpViewer
* Creates a new HelpViewer for specified URL
* @param URL
public HelpViewer(String url)
this.setTitle("Insight Help");
utilities = MiscUtilities.getInstance();
// Chack if valid URL
try
// Check if protocal included
new URL(url).getProtocol();
// Valid protocol, so if pointing to specific HTML file, remove
Log.log(Log.ERROR, this, "Parse URL for hostname");
catch (MalformedURLException e)
// No protocol - therefore assume local
if (e.getMessage().startsWith("no protocol"))
baseURL = utilities.getRemoteURL() + "/docs/";
else
Log.log(Log.ERROR, this, e.getMessage());
//Set to error page?
// Create history
history = new String[25];
ActionHandler actionListener = new ActionHandler();
// Setup tabs
JTabbedPane tabs = new JTabbedPane();
tabs.addTab("Contents", toc = new HelpTOCPanel(this));
tabs.addTab("Search", new HelpSearchPanel(this));
tabs.addTab("Glossary", new HelpGlossary(this));
tabs.setMinimumSize(new Dimension(0,0));
// Setup toolbar
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.add(title = new JLabel()); // title of current page
toolBar.add(Box.createGlue());
JPanel buttons = new JPanel();
buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
buttons.setBorder(new EmptyBorder(0,12,0,0));
// Add back button
back = new JButton(utilities.loadIcon("ArrowL.png"));
back.setToolTipText("Back");
back.addActionListener(actionListener);
toolBar.add(back);
// Add forward button
forward = new JButton(utilities.loadIcon("ArrowR.png"));
forward.setToolTipText("Forward");
forward.addActionListener(actionListener);
toolBar.add(forward);
back.setPreferredSize(forward.getPreferredSize());
// Add home button
home = new JButton(utilities.loadIcon("Home.png"));
home.setToolTipText("Home");
home.addActionListener(actionListener);
toolBar.add(home);
// Add toolbar to panel
JPanel rightPanel = new JPanel(new BorderLayout());
rightPanel.add(BorderLayout.NORTH,toolBar);
// Setup Viewer Panel
viewer = new JEditorPane();
viewer.setEditable(false);
viewer.addHyperlinkListener(new LinkHandler());
viewer.setFont(new Font("Monospaced",Font.PLAIN,12));
viewer.addPropertyChangeListener(new PropertyChangeHandler());
rightPanel.add(BorderLayout.CENTER,new JScrollPane(viewer));
// Split Pane
splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tabs, rightPanel);
splitter.setBorder(null);
getContentPane().add(BorderLayout.CENTER,splitter);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
getRootPane().setPreferredSize(new Dimension(750,500));
pack(); // causes window to fit the preferred size
setVisible(true);
SwingUtilities.invokeLater(new Runnable()
public void run()
splitter.setDividerLocation(250);
viewer.requestFocus();
gotoURL(url,true);
Any advice would be appreciated!
-Ben

There are 2 possible solution.
1. Do not leave that window empty. I.e. write there a message "DO NOT CLOSE THIS WINDOW"
2. Do not open new frame. Add all components to your applet. This is not very difficult.

Similar Messages

  • ActionPerformed method not working when applet is loaded in browser window.

    Hey there guys. I need urgent help from anybody who has experience in deploying websites whose code is in java.
    I am having two problems as mentioned below...
    first, I have made a simple login screen using java swing and JApplet. there is a single button to login. the action performed for this button accesses a private method to check the username and password which are there in atext file. the applet is working perfectly in appletviewer but when i load the applet in a Internet Explorer window using HTML's Applet tag, the button is giving no response at all even when i enter the correct username and password.
    I guess it is either not calling the private function that is checking the username and password from the tes=xt file or it can not access the file. Please help as soon as possible as this is related to my college project.
    I am attaching the code herewith. Suggestions to improve the coding are also welcome.
    the second problem is that while writing my second program for generating a form which registers a user the html is not at all loading the applet into the browser and also if im trying to access a file to write all the details into the console is showing numerous amount of error after i press the button which i can't not understand. the only thing i can understand is that it is related to file access permissions. If anybody could put some light on the working of worker threads and thread safe activities of SwingUtilities.invokeandWait method it would be really appreciable.
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.plaf.*;
    <applet code = "UserLogin" width = 300 height = 150>
    </applet>
    public class UserLogin extends JApplet implements ActionListener, KeyListener {
         private JLabel lTitle;
         private JLabel lUsername, lPassword;
         private JTextField tUsername;
         private JPasswordField tPassword;
         private JButton bLogin;
         private JLabel lLinkRegister, lLinkForgot;
         private JLabel lEmpty = new JLabel(" ", JLabel.CENTER);
         private JPanel panel1, panel2;
         public void init() {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   SwingUtilities.invokeAndWait(new Runnable() {
                        public void run() {
                             LoginGUI();
              catch(Exception e) {
                   e.printStackTrace();
         public void start() {
              setVisible(true);
         public void stop() {
              setVisible(false);
         private void LoginGUI() {
              super.setSize(300, 150);
              super.setBackground(Color.white);
              lTitle = new JLabel("<HTML><BODY><FONT FACE = \"COURIER NEW\" SIZE = 6 COLOR = BLUE>Login</FONT></BODY></HTML>", JLabel.CENTER);
              lUsername = new JLabel("Username : ", JLabel.CENTER);
              lPassword = new JLabel("Password : ", JLabel.CENTER);
              tUsername = new JTextField(15);
              tPassword = new JPasswordField(15);
              bLogin = new JButton("LOGIN");
    //          bLogin.setEnabled(false);
              bLogin.addActionListener(this);
              bLogin.addKeyListener(this);
              panel2 = new JPanel();
              GridBagLayout gbag = new GridBagLayout();
              GridBagConstraints gbc = new GridBagConstraints();
              panel2.setLayout(gbag);
              panel2.addKeyListener(this);
              gbc.anchor = GridBagConstraints.CENTER;
              panel2.setMinimumSize(new Dimension(300, 200));
              panel2.setMaximumSize(panel2.getMinimumSize());
              panel2.setPreferredSize(panel2.getMinimumSize());
              gbc.gridx = 1;
              gbc.gridy = 1;
              gbag.setConstraints(lUsername,gbc);
              panel2.add(lUsername);
              gbc.gridx = 2;
              gbc.gridy = 1;
              gbag.setConstraints(tUsername,gbc);
              panel2.add(tUsername);
              gbc.gridx = 1;
              gbc.gridy = 2;
              gbag.setConstraints(lPassword,gbc);
              panel2.add(lPassword);
              gbc.gridx = 2;
              gbc.gridy = 2;
              gbag.setConstraints(tPassword,gbc);
              panel2.add(tPassword);
              gbc.gridx = 2;
              gbc.gridy = 3;
              gbag.setConstraints(lEmpty,gbc);
              panel2.add(lEmpty);
              gbc.gridx = 2;
              gbc.gridy = 4;
              gbag.setConstraints(bLogin,gbc);
              panel2.add(bLogin);
              panel1 = new JPanel(new BorderLayout());
              panel1.add(lTitle, BorderLayout.NORTH);
              panel1.add(panel2, BorderLayout.CENTER);
              add(panel1);
              setVisible(true);
         public void keyReleased(KeyEvent ke) {}
         public void keyTyped(KeyEvent ke) {}
         public void keyPressed(KeyEvent ke) {
              if(ke.getKeyCode() == KeyEvent.VK_ENTER){
                   String username = tUsername.getText();
                   String password = new String(tPassword.getPassword());
                   if(username.length() == 0 || password.length() == 0) {
                        JOptionPane.showMessageDialog(new JFrame(),"You must enter a username and password to login", "Error", JOptionPane.ERROR_MESSAGE);
                   else {
                        boolean flag = checkUsernamePassword(username, password);
                        if(flag)
                             JOptionPane.showMessageDialog(new JFrame(),"Username and Password Accepted", "Access Granted", JOptionPane.INFORMATION_MESSAGE);
                        else
                             JOptionPane.showMessageDialog(new JFrame(),"Username or password Incorrect", "Access Denied", JOptionPane.INFORMATION_MESSAGE);
         public void actionPerformed(ActionEvent ae) {
              String gotCommand = ae.getActionCommand();
              if(gotCommand.equals("LOGIN")) {
                   String username = tUsername.getText();
                   String password = new String(tPassword.getPassword());
                   if(username.length() == 0 || password.length() == 0) {
                        JOptionPane.showMessageDialog(new JFrame(),"You must enter a username and password to login", "Error", JOptionPane.ERROR_MESSAGE);
                   else {
                        boolean flag = checkUsernamePassword(username, password);
                        if(flag)
                             JOptionPane.showMessageDialog(new JFrame(),"Username and Password Accepted", "Access Granted", JOptionPane.INFORMATION_MESSAGE);
                        else
                             JOptionPane.showMessageDialog(new JFrame(),"Username or password Incorrect", "Access Denied", JOptionPane.INFORMATION_MESSAGE);
         private boolean checkUsernamePassword(String username, String password) {
              String user = null, pswd = null;
              try {
                   FileInputStream fin = new FileInputStream("@data\\userpass.txt");
                   DataInputStream din = new DataInputStream(fin);
                   BufferedReader brin = new BufferedReader(new InputStreamReader(din));
                   user = (String) brin.readLine();
                   pswd = (String) brin.readLine();
              catch(IOException ioe) {
                   ioe.printStackTrace();
              if(username.equals(user) && password.equals(pswd))
                   return true;
              else
                   return false;
    }PLEASE HELP ME GUYS......

    RockAsh wrote:
    Hey Andrew, first of all sorry for that shout, it was un-intentional as i am new to posting topics on forums and didn't new that this kind of writing is meant as shouting. Cool.
    Secondly thank you for taking interest in my concern.No worries.
    Thirdly, as i mentioned before, I am reading i file for checking of username and password. the file is named as "userpass.txt" and is saved in the directory named "@data" which is kept in the same directory in which my class file resides.OK - server-side. That makes some sense, and makes things easier. The problem with your current code is that the applet will be looking for that directory on the end user's local file system. Of course the file does not exist there, so the applet will fail unless the the end user is using the same machine as the server is coming from.
    To get access to a resource on the server - the place the applet lives - requires an URL. In applets, URLs are relatively easy to form. It might be something along the lines of
    URL urlToPswrd = new URL(getCodeBase(), "@data/userpass.txt");
    InputStream is = urlToPswrd.openStream();
    DataInputStream din = new DataInputStream(is);
    So the problem is that it is reading the file and showing the specific output dialog box when i run it through appletviewer.. Huhh. What version of the SDK are you using? More recent applet viewers should report security exceptions if the File exists.
    ..but the same is not happening when i launch the applet in my browser window using the code as written belowHave you discovered how to open the Java Console in the browser yet? It is important.
    Also the answer to your second question
    Also, the entire approach to storing/restoring the password is potentially wrong. For instance, where is it supposed to be stored, on the server, or on the client?is that, as of now it is just my college project so all the data files and the username and password wiles will be stored on my laptop only i.e. on the client only. no server involved.OK, but understand that an applet ultimately does not make much sense unless deployed through a server. And the entire server/client distinction becomes very important, since that code would be searching for a non-existent file on the computer of the end user.

  • Applet loading through browser, but showing in its own window

    Hello,
    I have created an applet, which talks to a servlet.
    This servlet then talks to a DB, and returns information to the applet to process and display.
    Everything works fine, except that the applet loads it's own window, instead of displaying in the browser.
    Any ideas?
    Haig

    The answer is probably somewhere in your applet source code.
    Can you post the code here, so I can have a look at it? Otherwise it's difficult to answer.
    BTW - it's nothing to do with the fact that it connects to a servlet. If you don't want to post the whole applet, maybe I can tell from just the init() method.
    Also - what browser are you using?
    Yours, Mike H..

  • Multiple instances of the same applet loaded causes problem

    I have a java applet that has several classes in the project. The applet has a JTable a JButton and a JLabel control. The applet is displayed within an HTML page. The problem is that if a user opens the same html page more than once with the applet in it, only the last applet loaded receives the screen updates.
    For example in one senario. I have an error message that displays in the Label control once they click on the button.
    The user opens the html page and the applet is loaded (window 1). The user then opens the same html page again (window 2) with window 1 still open. If the user clicks on the Button in window 1, the error message is displayed in the window 2 applet.
    Originally I had some static variables. Thinking it was being used globally by the JVM so I removed all of them and it still happens. I have tried using both the Applet and Object tag. But it still happens.
    Has anyone experienced this before? Any suggestions on how to make the applet update the instance that recieved the events and not just the last one that was loaded?

    You need to look at applet classloader issues. If applets have the same archive list and come from the same codebase, they have the same classloader. A class is namespaced by it's class + classloader. Any statics in a class with a classloader will be shared. If you instead make it such that your applets have unique classloaders (which you can't change for unsigned applets by yourself) by changing the codebase, that would be one solution.
    For other solutions, I recommend searching the forum. This issue comes up a lot.

  • How to make an applet load user-defined package?

    How to have an applet load user-defined package?
    I have packages in their own directories, and the applet compiles and links with them, by use of CLASSPATH env variable. But when it comes time to run, it ignores that and does not know where the classes (in the packages) are.
    If I don't use packages and put all code in one directory, runs fine. If I use an application, I can link with and load my packages.
    I know applets can't use things like CLASSPATH for security reasons, but still, they should be able to be compiled out of several packages, why do I have to put all code together??

    OK, for reference for future newbies, here's the answer:
    use CODEBASE attribute in your html file (if on Windows server, don't use drive letter but relative path to .html file, Unix style, and put all your .class files beneath that, for example, in your .html file
    <applet
    CODEBASE="..\class
    and then have package bar Bar.class file, in ..\class\bar

  • IView in seperate window IE7

    Hi,
    we have a problem with IE7:
    if we call an iView in a seperate window, the browser starts to load without ending. On the main portal page we get an page-error message if we click on the yellow message-icon in the status bar: 'newwin' is null or no object.
    With IE6 it works fine.
    Any suggestions?
    Best regards

    Hi,
    We're having the same problem and it says here that you got it resolved. Any help you can provide would be appreciated.
    Regards,
    JD

  • Applet loading fails: ClassNotFound exception onlyyyy on linux

    Hello,
    I have a server on my embedded device with WinCE, and this server has the jar files and html files. connecting with Windows is working fine and Java applet loads and runs perfectlly.
    The problem is with linux clients, I can't load the applet.
    I expected to havesomething wrong with the plugin, But I tried with the test applets on www.sun.com and they are working fine.
    The error is ClassNotFoundException and http connection failed, although when I take the URL copy/paste from the Java console to the address bar of the firefox it downloads the class file. so the path is OK.
    Also I can run with the appletviewer and it works perfect like the case with windows. The problem is with the browser, It can'T load the applet from a remote machine.
    Also I made an empty applet with a button on it to check may be I should compile on linux!! but also this failed, I could load this applet locally (the html and class files on desktop) and when I places them on the server in the directory configured to be the www public directory It is not loaded. And again this test applet laoded on windows machines.
    I use the same JRE version on linux and windows and the same JDK.
    I use on windows Opera/ Firefox/ explorer and all are working, on linux I use Firefox/ Konqurer/ Epiphany and all are not working.
    Any Idea?????
    Thanks in Advance

    Hello,
    I have a server on my embedded device with WinCE, and this server has the jar files and html files. connecting with Windows is working fine and Java applet loads and runs perfectlly.
    The problem is with linux clients, I can't load the applet.
    I expected to havesomething wrong with the plugin, But I tried with the test applets on www.sun.com and they are working fine.
    The error is ClassNotFoundException and http connection failed, although when I take the URL copy/paste from the Java console to the address bar of the firefox it downloads the class file. so the path is OK.
    Also I can run with the appletviewer and it works perfect like the case with windows. The problem is with the browser, It can'T load the applet from a remote machine.
    Also I made an empty applet with a button on it to check may be I should compile on linux!! but also this failed, I could load this applet locally (the html and class files on desktop) and when I places them on the server in the directory configured to be the www public directory It is not loaded. And again this test applet laoded on windows machines.
    I use the same JRE version on linux and windows and the same JDK.
    I use on windows Opera/ Firefox/ explorer and all are working, on linux I use Firefox/ Konqurer/ Epiphany and all are not working.
    Any Idea?????
    Thanks in Advance

  • Applet loading Failed .... for diagnostics-console-extension.jar

    Hi everybody,
    i downloaded diagnostics-console-extension.jar from bea site. i copied this file to D:\bea9.0\user_projects\domains\mydomain\console-ext. i started weblogic server . in administration console when i clicking WLDF console extension tab it gives the Applet loading failed....and also in server console it gives an exaception as follows ""
    java.lang.ClassNotFoundException: jsp_servlet._com._bea._diagnostics._dashboard.
    __chartpanelapplet_class.
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:512)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:224)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
    StubImpl.java:383)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:298)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:165)
    Truncated. see log file for complete stacktrace
    >
    in Java console output Exception
    Java Plug-in 1.5.0_06
    Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\mselvan
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    p: reload proxy configuration
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    java.lang.ClassFormatError: Truncated class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-5" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-com.bea.diagnostics.dashboard.ChartPanelApplet.class" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    so kindly any one help for the same.please help me
    Thanks & regards
    Selvan.M

    Several issues with the diagnostic console extension have been fixed in WLS 9.2. Can you try the extension from 9.2? WLS 9.2 is now ready for download from the BEA site.
    Thanks

  • Applet loading

    Hi
    When I use JRE 1.4 applet load,
    but if I use default JRE /Windows 98/
    applet can't load
    java.lang.NullPointerException!

    Hello Tanja,
    I think you should check, if you have used a class that is only availible with jre1.4. In this case it isn't possible to run it with the default jre or the virtual machine from Microsoft (in IE5 and so on).

  • Adobe Bridge CS3 crashes on load in my Windows 7 workstation.

    Adobe Bridge CS3 crashes on load in my Windows 7 workstation.
    I recently completely removed, deactivated and reinstalled all my Adobe Creative Suite CS3 Master Collection to solve some problems with other application from the suite and now I'm surprise Bridge continues to fail. In my portable workstation the same software (Bridge) uses to work.
    I tried launching Bridge under several compatibility modes. All failed.
    Is there any know bug I should be aware of? Any fix?
    Is this a common problem?

    Curt Y. Thank you for your answer.
    It was only Bridge who was crashing. It failed to load and Windows was giving an error message.
    I tried your suggestion, and resetting all options in the reset window it now loads. It was as simple as that.

  • Windows 8.1 SOFTWARE registry hive load failed on Windows Server 2012

    Hello,
    I am participated in custom Windwows Software backup/restore project development that requires load of Windows SOFTWARE/SYSTEM registry hives from target OS system drive connected to Windows system.
    On all Windows version except Windows 8.1 program works correctly but when host system (on that programm run on) is Windows Server 2012 or Windows 8 and target system is Windows 8.1 registry hive load failed with following error: 
    Failed to load f:\Windows\System32\config\software: [1009] The configuration registry database is corrupt.
    After run of 'chkdsk /r' error still remained. All requred security privileges (SE_BACKUP, SE_RESTORE) are applied. All systems are 64-bit.
    Generally even system registry editor (regedit) could not open SOFTWARE hive  from Windows 8.1 with following error:
    Cannot Load f:\Windows\System32\config\software: Error while loading hive.
    But when host system is Windows 7 or Windwos Server 2008 then SOFTWARE hive  loaded without any problem. 
    So is there some Windows 8/8.1 registry hives validation mechanism or additional security checks tha prevents load of registry hives fromother OS instance?

    Sorry for later response. I was busy with other tasks.
    The procMon tool shows RegLoadKey is failed when it tried to load the hive on Windows 8.1 (8.1 based WinPE also). On Windows 7, I didn't see the error (Shows Success instead of REGISTRY CORRUPT). Once the hive is load & unloaded on Windows 7 OS, the
    check sum of the hive is changed, and I can load the updated hive with regedit in Windows 8.1 OS.
    "reg.exe","752","RegCloseKey","HKLM\SOFTWARE\Microsoft\SQMClient\Windows","SUCCESS",""
    "reg.exe","752","RegQueryKey","HKLM","SUCCESS","Query: HandleTags, HandleTags: 0x0"
    "reg.exe","752","RegOpenKey","HKLM\Software\Microsoft\Rpc","SUCCESS","Desired Access: Query Value"
    "reg.exe","752","RegQueryValue","HKLM\SOFTWARE\Microsoft\Rpc\IdleTimerWindow","NAME NOT FOUND","Length: 144"
    "reg.exe","752","RegCloseKey","HKLM\SOFTWARE\Microsoft\Rpc","SUCCESS",""
    "reg.exe","752","QueryNameInformationFile","C:\Dhoni","SUCCESS","Name: \Dhoni"
    "reg.exe","752","RegQueryKeySecurity","HKLM","SUCCESS",""
    "reg.exe","752","RegLoadKey","HKLM\target1","REGISTRY CORRUPT","Hive Path: C:\Dhoni\SYSTEM1"

  • How can I call the Class and have a PDF appear in seperate window?.

    I would like to call the class/interface ZCL_UIU_PRN_ACCOUNT2, method Collect_data and have a Smartform executed to produce a PDF document in a Seperate window.
    Where I have an issue is in opening another window to display the PDF.
    I know the Standard PDF Facsheet does exactly this, but that is triggered via the Web browser and calls a Java script, avoiding and events and round-server trip processing. I would have changed the button values so that when pressed it does process the various events and eventually ends up at EH_ONPREVIEW for the BP_HEAD/Overview. I know just need to open a new window and call the process to create the PDF via Smartform.
    Any suggestions would be more than welcome. I have spent so much time on this, and have gained no real ground, so far.
    Jason

    Hi,
    in the method
    data: zcontrol TYPE SSFCTRLOP.
    zcontrol-device = 'PRINTER'.
    zcontrol-langu = sy-langu.
    zcontrol-no_dialog = 'X'.
    zcontrol-getotf = 'X'.
    data: job type SSFCRESCL.
    data: devtype type RSPOPTYPE.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = sy-langu
    IMPORTING
    e_devtype = devtype
    EXCEPTIONS
    no_language = 1
    language_not_installed = 2
    no_devtype_found = 3
    system_error = 4
    OTHERS = 5.
    data: output_options type SSFCOMPOP.
    output_options-tdprinter = devtype.
    call function FM_NAME
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = zcontrol
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = output_options
    *   USER_SETTINGS              = 'X'
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = job
    *   JOB_OUTPUT_OPTIONS         =
      TABLES
        t_texto                    = t_texto
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5.
    if sy-subrc <> 0.
    endif.
    data: DOCTAB_ARCHIVE type TABLE OF DOCS,
    LINES type TABLE OF TLINE.
    *CALL FUNCTION 'CONVERT_OTF_2_PDF'
    ** EXPORTING
    **   USE_OTF_MC_CMD               = 'X'
    **   ARCHIVE_INDEX                =
    ** IMPORTING
    **   BIN_FILESIZE                 =
    *  TABLES
    *    otf                          = job-otfdata
    *    doctab_archive               = doctab_archive
    *    lines                        = lines
    * EXCEPTIONS
    *   ERR_CONV_NOT_POSSIBLE        = 1
    *   ERR_OTF_MC_NOENDMARKER       = 2
    *   OTHERS                       = 3
    data:  l_pdf_len type i,
    l_pdf_xstring type XSTRING.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    IMPORTING
    bin_filesize = l_pdf_len
    bin_file = l_pdf_xstring
    TABLES
    otf = job-otfdata
    lines = lines
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5.
    IF sy-subrc is initial.
    DATA: cached_response TYPE REF TO cl_http_response.
    CREATE OBJECT cached_response
    EXPORTING add_c_msg = 1.
    l_pdf_len = XSTRLEN( l_pdf_xstring ).
    cached_response->set_data( data = l_pdf_xstring
    length = l_pdf_len ).
    cached_response->set_header_field(
    name = if_http_header_fields=>content_type
    value = 'application/pdf' ).
    cached_response->if_http_response~set_status( code = 200
    reason = 'OK' ).
    cached_response->if_http_response~server_cache_expire_rel(
    expires_rel = 180 ).
    data guid type GUID_32.
    CALL FUNCTION 'GUID_CREATE'
    IMPORTING
    ev_guid_32 = guid.
    data display_url type string.
    CONCATENATE url '/' guid '.pdf' INTO
    display_url.
    cl_http_server=>server_cache_upload( url = display_url
    response = cached_response ).
    *GV_DISPLAY_URL & GV_PRINTON are class attributes
    CLEAR: gv_display_url, gv_printon.
    MOVE display_url TO gv_display_url.
    gv_printon = 'X'.
    ENDIF.
    Send me you e-mail i cannot post the code that is used in the view.htm.
    Best Regards,
    Caíque Escaler
    Edited by: Caíque Escaler on Nov 26, 2010 5:00 PM

  • 2 simple questions about opening and closing seperate windows via iWeb...

    I'm a web newbie, so please excuse me for my lack of terminology. My questions are... 1. How do i have iWeb open a separate browser window "simultaneously" from my main page to display a quicktime movie or piece of artwork? 2. Is it possible with iWeb to create a "close" window button within that same seperate window so that the veiwer does not have to click the red button in the upper left hand corner. Thanks guys and girls!
    G5 Dual 2.3   Mac OS X (10.4.5)  

    Sorry! i meant I tried all of the links that are on your web page. There are quite a few of them and I watched most of the movies but there aren't any that open on a new window with a link to close it. I thought that happened because I had a pop-up blocker but even after dissabling the blocker and trying opening some of them again they still opened in the same window. I did come accross a couple of links that changed the window and made it do wacky thinks like moving fast left and right and forcing the window to get smaller. Kinda fun but this is not what I had in mind.. lol The rollover javascript is nice but I couldn't find it on the page's source. Is it the part that says "<script language="JavaScript1.2" src=..."? I'm just curious to know which software you used to make the flash movies and how difficult it was. Maya rocks by the way!

  • Adobe Acrobat 9 Pro will not load on  new Windows 7 Home Ultimate PC

    Adobe Acrobat 9 Pro will not load on  new Windows 7 Home Ultimate PC

    When I double click on the AA9 icon to initiate installation, it whirls away for a while then asks if I want to allow "this program to make changes to his computer?"  I click Yes and it begins to process again for a few minutes.  Then it displays the following Invalid Unicode file error message...and simply stops processing or installing.  In that last process, it also reaches out for whatever reason and activates the magnifier tool in Windows.
    I have thought that perhaps upgrading to a higher version of Windows might help, but who knows for sure?
    P.S. – This is a brand new HP Pavilion dv6 series computer that is more than adequate to this task.
    Thanks for your interest in helping!
        b
    Bob Horton, MS
    972-786-6445
    [email protected]
    www.rshorton.com

  • Java applet loading for a long time.

    If you go here (warning - long load to start with) -
    www.aclwebsite.co.uk
    I have placed a newsticker java applet there but when you first visit the site the browser freezes up for a while untill the applet loads.
    Any idea on whats causing this to load so much?
    Thanks.

    If you go here (warning - long load to start with) -
    www.aclwebsite.co.uk
    I have placed a newsticker java applet there but when
    you first visit the site the browser freezes up for a
    while untill the applet loads.
    Any idea on whats causing this to load so much?
    Thanks.A long-running init() or start() method of the applet. I guess you better do something about your own code then.

Maybe you are looking for