Display document data in dialog box
I am using a folder level script to do the following:
Get a specific XMP field value from an open PDF file:
this.info.InDesignFileName
Define a dialog box
Create a menu item that calls the dialog box
But for the life of me, I cannot get the dialog creation function to populate the XMP value into a static text item.
The function below is modified from the example right out of the Acrobat Javascript API Reference.
var inDesignNameDialog = {
initialize: function (dialog) {
// store InDesignFileName XMP
//var indfn = this.info.InDesignFileName
// Create a static text containing the current date.
/*var todayDate = dialog.store()["date"];
todayDate = "Date: " + util.printd("mmmm dd, yyyy", new Date());
dialog.load({ "date": todayDate });
var todayDate = dialog.store()["indfn"];
currFN = "Date: " + this.info.InDesignFileName;
dialog.load({ "indfn": currFN });
commit:function (dialog) { // called when OK pressed
var results = dialog.store();
// Now do something with the data collected, for example,
console.println("Your name is " + results["fnam"]
+ " " + results["lnam"] );
description:
name: "Personal Data", // Dialog box title
align_children: "align_left",
width: 350,
height: 200,
elements:
type: "cluster",
name: "Your Name",
align_children: "align_left",
elements:
type: "view",
align_children: "align_row",
elements:
type: "static_text",
name: "First Name: "
item_id: "fnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
type: "view",
align_children: "align_row",
elements:
type: "static_text",
name: "Last Name: "
item_id: "lnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
type: "static_text",
name: "InDesign File Name: ",
char_width: 50,
item_id: "indfn"
alignment: "align_right",
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
By gosh, you are right. Thanks for the tip.
However, it still does not seem to be working:
The static text field is just empty.
The debugger shows error:
parentDoc is not defined
11:Menu:ExecReferenceError: parentDoc is not defined([object ADMDialog])@Menu:Exec:11
execDialog([object Object])@:0
@Menu:Exec:1
Your name is
Code as it stands right now:
var inDesignNameDialog = {
initialize: function (dialog) {
var currFN = dialog.store()["idfn"];
currFN = parentDoc.info.InDesignFileName;
dialog.load({ "idfn": currFN });
commit:function (dialog) { // called when OK pressed
var results = dialog.store();
// Now do something with the data collected, for example,
console.println("Your name is " + results["fnam"]
+ " " + results["lnam"] );
description:
name: "Personal Data", // Dialog box title
align_children: "align_left",
width: 350,
height: 200,
elements:
type: "cluster",
name: "Your Name",
align_children: "align_left",
elements:
type: "view",
align_children: "align_row",
elements:
type: "static_text",
name: "First Name: "
item_id: "fnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
type: "view",
align_children: "align_row",
elements:
type: "static_text",
name: "Last Name: "
item_id: "lnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
type: "static_text",
name: "InDesign File Name: ",
char_width: 50,
item_id: "idfn",
alignment: "align_right",
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
Similar Messages
-
CS3 Data Merge - Missing Fileds in Data Merge Dialog Box
Indesign CS3 5.0.1, XP SP2
Hi all,
I have a document that I have applied a Data Merge to.
I use a table in Excel 2003 with contact details, name, address etc...
When I open the Automation> Data Merge Dialog box I no longer see the list off all the fields as in Excel.
However, I can preview and create the mail merged document and place items using tags e.g <<Field 1>>.
When I try to remove the Data Source InDesign always crashes But I can relink to a new Data Source, this does not solve the problem.
Thank-you all for your time and help!
Alu>>Did you perform the merge? Once you do, ID creates a new document. Which document are you looking at?
I am using the original document, not the product of the mail merge.
>>I assume it's a CSV file. ID can't use and Excel file for data merge.
Correct.
I have tried saving the document as an .inx file and then re-opening, but I still cannot view the .csv data merge fields from the Automation> Data Merge dialog box.
Any Ideas? - thx for the response Bob & K -
How to Display an Alert or Dialog Box in Flash CS4?
I would like to have a quick message displayed on the screen for a few seconds after a user clicks a button. I can't seem to find an Alert Box or Dialog Box option in Flash CS4...can anyone help?
Thanks.
Daveas2 has the window component. and for both as3 and as2 it's pretty simple to create your own movieclip to use as an alert window.
-
Displaying Text in a Dialog Box
I'm learning Java by reading the book : Java How to Program, 5th edition. Starting chapter 2, all the example programs use windows or dialog boxes to display output instead of display output in the command window. Can someone explain to me why is this necessary ? I'm a little confused reading some of the examples in this book.
personally, i dont think it's a good approach. for beginners, it would be better to learn the basic java concepts and enssential classes first cause this would give you a easier starting point. Then, trying mix your code up with graphical user interface(GUI), once you've got some basic ideas and coding experiences. for example, the tutorials on this web site does adopt this approach.
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
hope it helps. good luck. -
Preview document in open dialog box
I have a brand new IMAC (intel) and I am running appleworks 6 on it successfully. However, on my old IMAC, when I went to the open document dialog box, it would give me a graphic thumbnail of each document as I scrolled down. Now I just get a text description. Is there a preference somewhere to change this?
Thanks in advance.
IMAC Mac OS X (10.4.4)For AppleWorks files, that's what I'm seeing too, whether I'm in the Open dialogue or in a Finder window.
The only files I see previews of content for are ones for which the application that created them also creates a thumbnail image of the file's contents. A quick look just now showed these were .gif, .jpg, .pict .pdf and .txt files, all saved by applications other than Appleworks.
I can't recall the feature having been different in the past (save when the Open dialogue offered no options to the way files were listed).
Regards,
Barry -
Display a message in dialog box while creating PO
Hi Experts,
i want to dispaly a popup message while creating PO(me21n),pop up should be trigger when we try to save two different plants in the item level while creating PO. for this purpose i have used enchancement mm06e005 and FM EXIT_SAPMM06E_016.
i want to pass this message to standard message in me21n
transaction and should get the message in dialog box
user should not able to save PO until he corrects the plants in item level.
please help me
thanks in advance,
Rama.Hi,
You have to check 1st this user-exit is triggering or not while saving the P.O.
If it triggers then you can put the code what you want. The message type should be Error type why becuase then only it won't allow further until it correct.
Thanks
Ganesh -
Webutil client_get_file_name does not display the select file dialog box
hi all,
i'm using oracle forms :
Forms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Release 10.2.0.1.0 - 64bit Production
Oracle Toolkit Version 10.1.2.0.2 (Production)
PL/SQL Version 10.1.0.4.2 (Production)
Oracle Procedure Builder V10.1.2.0.2 - Production
PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
Oracle Query Builder 10.1.2.0.2 - Production
Oracle Virtual Graphics System Version 10.1.2.0.2 (Production)
Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production)
Oracle Multimedia Version 10.1.2.0.2 (Production)
Oracle Tools Integration Version 10.1.2.0.2 (Production)
Oracle Tools Common Area Version 10.1.2.0.2
Oracle CORE 10.1.0.4.0 Production
my question is:
why can't i get the client_get_file_name dialog to open when i compiled the form on unix but it works fine when compiled on my pc. I have matched the webutils' setting my pc = my unix server.
here's both the java console messages:
###JAVA CONSOLE messages when running standalone on my pc (winxp): NOTE:it works fine###
Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.28-internal Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Admin
Proxy Configuration: no proxy
JAR cache enabled
Location: C:\Documents and Settings\Admin\Oracle Jar Cache
Maximum size: 50 MB
Compression level: 0
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
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://xxxx:9999/forms/java/frmall_jinit.jar from JAR cache
Loading http://xxxx:9999/forms/java/frmwebutil.jar from JAR cache
RegisterWebUtil - Loading WebUtil Version 10.1.2.0
Loading http://xxxx:9999/forms/java/jacob.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
2007-Mar-22 15:08:27.750 WUI[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.765 WUF[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.765 WUH[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.781 WUS[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.781 WUT[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.843 WUO[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.843 WUL[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:27.859 WUB[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:08:28.00 WUI[getProperty()] Getting property WUC_BEAN_VERSION
2007-Mar-22 15:08:28.15 WUI[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.15 WUI[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.15 WUI[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.ffisamp.dll
2007-Mar-22 15:08:28.15 WUI[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:08:28.15 WUI[loadSettings()] Local properties file loaded
2007-Mar-22 15:08:28.31 WUT[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.jacob.dll
2007-Mar-22 15:08:28.31 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:08:28.31 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.JNIsharedstubs.dll
2007-Mar-22 15:08:28.31 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:08:28.31 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.d2kwut60.dll
2007-Mar-22 15:08:28.31 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:08:28.31 WUB[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUL[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUO[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUS[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUH[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:28.31 WUF[setProperty()] Setting property WUC_SRV_LOGGING to 0
2007-Mar-22 15:08:38.171 WUF[setProperty()] Setting property WUF_GFN_DIRNAME to C:\
2007-Mar-22 15:08:38.171 WUF[setProperty()] Setting property WUF_FILENAME to false
2007-Mar-22 15:08:38.171 WUF[setProperty()] Setting property WUF_FILTER to *.*
2007-Mar-22 15:08:38.171 WUF[setProperty()] Setting property WUF_GFN_MESSAGE to false
2007-Mar-22 15:08:38.171 WUF[setProperty()] Setting property WUF_GFN_MULTISELECT to FALSE
2007-Mar-22 15:08:38.171 WUF[getProperty()] Getting property WUF_GFN_OPENFILE
2007-Mar-22 15:09:22.437 WUT[getProperty()] Getting property WUT_MAX_BYTES
2007-Mar-22 15:09:22.437 WUF[setProperty()] Setting property WUF_FILENAME to C:\firdaus\K-I-S-07-v6.0.2.614.zip
2007-Mar-22 15:09:22.437 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 2
2007-Mar-22 15:09:22.437 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
2007-Mar-22 15:09:22.437 WUF[setProperty()] Setting property WUF_FILENAME to C:\firdaus\K-I-S-07-v6.0.2.614.zip
2007-Mar-22 15:09:22.437 WUF[setProperty()] Setting property WUF_FILE_ATTRIBUTE to 4
2007-Mar-22 15:09:22.437 WUF[getProperty()] Getting property WUF_FILE_ATTRIBUTE
2007-Mar-22 15:09:22.453 WUT[getProperty()] Getting property WUT_STATUS
2007-Mar-22 15:09:22.453 WUT[setProperty()] Setting property WUT_FILE_INFO to C:\firdaus\K-I-S-07-v6.0.2.614.zip|0|S|Y|Muatnaik fail ke C:\firdaus\fmb\admin\K-I-S-07-v6.0.2.614.zip untuk simpanan.|Sila Tunggu...
2007-Mar-22 15:09:22.453 WUT[getProperty()] Getting property WUT_FILE_INFO
##Note: i close the web browser & java console. and opened a new web browser##
###JAVA CONSOLE messages when running IAS 10g on Unix###
Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.28-internal Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Admin
Proxy Configuration: no proxy
JAR cache enabled
Location: C:\Documents and Settings\Admin\Oracle Jar Cache
Maximum size: 50 MB
Compression level: 0
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
q: hide console
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
Loading http://XXX.XXX.XXX.XXX:9999/forms/java/frmwebutil.jar from JAR cache
Loading http://XXX.XXX.XXX.XXX:9999/forms/java/frmall_jinit.jar from JAR cache
RegisterWebUtil - Loading WebUtil Version 10.1.2.0
Loading http://XXX.XXX.XXX.XXX:9999/forms/java/jacob.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.2
2007-Mar-22 15:12:43.984 WUI[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.15 WUI[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.15 WUF[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.31 WUF[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.31 WUH[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.31 WUH[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.46 WUS[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.46 WUS[SessionFunctions.init()] Dispatcher Monitoring interval set to 5
2007-Mar-22 15:12:44.46 WUS[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.62 WUT[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.62 WUT[SessionFunctions.init()] Max Transfer chunk size set to 16384
2007-Mar-22 15:12:44.62 WUT[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.125 WUO[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.140 WUO[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.140 WUL[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.140 WUL[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.140 WUB[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
2007-Mar-22 15:12:44.156 WUB[VBeanCommon.getIPAddress()] XXX.XXX.XXX.XXX
2007-Mar-22 15:12:44.500 WUI[getProperty()] Getting property WUC_BEAN_VERSION
2007-Mar-22 15:12:44.500 WUI[getProperty()] Value of WUC_BEAN_VERSION=10.1.2.0
2007-Mar-22 15:12:44.687 WUI[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:44.687 WUI[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:44.687 WUI[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.ffisamp.dll
2007-Mar-22 15:12:44.687 WUI[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:12:44.687 WUI[loadSettings()] Local properties file loaded
2007-Mar-22 15:12:44.687 WUI[getProperty()] Value of WUC_GET_LOCAL_PROPERTY=1.0
2007-Mar-22 15:12:44.890 WUT[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:44.890 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.jacob.dll
2007-Mar-22 15:12:44.890 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:12:44.890 WUT[getProperty()] Value of WUC_GET_LOCAL_PROPERTY=1.0
2007-Mar-22 15:12:45.93 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.JNIsharedstubs.dll
2007-Mar-22 15:12:45.93 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:12:45.93 WUT[getProperty()] Value of WUC_GET_LOCAL_PROPERTY=1.0
2007-Mar-22 15:12:45.296 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.d2kwut60.dll
2007-Mar-22 15:12:45.296 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
2007-Mar-22 15:12:45.296 WUT[getProperty()] Value of WUC_GET_LOCAL_PROPERTY=1.0
2007-Mar-22 15:12:45.500 WUB[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:45.500 WUL[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:45.500 WUO[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:45.500 WUS[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:45.500 WUH[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:12:45.500 WUF[setProperty()] Setting property WUC_SRV_LOGGING to 1
2007-Mar-22 15:13:12.890 WUF[setProperty()] Setting property WUF_GFN_DIRNAME to C:\
2007-Mar-22 15:13:12.890 WUF[setProperty()] Setting property WUF_FILENAME to false
2007-Mar-22 15:13:12.890 WUF[setProperty()] Setting property WUF_FILTER to false
2007-Mar-22 15:13:12.890 WUF[setProperty()] Setting property WUF_GFN_MESSAGE to false
2007-Mar-22 15:13:12.890 WUF[setProperty()] Setting property WUF_GFN_MULTISELECT to FALSE
###Note: No error messages. it just hangs (nothing happens), and i could not do anything else on the form or even close it. i have to close the web browser.
sorry if my question is long.
Message was edited by:
wajatimurI had logged Bug 5703183 and this seems similar to that.
Solnt was
Copy frmwebutil.jar from a patched Oracle DS installation where Webutil 10.1.2.x exist to the IAS
Also clear the jinitator/javaplugin cache
Rajesh Alex -
No display of error message log in dialog box
Dear MM Experts,
During enter incoming invoice (MIRO), when we click simulate after entering all necessary data, all error & warning messages are displayed in a dialog box if there is red traffic light. In our case despite red traffic light error messages are not displayed as shown in below screen shot. Only warning messages are displayed & document canu2019t be posted. Please let me know if anyone has encountered such behavior & knows the solution. We just want to see the error messages in dialog boxes so that necessary data can be entered and document can be posted.
Additional information: 1. No GR needs to be done, 2. GR based IV is unchecked in PO, 3. No validation is active for the company code,
Thanks & regards,
AvinashHi,
Thanks for your response.
Our problem is not to post a particular invoice doument, the main problem is that error log is not displayed in MIRO. For example if balance is not zero then this error should be displayed in error log dialog box, which is not happening due to which we are not able to post any invoice document as error is not known to the user. Please let me know if any suggestions.
Additional information: We have deactivated all validations & BADis. We also tried to compare with other systems where error log is displayed properly however our ABAP consultant could not find any difference. Any Input on how to compare is also welcome.
Thanks & best regards,
Avinash -
Modeless Dialog Box Not Displaying Contents
I have created a simple modeless dialog box. Although the dialog box and title appear, the contents (a label) do not appear. The dialog box does display correctly if the dialog box is switched to a modal box.
I got into this problem because I also cannot get labels to change after their initial display on the main frame. I've tried repaint() and Thread.sleep().
Please help me, I am a newbie to Java.
Sincerely,
JohnI actually had a similar problem with a JDialog containing only a progress bar, which ended up being a problem with Swing rather than my code (the bug report has already been filed). Adding a second component to the dialog fixed the problem, counterintuitive as that seems. Try it and see if that helps... If the label is a JLabel, you might try calling revalidate() on it to get the text to update.
Ian -
New script dialog box only displays momentarily
FM10 in TCS3 on Windows XP
My coworker and I decided to investigate Extendscript and when we select File>Scripting>New from the main toolbar, the New Script dialog box flashes momentarily and then disappears. However, selecting Run displays the Choose Script dialog box, and selecting Catalog displays the Script Library.
We have the latest patches and have installed DITA-FMx, FrameSLT, and SDLAuthorAssistant in FM. Could any of those be affecting the scripting function?
Thanks in advance.
mUsing TechCommSuite 3.0 on Windows XP.
I always like to close loops and this posting is no exception.
After almost two weeks of diligent sleuthing by Adobe techs and our own security personnel, we determined that the problem of ExtendScript not launching was an in-house problem.
We have a DLP application that interfaces with our desktops for security purposes. We needed to identify the ExtendScript.exe that was running in order to allow it to function. Our security guy performed some wizardry and voila! I had my ExtendScript window.
Mary -
Hi. I'm trying to get my AIR application to load a PDF document from the dialog box using File Reference Class.
With the code that I have if I use a regular Loader then I can get a PNG image to load into a container and display on the screen. But PDF's require HTML Loader which seems not to accept event.target.data because it is expecting a String.
This is the error I got
TypeError: Error #1034: Type Coercion failed: cannot convert "[object FileReference]" to flash.net.URLRequest.
at test_pdf_load_from_dialogfla_fla::MainTimeline/loadFile()[test_pdf_load_from_dialogfla_fl a.MainTimeline::frame1:61]
[UnloadSWF] test_pdf_load_from_dialogfla.swf
Here is my code:
import flash.net.URLRequest;
import flash.display.MovieClip;
import flash.html.HTMLLoader;
import flash.net.FileReference;
import flash.net.FileFilter;
var file:FileReference=new FileReference();
var container:MovieClip=new MovieClip();
addChild(container);
var i:Number=1;
// button is an object on the stage, not being called via actionscript
button.addEventListener(MouseEvent.CLICK, showDialog);
var myFile:FileReference;
var myFileLoader:HTMLLoader;
function showDialog(e:MouseEvent):void{
myFile=new FileReference();
var PDFFileType:FileFilter=new FileFilter("PDFs (*.pdf)","*.pdf");
myFile.browse([PDFFileType]);
myFile.addEventListener(Event.SELECT, selectFile);
function selectFile(e:Event):void{
myFile.addEventListener(Event.COMPLETE, loadFile);
myFile.load();
myFileLoader=new HTMLLoader();
function loadFile(e:Event):void{
myFileLoader.load((e.target).toString());
(with the new forum selection I also can't seem to put this topic into the ActionScript location of the forum for Flash Pro.)Success!!
I was pondering on this subject for several hours when I thought "perhaps the e.target declaration in the loadFile function might contain the "name" property.
When I used a trace statement to test this, my thoughts revealed that to be accurate. The e.target.name call does indeed populate the Output console with the correct file name.
To be sure I did the following:
myFileLoader.load(new URLRequest(String(e.target.name)));
myFileLoader.width=[[set width to anything other than the default of 0 to display the PDF content of the HTMLLoader]]
myFileLoader.height=[[ditto from previous line, the default is 0 which would make the PDF content invisible]].
I am so pleased to have had this inspiration and also to the fact that the ActionScript documentation that I found had good examples to follow. -
Hi,
I have an ALV on suppose screen 3000, I have created a button in the tool bar to call another ALV, but my question is, can we display ALV in modal dialog box screen(because the requirement is to display ALV as a popup)
So when i changed the screen type to normal screen, my alv is coming,,but when i change the screen type to modal dialog box, then no ALV is being displayed in the output. Only blank screen is displayed.
Can you please help me.
Thanks.Hello
The problem is that you have to take into account that the ALV in the popup (or modal dialogbox) is displayed on a different screen level:
level 0 = main screen
level 1 = 1st popup
level 2 = 2nd popup
We have up to 9 screen level available.
The following sample report ZUS_SDN_ALV_IN_POPUP is a variant of my sample report ZUS_SDN_TWO_ALV_GRIDS.
Depending on whether you mark P_POPUP or not the second ALV grid is additionally displayed on a popup.
*& Report ZUS_SDN_ALV_IN_POPUP
*& Thread: ALV in modal dialog box
*& https:||<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="762642"></a>
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
* PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
* PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
REPORT zus_sdn_alv_in_popup.
TYPE-POOLS: abap.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
" containers and ALV grids for main screen
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
" container and ALV grid for popup
go_docking3 TYPE REF TO cl_gui_docking_container,
go_grid3 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
PARAMETERS:
p_popup AS CHECKBOX DEFAULT ' '.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
IF ( p_popup = abap_true ).
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'POPUP'
* IMPORTING
* rc =
ELSE.
* Triggers PAI of the dynpro with the specified ok-code
* * CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ). " not on 4.6c
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DETAIL'
* IMPORTING
* rc =
ENDIF.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
" Select data
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
PERFORM init_controls.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the popup
gd_repid = syst-repid.
CALL METHOD go_docking3->link
EXPORTING
repid = gd_repid
dynnr = '0200'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0 " main screen -> level 0 !!!
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
" Create container and grid for popup.
* Create docking container
CREATE OBJECT go_docking3
EXPORTING
parent = cl_gui_container=>screen1 " !!! popup !!!
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
" NOTE: Starting from a main dynpro (screen level 0) the first popup
" (or modal dialogbox) is on level 1 !!!
" Using cl_gui_container=>screen0 fails to display ALV grid.
CREATE OBJECT go_grid3
EXPORTING
i_parent = go_docking3
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " INIT_CONTROLS
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE syst-dynnr.
WHEN '0100'.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN 'POPUP'.
PERFORM entry_show_details.
go_grid3->refresh_table_display( ). " required
CALL SCREEN '0200' STARTING AT 5 5
ENDING AT 150 30.
WHEN OTHERS.
ENDCASE.
WHEN '0200'.
set screen 100. leave screen.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
Add or Edit Text Dialog Box Disappeared
I am attempting to add text to my pdf using the add or edit text tool in Acrobat Pro X. However, the dialog box that allows me to change fonts, size, color, etc. has disappeared. Does anyone know how to make the dialog box come back?
Hi,
This is a new problem. It started about 2 days before I posted the question. I have not updated my Acrobat recently and I was previously able to use the dialog box with no problem. I have tried in several different documents and the dialog box is not showing up.
Thanks for your assistance. -
I would like Adobe to utilize the non-legacy save/open Windows 7 dialog box
So I downloaded the trial for CS5.5 Master Suite and found that the open/save dialog box is the same thing from CS5. This is a huge disappointment.
Reason being is explained right here: http://www.sanneblad.com/2010/06/18/customizing-the-open-and-save-dialogs-in-adobe-cs5-for -windows/
Common File Dialog is being used still by CS5 and CS5.5 which is outdated and legacy.
[Starting with Windows Vista, the Open and Save As common dialog boxes have been superseded by the Common Item Dialog. We recommended that you use the Common Item Dialog API instead of these dialog boxes from the Common Dialog Box Library.]
The Open dialog box lets the user specify the drive, directory, and the name of a file or set of files to open. You create and display an Open dialog box by initializing an OPENFILENAME structure and passing the structure to the GetOpenFileName function.
The Save As dialog box lets the user specify the drive, directory, and name of a file to save. You create and display a Save As dialog box by initializing an OPENFILENAME structure and passing the structure to the GetSaveFileName function.
Explorer-style Open and Save As dialog boxes provide user-interface features that are similar to the Windows Explorer. However, the system continues to support old-style Open and Save As dialog boxes for applications that must be consistent with the old-style user interface.
In addition to the difference in appearance, the Explorer-style and old-style dialog boxes differ in their use of custom templates and hook procedures for customizing the dialog boxes. However, the Explorer-style and old-style dialog boxes have the same behavior for most basic operations, such as specifying a file name filter, validating the user's input, and getting the file name specified by the user. For more information about the Explorer-style and old-style dialog boxes, see Open and Save As Dialog Box Customization.
The following illustration shows a typical Explorer-style Open dialog box.
http://msdn.microsoft.com/en-us/library/bb776913%28v=VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx
It appears it would be a simple retooling of the code in order for this to work. I truly hope that Windows 8 will force all software developers to utilize the new Common Item Dialog API.We've been trying to - but we still have to support XP and Vista.
It appears it would be a simple retooling of the code in order for this to work.
Um, no, not that simple. -
How do I stop Yahoo mail's popup dialog box from changing the tab focus?
Hi,
When I have a tab opened to Yahoo mail and I open a Yahoo email on my other computer or Blackberry, there's a time delay and at some point, Yahoo shifts my browser focus to display a pop-up dialog box that says "You have been disconnected from chat because you have signed into Yahoo! Messenger from another computer." I can't even switch back to the tab I was on without dismissing the popup.
I'd love it if I could turn off the pop-up, - don't care about the disconnection - but in the meantime, is there some way to prevent Yahoo from changing my tab focus?
Thanks!Hi Douglass,
You will need to navigate to the following folder.
/Users/yourusername/Library/Mail/V2/MailData
and backup the following file... MessageRules.plist
Open the file in BBedit to confirm your rules are infact inside that particular plist file as Mail will also create backups occasionally.
Once you reinstall, do a compare/replace with the newly created MessageRules.plist and you should be able to bring your "old" rules into your fresh install.
as for mailboxes, those are contained within this folder
/Users/yourusername/Library/Mail/V2/Mailboxes
and it will be up to you to backup those files and File/Import Mailboxes them into the new install.
Maybe you are looking for
-
Apple's Pages 5.0 is an unmitigated disaster
If I was not already in too deep in the Apple ecosystem I would leave after this terrible experience.
-
Macbook 'seizing' every 5 seconds
Hi Chaps, I'm running OS X 10.8 on the following spec: Model Name: MacBook Pro Model Identifier: MacBookPro5,5 Processor Name: Intel Core 2 Duo Processor Speed: 2.53 GHz Number of Processors: 1
-
I had to download Firefox in order to take some tests online for continuing education. I have lost Yahoo as my homepage and have your site instead. How do I get yahoo back as my home page? I do not want Firefox as my home page...It has also wrapped i
-
Good Day! I'm new to CEP. I would like to ask how can I develop a custom file adapter wherein it tries to get only new lines added into the file. I'm trying also to integrate this with BAM for reporting. Any tutorials out there which I can refer upon
-
Can anybody tell me how to prevent the user from entering information in fields. Thanks. Tariq e-mail: [email protected] null