How to open and close files from UIwindow my function doesn't work

Hello guys!
I am trying to create a simple ui-interface.
I made one button so far.
but my function does not work.
if I run the function without dialog box it works perfectly!
when I running the function in the dialog window, picking a file and open, nothing happens why?
please help me with a correct code.
also how do I write  2 functions that also closing a file and  saving a file?
here is my simple code.
var w = new Window ("dialog");
button.onClick = function () {
OpenMyFile();
w.show ();
function OpenMyFile(){
var myFile = File.openDialog();
app.open(myFile)
Thank you in advance.

Well, to answer your first question, you've added an event listener, but you haven't actually added the button itself.
try this:
var w = new Window ("dialog");
b = w.add("button", undefined, "Click me!");
b.onClick = function () {
OpenMyFile();
w.show ();
function OpenMyFile(){
var myFile = File.openDialog();
app.open(myFile)

Similar Messages

  • How to open Adobe Reader file from another native IOS application?

    There is an existing thread, but I want to re-open it because I think this is an important feature that we need badly.  I was wondering if there is any plan to add this feature so we can open PDFs directly into Adobe from the web / other apps.
    How to open Adobe Reader file from another native IOS application?
    Basically, we just want to use a custom URL scheme to open a specific document in the App.  Currently, this only opens the app but does not load the file.
    APB

    Not to hijack the conversation but I can explain why this would be useful for both the above case and another.
    What I believe Pavel is talking about is setting up a "URL Scheme" for the Adobe Acrobat iOS application so that you can easily open a PDF specifically in Adobe Acrobat iOS from other native applications and even from web applications opened within Safari. This is particularly useful if your application requires some of the specific features in Adobe Reader iOS to grant them the best experience possible and you want to encourage this.
    Another case: If you're using Adobe Livecycle's document security modules (that encrypts PDF files so that Adobe Acrobat must "phone home" to decrypt and view the document), these PDF's can only be viewed inside the Adobe Acrobat application and appear as blank in most other PDF readers. Having a URL scheme allows your application utilising this functionality to have a 1 click step to view the PDF rather than the current non-user friendly process:
    - Within Safari, touch the PDF link (appears as blank in the default Safari PDF reader, which in itself is confusing)
      - Touch "Open in..."
      - Touch "Adobe Acrobat"
    We have an immediate need for this functionality for the example above. I can resubmit it in a separate post if necessary.

  • How to open and close posting period for both material  , n invoicing

    HI
    how to open and close posting period for both material  , n invoicing , AM NEW TO SD , SO ALL DOUBTS I DO POST IN HERE PLEASE DONT MIND

    Hi Sunaina
    Period Open T.code: MMP1
    Period Close T-Code: MMPV
    Automate the opening of MM periods 
    How can you automate the monthly opening of MM periods (transaction MMPV - program RMMMPERI) with 
    SM36?
    RMMMPERI accepts a period/year or a date.
    If you enter a date the period is derived by it.
    1. create a variant and check the attribute 'selection variable' for the parameter date. Then click the button 'Selection variables' and set the current date. Every time this variant is used the parameter DATE is filled with the current date.
    2. create a job for RMMMPERI with the variant created in the preceding step. Set it as periodic.
    If you're not using a fiscal year variant simply schedule it as monthly (to be executed the first day of the month).
    If you are using a fiscal year variant you'd have to define a calendar with only the first day of each period defined as working 
    day and use it in the periodicity restrictions.
    Another possibility:
    Write a very simple ABAP which run daily to check if the period has changed and submit RMMMPERI.
    Reward if useful to u

  • I am trying to download a file from Safari. It doesn't work.

    I am trying to download a file from Safari. It doesn't work. It always comes up with a notification saying, 'Safari could not download this file'. Why does it do that? More importantly, what should I do? how do I download it?
    Thanks to the users who reply to this. It will help me a lot.

    What type of file is it?
    If safari can't natively open the file, or there is no App installed thatr can, it won't download.

  • I upgraded my 3 yr old iMac to Snow Leopard and now my HP C4150 Scanning function doesn't work (not recognized).  I downloaded updated Drivers from the HP site, but still no joy.  Any suggestions?

    I upgraded my 3 yr old iMac to Snow Leopard (OS X 10.6) and now my HP C4150 Scanning function doesn't work (not recognized).  I downloaded updated Drivers from the HP site and installed them, but still no joy.  Any suggestions?

    aspaceman,
    Perhaps I owe you an apology.   Having re-read that downloading from HP was unsuccessful I feel uncomfortable.  Can I suggest you update your 10.6 system (as noted in your profile) to 10.6.8 (if it is not already there) by using the
    Mac OS X 10.6.8 Update Combo v1.1 combo update plus any software updates that then apply.  

  • How do I open and close VIs from within a VI?

    Ladies and gentlemen,
    I would like to use a VI to open and close other VIs based on user input.  Example:  The first VI will have text that reads:  "Does the car have heated mirrors?"  There will be two buttons: one for "YES" and the other for "NO."
    If the user hits the "NO" button, the current VI will close and a similar VI will open that asks the user the next question, "Are the mirrors lighted?" "YES" or "NO..."
    If the user hits the "YES" button, the current VI will close and another will open that will tell the user to "Activate the heated mirrors" and press a button that will say "NEXT."  At that point, that VI will close, and in two minutes another VI will open and ask the user "Is the driver's side mirror hot?" with another set of "Yes" or "No" buttons.  If the user presses "YES" we will have verified that the heated driver's side mirror is working properly and store that information somewhere .  If the user presses "NO", the VI will close and another VI will open with some kind of repair instruction and a button that says "RETEST" that will rerun the heated mirror test when repairs are completed.
    During the two minutes we are waiting for the mirrors to heat up the program should move on to the next question: "Are the mirrors lighted?" "YES" or "NO..."
    Does anyone know how to manipulate VIs in this way?  Please help!
    Drew

    Instead of opening and closing vi's, just create one main vi with a state machine architecture.  Search for examples on state machines to get a basic understanding of them.  This is pretty complex so I have written an example of how this could be accomplished.  The trick part was the 2 minute timer (my vi is set for 5 seconds for quick testing).  Each state produces a question, and depending on the answer, the next state is inserted into a queue.  You can add more states for more questions and answers.  Notice that the boolean buttons can be hidden if you just want to show one button (like Next) instead of two buttons (Yes and No).  Study the vi and let me know if you have questions.
    - tbob
    Inventor of the WORM Global
    Attachments:
    Q&A.vi ‏166 KB

  • How to open an InDesign file from CMIS repository?

    We are using CS SDK 2.0 , looking to use CMIS to keep versionning of .indd file. The uss case as following:
    form our de4veloped InDesign pluging, user click a button
    the button will open a .indd file from cmis repository
    plugin check-out the file, open it within InDesign IDE
    user make changes
    user make save
    the plugin export a pdf and swf files from the current document, if the files exists it will update, aslo on CMIS repo to keep also versions of exported pdf and swf, if files not exist in first time .. it will create
    when user clos the document , it will check it in.
    the problem there is no sufficent sample code for, even was thinking to use Adobe Drive, but there is no Adobe Drive SDK for Flex.
    i used to fuse the sdk, but
    private function getFileByPath(sPath:String):Fileable {
    appStatus = ">> get File By Path";
    message = "";
    viewEnabled = false;
    var request:GetObjectByPathRequest = new GetObjectByPathRequest(session);
    var oFileable:Fileable;
    request.path = sPath;
    request.execute(onSuccess, onError);
    function onSuccess (event:GetObjectByPathResponse) : void {
    oFileable = event.object;
    //var oDoc2:Document = new Document(event.object);
    doc = event.object as Document ;
    //children = new ArrayCollection(vectorToArray(event.target));
    appStatus = ">> getFileByPath : Success";
    viewEnabled = true;
    return oFileable;
    private function checkOutFile(oFile:Document):Document{
    appStatus = ">> Check Out File";
    message = "";
    viewEnabled = false;
    var request:CheckoutRequest = new CheckoutRequest(session);
    request.object = doc;
    var oDocument:Document;
    request.execute(onSuccess, onError);
    function onSuccess (event:CheckoutResponse) : void {
    oDocument = event.object ;
    appStatus = ">> Check Out File : Success";
    viewEnabled = true;
    return oDocument;
    private function openTestFile():void {
                                            appStatus = "Open Test File";
                                            message = "";
                                            viewEnabled = false;
                                            var oFile:Fileable  = getFileByPath("/Collaboration/test.indd");
                                            //var oDoc2:Document = new Document(oFile);
                                            var oDoc:Document  = checkOutFile(doc);
    i do not know what method in the CS SDK to open document fom active window and  how to map CMIS Document to com.adobe.indesign Document ?

    Dear Seoras
    i fixed the to return the cmis path:
    public function resolveRemotePath(file:File):String
                                  if (file.nativePath.indexOf(LOCAL_FILE_CACHE.nativePath) != 0)
                                            return null;
                                  var remoptePath:String =file.nativePath.substr(LOCAL_FILE_CACHE.nativePath.length);
                                  trace("resolveRemotePath [11] : "+ remoptePath);
                                  if(File.separator!="/") {
                                            //var pattern:RegExp = /(\/)/g;
                                            var pattern:RegExp = /(\\)/g;
                                            remoptePath =  remoptePath.replace(pattern ,"/");
                                            trace("resolveRemotePath [22] : "+ remoptePath);
                                  return remoptePath;
    i have another issue, why everytime update the generated pdf it creates new pdf file with same name in the cmis repo .. does the pdf is not updatable over the cmis service ???
    Regards

  • How to open a local file from javascript in a jsp-page

    Hi
    I have created an iview from a PAR file. In the par file I have a jsp-page with some javascript code. From the javascript coe I want to open a new window with an Excel file.
    I have tried window.open("c:
    test.xls", "test_window"), but it doesn't seem to work. I have created a small HTML page locally with the same command and there a new window opens with the Excel file.
    If I change the local file path with an URL it also works.
    Any idea how to open a local file ?
    Thanks
    /Jakob

    Jacob,
    I'm not 100% (but 99,9%) and it has to do with security ristrictions of the browser not allowing to have local workstation interation from the web. This is ofcourse very dangerous if the browser would allow it... So therfore it is blocked. What if somone would point to a file/executable that formats your drive so for that reason it is not allowed to have web interaction with a local file. Only with Java Applets this is possible but still with many limitations, and what I remember Google Gears and Adobe Air do have some limited web 2 local file interaction... So best and most simple solution you are left with is pointing to a url instead of a file on a c:\ drive.
    PS The reason why it works when you start the html from your local PC has todo with the fact that the browser detects that the html is not running in the web at that moment therefor allowing the access.
    Cheers,
    Benjamin Houttuin

  • How to open and close period?

    Hi all,
    How can I open and close Period in MM module?
    thanks

    Hello,
    First of all read SAP Note 487381. T-code MMPI. If you don't have a backup or a request saved on development client with the previous period, you may try to modify the record on the table MARV (don't try yourself - discuss with a specialist who know your SAP system). If there isn't any records it won't be a problem!
    Good Luck!

  • How to open and save file like the Notepad Demo do?

    I am a newer to Java Web Start. I found that in the Notepad Demo, when user try to open or save file, a message box appear and give the user some security suggestions.
    In my application, I used a JFileChooser and set the <security> element to <j2ee-application-client-permissions/> in the jnlp file. But the application will thow an exception:
    access denied (java.io.FilePermission C:\Documents and Settings\Administrator\desktop\Java Web Start.lnk read)
    Can someone tell me how to solve this problem. By the way, where can I find the source of the Notepad Demo. I want my application to open and save file just like the Notepad Demo do.

    The Notpad demo uses the JNLP api to read and write files. The api doc can be found at:
    http://java.sun.com/products/javawebstart/docs/javadoc/index.html
    Although the Notpad demo source is not available, there is other sample code available at:
    http://developer.java.sun.com/developer/releases/javawebstart/
    Included here is the webpad demo, which uses the FileOpenService and
    FileSaveService API's.

  • How to open and save pictures from 1 folder at the same time?

    Is there a way to open and save pictures from 1 folder at the same time?
    I'm creating a vi that resizes the picture but I want to do it with 1 folder at a time... Is this possible?
    greetings!

    Hi Kway,
    Here you are. I wrote a file a customer times ago & It did what you want!
    Just see the attachements and keep me inform.
    Regards,
    Julien Roland - District Sales Manager
    NI Belgium - Technical Support
    Don't forget to rate a good answer
    Attachments:
    Test existing Files.vi ‏23 KB
    Delete files from array of files (SubVI).vi ‏16 KB

  • How to Open and Save files

    I have a problem to open and save the files.here is my code. can anyone help me to open the files.
    public void actionPerformed(ActionEvent e) {
    if ("open".equals(e.getActionCommand())) {
    FileDialog fdopen=new FileDialog(this, "Load File", FileDialog.LOAD);
    fdopen.show();
    Thanks for ur time

    Hi fbnmir or who ever can answer my question,
    My problem is similar to the code you wrote. I'm trying to make (or rather complete a half done) editor for text files. For opening and saving files I have so far:
    public void actionPerformed(ActionEvent ae){
    FileDialog filedialog;
    final SearchDialog searchDialog;
    String arg = (String)ae.getActionCommand();
    // the Open ... case
    if(arg.equals(Editor.fileLabels[0])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[0] +
                        " has been selected");
    filedialog = new FileDialog(editor, "Open File Dialog", FileDialog.LOAD);
    filedialog.show();
    if(Editor.VERBOSE){  
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Open file = " + filedialog.getFile());
    System.err.println("Open directory = " + filedialog.getDirectory());
    //the Save ... case
    if(arg.equals(Editor.fileLabels[1])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[1] + " has been selected");
    filedialog = new FileDialog(editor, "Save File Dialog", FileDialog.SAVE);
    filedialog.show();
    if(Editor.VERBOSE){ 
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Save file = " + filedialog.getFile());
    System.err.println("Save directory = " + filedialog.getDirectory());
    These are two components of a MenuHandler class. The problem with this code is that in the text editor window, even if the Open button is pressed the file I want to open isn't displayed. Although the System.err (I think that's what it is called) says:
    Open ... has been selected
    Exited filedialog.setVisible(true);
    Open file = tutorial_01.rtf
    Open directory = C:\dhruba\epgy_2006\tutorial\
    Save ... has been selected
    Exited filedialog.setVisible(true);
    Save file = test.txt
    Save directory = C:\dhruba\epgy_2006\tutorial\
    How can I actually display the file I want to open, or save some text I've written?
    I would appreciate any help, thanks.

  • Would you Open and Close DAQmx tasks within a function or Globally

    Hi Guys,
    This should start something.
    The subject is DAQmx Tasks.
    If you were writing a function that is called many times, say MeasureVolts (double *Value) to obtain a reading from an Analogue Input Channel.
    Would you.
    1. open and start the task inside the function, do the measurement and then close the task inside the same function.
    or
    2. open the task globally and later do the measurement inside the function using the global task then close the task only when the application is closed.
    I am mostly concerned with the overhead of task generation and closing, what do you guys and girls out there do?? and what is the general opinion?
    I would appreciate your views.
    Regards
    Paul.

    I would definitely NOT keep configuring and clearing (I think that's what you mean by open and close) the same task over and over.  I would configure once, read many times in my main app, then stop & clear once.
    I typically like to package such data acq into an "Action Engine" that keeps track of its own DAQmx task id so I don't need to sling that task id wire around into multiple parallel loops / vi's.  Attached is a very stripped-down example for Digital Input. 
    I would typically do more with error testing and would make the "Action" enum into a typedef custom control, but this gives you the basic idea.  The action engine approach works very nicely when there's a small # of different kinds of input parameters and output info needed to support all the necessary action cases.   When you start needing a large number of differnent kinds of inputs and outputs to support the desired actions, then you start having difficulty with (1) having enough terminals to wire and (2) remembering which inputs and outputs are meaningful for which actions.
    -Kevin P.
    Attachments:
    DI Action Engine.vi ‏75 KB

  • How to open and read data from text file in PL/SQL

    We have a project ,need to open a file containing entries of data
    ,then process those data records one by one to update the
    database.This operation shoulbe be done in the database
    enviroment. Is there any hint about the file operation in
    PL/SQL? How to open the file and get one record ,maybe one line,
    and parse and get the data field ?
    thanks
    defang

    There was also a question on this over at AskTom
    (asktom.oracle.com) about a week ago complete with sample code.
    The pointer to the sample code is here:
    <A HREF="http://asktom.oracle.com/pls/ask/f?
    p=4950:8:::::F4950_P8_DISPLAYID:464420312302
    TARGET=_blank>http://asktom.oracle.com/pls/ask/f?
    p=4950:8:::::F4950_P8_DISPLAYID:464420312302</A>
    Admittedly it's about Win95, but the principles should apply.
    Yours faithfully, Graham Reeds.
    [email protected] | http://omnieng.co.uk/

  • How to open/convert RAW- files from new CANON 5D Mk III in LR 3 and CS 5?

    Hallo!
    The RAW- files from my new CANON 5D Mk III are not convertible into LR 3 and CS 5.
    What is the reason and how to solve the problem?

    The work around of converting the CR2 to dng either with the dng converter or ACR 6.7 will allow working in LR and CS5 but not with the latest raw conversion engine from Adobe i.e PV 2012.
    Remember to keep a copy of the CR2 files if you wish to utilize the Canon software.

Maybe you are looking for

  • My desktop crashed and I had to reinstall itunes how do I transfer all the apps and their information, music, and contacts from my iphone to the itunes software?

    My desktop crashed and I had to reinstall itunes software.  My iphone has all my apps with their data, contacts, photos, videos & music.  How can I import all of the information and data on my iphone into itunes?  I downloaded one app that is a to-do

  • Adding text field to e-mail subject

    Hi all, I've got a button on my form that should submit the form in pdf format, to a fixed mail address with a fixed subject message, that has variable content dragged from a text field, i.e "Subject; New e-DCR <TextField12.rawValue>" Firstly, I got

  • How can i download the Adobe flash player 11?

    I have tried downloading the adobe flash player 11 because if i dont have this i cant access the things I like doing on my computer. So i clicked on it and followed the indtructions but then it told me to close programs listed, so i did. After i did

  • Dynamic SQL Qeury.

    If the SELECT query has dynamic WHERE clause then in CRM side it fails if the number of records are more than 13000 in table from where we are picking up the values. We have used it many a place in whole application. Is there any way to handle it by

  • Vendor evaluation - Avrge Variance

    hi, when I excuting me6b ranking by material , i m getting individual  scores and average variance column also. please clarify me how  this average variance calculation happens ? how it be linked with overall score. Thanz in Advance. aparji