Retrieving form components added via javascript

I looked around and couldn't find anything on this. I'm adding form elements dynamically using Javascript. How do I read those dynamically added elements? Faces doesn't pick them up and they're not coming through in the request attributes (HttpServletRequest#getAttribute(String)). Anybody know how this works or knows of a resource? Any help would be appreciated.

You should look in the request parameter map, not the request attributes map. See ExternalContext.getRequestParameterMap() or use the JSF-reserved keyword param in your EL.

Similar Messages

  • Uploading a File with AppleScript via JavaScript

    Hi everybody,
    being new to AppleScripting and JavaScripting I'm faced with the following problem:
    Is it possible to make AppleScript to input the path for a file to be uploaded via JavaScript? If yes, what should be the correct Path Format and how to wrap it up the JavaScript action into AppleScript? I've tried a few comands but to no success.
    On the webpage in question, there's a "Choose" button, that is defined as follows:
    <input type=​"file" class=​"gwt-FileUpload" name=​"swfFile">​
    I've been trying to use the following syntax:
    do JavaScript "document.getElementsByName('swfFile')[0].value('Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf')" in document 1
    as well as this one, where the Path is definitelly understood by shellscript:
    do JavaScript "document.getElementsByName('swfFile')[0].value('/Users/myaccount/Desktop/Scrap book/!动画.swf')" in document 1
    The name of the file is (and must remain) in chinese, but for testing purposes I have also tried files with english names, without success.
    Currently I'm using a solution with JavaScript comand:
    do JavaScript "document.getElementsByName('swfFile')[0].click()" in document 1
    to click the finder  window to browse for the file, and manipulating  keystrokes by using System Events to find the right file, but it's not  infallible with a number of files and it's hardly an ellegant sollution.
    Any idea what I'm doing wrong?
    Cheers!

    @twtwtw
    the do JavaScript "document.forms[0].submit()" command didn't work, so I kept the original way of submitting by clicking the button. The submitting part works, but not the input file part.
    That's the code I used
        tell application "Safari"
            do JavaScript "document.getElementById('gwt-uid-13').value='on'" in document 1
            do JavaScript "document.forms[0].elements['swfFile'].value=" & "'" & SWFFilePath & "'" in document 1
            do JavaScript "document.getElementsByClassName('gwt-SubmitButton')[0].click()" in document 1  
            delay 1
        end tell
    with SWFFilePath set as the POSIX path as well as the default file format
    Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf'
    but it did not work.
    If you've got the time, feel free to upload an .swf. The service is free and the server delats uploaded files after 15 min. (if you don't have any, you may try an empty .txt file instead - it won't get converted, but the point is just to get it into the input box).
    In the meantime, I'll have a look at adayzdone's suggestion. It's not perfect (the downside being that it requires the window to be active, so I can't run the script in the background or with my screensaver & password on), but it's still more reliable than my sollution with navigating arrowkeyes.

  • Adobe Forms - Page Break via a Conditional Break

    Having read through the forum I am getting the impression that Page Breaks is a bit of a problem.
    I can enforce a page break between datasets by setting "After:" to "Goto Next Page", on the Object->Pagination tab, however this results in a blank page at the end of the entire output which is just the Master Page with all the static elements.
    The 'Conditional Breaks' sounds like the logical point to force a page break based on a combination of inequality or if a particular data element equals a known value.
    However, I don't seem to be able to get the 'Conditional Break' to work.
    So, the question I would like to ask, is how can you tell if the conditional break logic is correct and whether or not it is running? For example on an ABAP system is it possible to run it and debug it?
    My attempts at getting the break to open a pop up or write to disk via JavaScript fails, which is leading me to think they  are being ignored by the Adobe Form at both the server and client level.
    Is it possible that I have missed another setting somewhere else in the Adobe form configuration?

    Hello Jason!
    You are right that conditions (and all scripting) are bit tricky in this solution. Still they work.
    Debugging of AIF at ABAP side is not possible due to the architecture of the solution - from the ABAP POV it is just a web-service call and receiving result (PDF) back. You can't stop it on midpoint or intercept it somehow.
    At the same time there are other ways to check it.
    First, you can enable trace and saving additional info in SFP transaction under Utilities -> Settings.
    Details see [here|http://help.sap.com/saphelp_nw70/helpdata/EN/f7/a04aee0cb94978a011401311efe603/frameset.htm]
    And the nice way to check if your condition block is taken into the account is simple check like 1 = 2.
    If this works and you receive page break than all you need is find errors in your condition syntax, otherwise the problem is somewhere else.
    Regards,
    Petr Perstnev

  • Accessing Properties of Individual Tool Buttons via JavaScript

    Hi all!
    I am new to both this forum and scripting Acrobat so please excuse me if the question sounds naive.
    I am trying to find a way to access the properties of individual tool buttons via JavaScript (if there is one). I could not find it yet in JS API Reference. If anybody can help me or direct me to the right way, I will greatly appreciate that.
    For example, in 'Comment & Markup' toolbar one can right-click and change the 'Tool Default Properties' of various markup tools like Highlighter, Line, Rectangle etc. Is it possible to access these properties through JavaScript so that buttons can be added for dynamically changing these? Hope this makes sense!
    Thanks in advance for your interest and help.
    John.

    Hi Andy, thanks for the answer. It was pretty simple - I just added an authorization scheme to the report column, wehre the javascript is executed. Christof

  • UWL - Retrieve Rejection text entered via UserDecisionNote

    Hello SDNers,
    I am using task TS20000131 for expense report approval process. I have setup UWL configuration for the same and every thing works fine except the Rejection text.
    In UWL configuration I am using UserDecisionNote and DecisionKey for including a mandatory rejection reason / text.
    However, I am not able to retrieve the text entered via UWL in the backend ECC system.
    I am able to see the text entered via UWL - show memo option in the further steps of the process.
    Where does the text entered get stored?
    We are on EP 7.01 and ECC 6.0 EHP4.
    Can someone help me by guiding me in the right path for this?
    Thanks,
    Kalyan
    The following is my UWL config
    <ItemType name="uwl.task.webflow.decision.TS20000131.ECCDEV" connector="WebFlowConnector" defaultView="com.sap.pct.erp.mss.tra.view.TripApprovalView" defaultAction="com.sap.pct.erp.mss.tra.action.DisplayExpenseForm" executionMode="default">
          <ItemTypeCriteria systemId="ECCDEV" externalType="TS20000131" connector="WebFlowConnector"/>
          <CustomAttributes>
            <CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="externalId" objectType="WebflowContainer" cacheValidity="final">
              <Attribute name="TripNumber" type="string" displayName="Trip Number"/>
              <Attribute name="EmployeeNumber" type="string" displayName="Employee Number"/>
            </CustomAttributeSource>
          </CustomAttributes>
    <Actions>
    <Action name="com.sap.pct.erp.mss.tra.action.approver.SendBackTrip" groupAction="yes" handler="UserDecisionHandler" referenceBundle="com.sap.pct.erp.mss.tra.SendBack" returnToDetailViewAllowed="no" launchInNewWindow="no">
              <Properties>
                <Property name="UserDecisionNote" value="true"/>
                <Property name="decisionKey" value="2"/>
              </Properties>
            </Action>
    <Action name="com.sap.pct.erp.mss.tra.action.approver.RejectTrip" groupAction="yes" handler="UserDecisionHandler" referenceBundle="com.sap.pct.erp.mss.tra.Reject" returnToDetailViewAllowed="no" launchInNewWindow="no">
              <Properties>
                <Property name="UserDecisionNote" value="mandatory"/>
                <Property name="decisionKey" value="3"/>
              </Properties>
            </Action>
          </Actions>
        </ItemType>

    Hi Susan,
    This was a little tricky.
    I was not able to locate the entered text initially.
    The text was getting stored as an attachment in the workflow.
    The UWL config I have above worked fine.
    To locate the text entered via Rejection Reason, please do the following:
    1. After you enter the text and perform the appropriate action from UWL, login to your Backend system and go to transaction SWI1.
    2. Select your Work Item / Dialog Step by double clicking on it.
    3. Click on the "Log" button
    4. Click on the "Details" icon for the step where you entered the rejection text.
    5. At the bottom, now you should see the details of the selected step. In the details, you should one step with executed action saying "Attachment added". Here if you click on the "Office Document" link from the Object column --- you should see the Rejection text entered via UWL.
    Let me know if you are still facing the issue.
    Thanks,
    Kalyan

  • Hide show button and textual area via Javascript or jQuery

    Hi folks am Apex newbie using 4.0.1 on Vista laptop running OracleXE (for dev purposes)
    A quick desc of what items are on the page of my Helpdesk appkication and what I want to achieve ..
    I have a Progress region defined on the page - with textual areas and some region buttons.
    Details are have 2 textual areas in my region - 1st textual area shows current progress (this is read only).
    Second textual region is where IT person will type latest progress on Helpdesk prob (ticket).
    There is a region button Save Progress Text which when pressed will append text from textual area 2 into textual area 1 and
    also appends text e.g date / time / userid etc of progress text added.
    This all works fine.
    Have added a new region button - call it Enter Progress Text - which I would like when pressed will make textual area 2 and the Save Progress Text buttons visible.
    I can hide and show the textual area 2 via $X_show / hide but cannot for life of me hide the Save Progress Text button.
    I also tried to make a subregion holding textual area 2 and the Svae Progress Text button but again via Javascript / jQuery could not hide the subregion.
    Can someone please tell me the syntax of how to hide via Javascript / jquery as can't find anything much at all in the Apex online documentation.
    Many, many thanks as always.
    P.S Don't want to use dynamic actions or hide / show region as want there to be buttons on screen to make things explicit for user hence my desire to use Javascript.
    Wiggywig

    Hi,
    If its a page item then you can use below script to hide it.
    <script type="text/javascript">
        $x_HideItemRow('Put your item name');
    </script>*Put this code in page footer..                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Accessing a network resource via javascript

    Hello,
    we have been using Adobe Reader for linux provided by the yum repository for quite some time, without major issues. Currently, however, we are seeing a mysterious problem with a PDF form which is designed to exchange data with a local server, using javascript functionality, as far as I can see. On one of our machines (running CentOS 5.8 64-bit) this has stopped working recently, and I cannot figure out why. Clicking the respective field simply has no effect, there is no error message, neither in the Reader window, or on the console, both in normal mode and debug mode. Nothing in the system logs either. The function simply seems to be ignored!
    Some observations which might be helpful:
    1. Uninstalling and reinstalling the Reader package, after clearing all personal preferences, did not have any effect.
    2. Using a fresh version of the PDF form did not solve the problem.
    3. Firewall and SElinux are disabled anyway.
    4. With a "clean" account on the same machine, the same problem occurs.
    5. On a very similar machine (same OS, same Reader version) the operation is working properly!
    So it seems to be something specific to this machine, but not specific to a certain account. It is obviously neither a corrupted Reader installation, nor a problem with this specific reader version, nor a corrupted PDF form. Now I am running out of ideas...
    Any suggestions what else might be preventing network access (via javascript) from functioning properly? Javascript itself is (by default) enabled in the preferences.
    Thanks in advance
    Oliver

    Sorry for the double post, but help would be appreciated...

  • Printing a slide in Captivate 6 HTML5 output via javascript

    I have been googling for the past 3 work days trying to figure this out.
    I had some limited success with printing a div via javascript and pointing it at the slide div (I know it happens to be Slide16952).
    Which is fine, except it doesn't keep the CSS elements of the slide which is what makes it a pretty completion certificate.  Print widgets won't work because I have to publish to HTML5 and not flash (no, no choice in this).  I am struggling to get any javascript working.
    I have this right now which I just picked up as a generic to try and get me going
    function PrintElem(elem)
            Popup($('<div/>').append($(elem).clone()).html());
        function Popup(data)
            var mywindow;      
            mywindow = window.open('', 'mydiv','height=1280,width=720,scrollbars=no','');           
            mywindow.document.write('<html><head><title>my div</title>');
            mywindow.document.write('<style type="text/css" media="print,screen">.hideMe{display:none;}.NoPrintClass{display:none;}</style>');               
            mywindow.document.write('</head><body>');
            mywindow.document.write('drop down selected value in parent: '+mywindow.opener.document.getElementById('testSelect').options[mywindow.opener.document. getElementById('testSelect').selectedIndex].text+'<br/>');
            mywindow.document.write('contentStarts<br/>');
            mywindow.document.write('  using jquery:  '+data);
            mywindow.document.write(' using javascript: '+mywindow.opener.document.getElementById('mydiv').innerHTML);
            mywindow.document.write('<br/>contentEnds');
            mywindow.document.write('<br/>');                                    
            mywindow.document.write('</body></html>');       
            mywindow.document.focus();
            mywindow.document.close();     
            mywindow.print();            
            return true;
    I then point my print button at PrintElem('Slide16952') via a javascript window.
    obviously I haven't written this to fit my particular project yet, but the part I am having the most issue with is trying to get the captivate CSS stuff to come through.  mydiv should = Slide16952 I think.  The CSS form that captivate creates has several block visible elements, but I believe the one I am trying to make sure I get is .cp-shape in CPLibrary.css, but there could be others I want too and I am not sure which.
    has anyone had any luck getting a single slide printed in HTML?  window.print() only gets me like 95% of the slide and a loft of white space around it.

    function printPartofPage() {
        var DocumentContainer = document.getElementById('Slide16952');
        var WindowObject = window.open('', 'PrintWindow', 'width=1280,height=720,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=no') ;
        WindowObject.document.writeln('<!DOCTYPE html>');
        WindowObject.document.writeln('<html><head><title></title>');
        WindowObject.document.writeln('<link rel="stylesheet" type="text/css" href="assets/css/CPLibrary.css">');
        WindowObject.document.writeln('</head><body>');
        WindowObject.document.writeln('<body style="background-image:url(dr/CertBorder.png);">');
        WindowObject.document.writeln('<h1 style="text-align:center; top: 30px;">Certificate of Completion</h1>');
        WindowObject.document.writeln(DocumentContainer.innerHTML);
        WindowObject.document.writeln('<img src="dr/17170_271_44.png" style="position:absolute; left: 896px; top: 464px; width: 294px; height: 73px;"></img>');
        WindowObjext.document.writeln('<p style="text-decoration:overline; position:absolute; left: 908px; top: 494px;">Authorized Signature</p>');
        WindowObject.document.writeln('</body></html>');
        WindowObject.document.close();
        WindowObject.focus();
        //WindowObject.print();
        //WindowObject.close();
    latest code update.  Almost everything is working now.  I am going to get rid of the h1 line because I am going to redesign the certificate image and incorporate the Certificate of Completion part in the image file CertBorder.  I may also do that for the image (which is a signature) and the <p></p> portion, so that I am pulling all of that into the image template and aligning it where it needs to be and just grabbing the image.
    I have the WindowObject.print and .close commented out so I can get it all working.  Once I know it works I will uncomment those for final testing.
    This isn't a great solution, but it's the only one I can seem to make work at this point and it will be pretty transparent to the user once it's done.  So far it doesn't set off the pop-up blocker for me, but I am doing this all locally on my hard drive so I suspect that may become an issue once published.
    also, all credit where credit is due (here is where I got my baseline code ideas http://jsfiddle.net/Zmqzb/)

  • Targetting elements via javascript... how?

    The following is code for a navigation menu where only one option appears lit at a time (based on code sent to me by the amazing Jon Fritz II).
    CSS:
    a#button0, a#button1 {
        display:block;
        float:left;
        width:55px;
        height:67px;
        margin:0;
    a#button0.inactive
    { background:url(/carousel_home.png) -55 0 no-repeat }
    a#button0.active
    { background:url(/carousel_home.png) 0 0 no-repeat }
    a#button1.inactive
    { background:url(/carousel_vip.png) -55px 0 no-repeat }
    a#button1.active
    { background:url(/carousel_vip.png) 0 0 no-repeat }
    HTML:
    <a href="#" onclick="changeClass(this)" class="inactive menu" id="button0"> </a>
    <a href="#" onclick="changeClass(this)" class="inactive menu" id="button1"> </a>
    JSCRIPT:
    <script>
    function changeClass(elClass) {
      var divsLength =  document.getElementsByClassName("menu").length;
      for (i = 0; i < divsLength; i++) {
        document.getElementsByClassName("menu")[i].className = "inactive menu";
      elClass.className = "active menu"; 
    </script>
    What this does is swap the class of a clicked button (in a menu) while reverting all the other buttons back to their original state, so only 1 button appears "lit" at a time. The A tags are used as block elements that simply shift the background image so as to produce a "lit" and "unlit" state.
    My question is... via javascript (or anything else), is it possible to trigger class changes for the buttons from an area OUTSIDE the menu? In other words, can we make a text link on the page itself trigger which button in the menu to "light up". Something like <a href="javascript:slide('div1'); javascript:(go light up button1)">Example</a>
    The reason is that this menu is not the ONLY way to get from one section to another. So if I click on a link in another DIV on the same page that takes me to another area, ideally, I'd like to see the button representing that area in the nav menu light up like it's been clicked on -- even if it hasn't. And of course, the other buttons would NOT be lit.
    Thanks!

    I hadn't even noticed you changed the name of the function from changeClass to setClass, which of course who immediately explain why it started working on those elements that were still calling changeClass... except that when I changed the individual calls to setClass, they still wouldn't work.
    Was I supposed to leave the former changeClass function in the javascript? Is your setClass function supposed to be used in conjuction with the other one? Because I replaced one with the other, and ever since then, the new behavior works but the old one (clicking directly on the icon) does not.
    Here is my menu :
    <a href="javascript:slide('div-home')" onclick="setClass(this)" class="inactive menu" id="button0"> </a>
    <a href="javascript:slide('div-vip1')" onclick="setClass(this)" class="inactive menu" id="button1"> </a>
    <a href="javascript:slide('div-vip2')" onclick="setClass(this)" class="inactive menu" id="button2"> </a>
    <a href="javascript:slide('div-vip4')" onclick="setClass(this)" class="inactive menu" id="button4"> </a>
    <a href="javascript:slide('div-vip5')" onclick="setClass(this)" class="inactive menu" id="button5"> </a>
    <a href="javascript:slide('div-done')" onclick="setClass(this)" class="inactive menu" id="button6"> </a>

  • Access file applet function via javascript

    hi all
    when i want to have access to the method (which in fact read a file) of my applet class via javascript, a java error is raised: access denied
    BUT i have signed the related jar!
    when i want to access the method (which in fact read a file) of my applet class via the normal way (put a button into a frame and....) it works.
    are there more configurations to do or ....?
    Kind Regard Tom
    here is the code
    HTML file
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
         <head>
         <link type="text/css" rel="stylesheet" href="/css/style.css">
              <script type="text/javascript">
              function xclick() {
              alert( document.getElementById('applet').isFileOk());
              document.getElementById('fichier').value = document.getElementById('applet').isFileOk();
              //alert(document.portal.applet.isFileOk(path));
              function checkfile() {
                   //var fichiercacher = document.portal.fichier.value;
                   var fichiercacher = document.getElementById("fichier").value;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("chemin").value = fichiercacher;
                   alert("fichier cacher" + fichiercacher);
                   alert("chemin=" + document.getElementById("chemin").value);
              </script>
         </head>
         <body >
         <form name="portal" method="post" action="" >
    <p align="center" id="corps">
         <img border="0" src="ilias.bmp"><br>
         <applet id="applet2" code="NumberOfLine.class" archive="NumberOfLine.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
              <applet id="applet" code="localfile.class" archive="localfile.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
         <br>
                   <div id="divloading" ></div>
         <input type="hidden" name="fichiercacher" />
         <input type="file" name="fichier" onchange="checkfile()">
    <input type="button" value="click me" onClick=xclick() ; />
         </p>
         </form>
         </body>
         </html>
    Class NumberOfLine javascript way
    import java.applet.Applet;
    import java.awt.Button;
    import java.awt.Label;
    import java.io.*;
    public class NumberOfLine extends Applet {
    private boolean fileok = false;
    Label message = new Label("MAX line = 40 ");
    Button btnok = new Button("check file");
    int maxline = 40;
    public void init() {
         String sMaxLines = getParameter("maxLines");
         if ( sMaxLines != null ){
                   this.maxline = Integer.parseInt(sMaxLines);
                   System.out.println(this.maxline);
         public String isFileOk(String chemin) {
              File ffile = new File( chemin);
              try{
                   FileReader fr = new FileReader(ffile);
                   LineNumberReader ln = new LineNumberReader(fr);
              int count = 0;
              while (ln.readLine() != null) {
              count++;
              System.out.println("Total line no: " + count);
                   ln.close();
                   fileok = (count <= maxline);
              catch(IOException e){
                   e.printStackTrace();
                   System.out.println(e.toString());
              return fileok ? "ok" : "nok";
    CLass localfile Normal way
    import java.applet.*;
    import java.awt.*;
    import java.util.*;
    import java.lang.*;
    import java.text.*;
    import java.awt.event.*;
    import java.io.*;
    public class localfile extends Applet {
         public localfile() {
              Panel p = new Panel();
              Font f;
              String osname = System.getProperty("os.name","");
              if (!osname.startsWith("Windows")) {
                   f = new Font("Arial",Font.BOLD,10);
              } else {
                   f = new Font("Verdana",Font.BOLD,12);
              p.setFont(f);
              p.add(new Button("Open"));
              p.add(new Button("other"));
              p.setBackground(new Color(255, 255, 255));
         p.setSize(800, 800);
              add(p);
              setSize(800, 800);
              setVisible(true);
         public String isFileOk(){
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              return "turc";
         public boolean action(Event evt, Object arg) {
              if (arg.equals("Open")) {
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              } else return false;
              return true;
    }

    Thx you were a great due to my big lak of java skills.
    i found the solutions and for those who are interrested here is the code:
    public String isFileOk(final String filepath){
              System.out.println("OPEN file=" + filepath);
              int arrlen = 10000;
              byte[] infile = new byte[arrlen];
                        try {
                   FileInputStream fis = (FileInputStream) AccessController.doPrivileged(
                   new PrivilegedExceptionAction() {
                   public Object run() throws FileNotFoundException {
                   return new FileInputStream(filepath);
                             BufferedInputStream bis = new BufferedInputStream(fis);
                             DataInputStream dis = new DataInputStream(bis);
                             try {
                                  int filelength = dis.read(infile);
                                  String filestring = new String(infile, 0,
                                  filelength);
                                  System.out.println("FILE LENGTH=" + filelength);
                                  System.out.println("FILE CONTENT=" + filestring);
                             } catch(IOException iox) {
                                  System.out.println("File read error...");
                                  iox.printStackTrace();
                             } finally {
                                  try {
                                       fis.close();
                                  } catch(IOException ioe) {
                                       //oops
                   } catch (PrivilegedActionException e) {
                   // e.getException() should be an instance of FileNotFoundException,
                   // as only "checked" exceptions will be "wrapped" in a
                   // PrivilegedActionException.
                   //throw (FileNotFoundException) e.getException();
                        e.printStackTrace();
                        return "nok";
                   return "ok";
         }

  • Resize an Object via javascript

    Resize an Object via javascript
    How do I...
    I want to select an object in my document, onscreen, (an image, or text) then run a script that will discern the object selected, and show a dialog box that will allow me to input a sizing percentage for that object (with anchor corner/center)(Press enter and object resizes).

    No they don't.
    Acrobat may be bundled with Creative Suite collections but the APIs has nothing in common other than the use of JavaScript. CS apps use the ExtendScript system, Acrobat has its own internal API and an SDK for inter-application control.
    PDF is an end-destination format - the page content is not designed to be edited, so while there are tools in the user interface to allow touchups and corrections to page objects those features are not available for automation. The JavaScript engine does not have access to the low-level document structure, it can only see markup (comments and form elements) and a limited range of document properties.
    bdmasha wrote:
    They are all part of a suite of tools that share a common access to internal api's via scripting/programming languages.
    InDesign is not Photoshop is not Illustrator, but they have much in common when accessing their api's that Acrobat does not allow--and Acrobat is part of that Adobe suite.
    Thanks again.

  • Activate submit via javascript

    Hi
    I have a small problem. I would like to activate a submit of my apex page via javascript and return back to existing page. What should I call from javascript. It is imposible to do some sort of document.myform.submit(), because apex doesn't give me posibility to specify id for form on my apex page, that I would like to suvmit. SO any ideas, peees help. Thx

    This is why you have a branching you can create for every page - as many as you like. You can make them conditional and they will lead you to the desired page depending on the action you specify.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Manipulating a cubequery via javascript

    Hi all,
    I'm trying to manipulate a cubequery section via javascript within an interactive reporting document (version 11.1.1.2).
    Docs are quite terse and I wasn't able to find an Object Model Map, the snippets of code are one line long and quite useless as a guide.
    I have a cube with a Scenario dimension with 2006,2007 etc as children.
    I can add Scenario to rows or columns of the query, but I have not found the right instruction to add a single children of the top level member to rows or columns.
    Has anyone a working piece of code or, even better, a detailed description of the CubeQuery object (and of his components)?
    TIA & best wishes
    Gianluca

    SOLVED
    to add 3 members from the scenario dimension in the columns of the cubequery you can use:
    ActiveDocument.Sections["Q personalizzata"].Columns.RemoveAll();
    ActiveDocument.Sections["Q personalizzata"].Columns.Add("Scenario");
    ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2006",1,true,true);
    ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2007",1,true,true);
    ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2008",1,true,true);
    ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].MemberSelectors["Scenario"].DisableSelection = true;
    for the rows substitutes Columns with Rows
    2006,2007 and 2008 are children of Scenario
    apparently the top level member of the dimension has to be always present in the QueryLabel, but can be disabled if you don't need it in the results
    BTW the second parameter in the FindAndAdd method could be substituted by the constant bqOlapMemberSelector, unfortunately if you use the constant instead of the value 1, you get an error message stating that the constant is not defined
    Gianluca

  • Retreiving the content created with the Note Tool via Javascript??

    Hey guys, is it possible to retrieve the text content created with the Note Tool from the tool palette  in a photoshop document via Javascript? Basically, I wanted to store some text inside the Photoshop psd document, and then later on I can use scripting to access the content to be use as variables.
    I have search the Javascript scripting reference pdf and the forum here, and I can't find any info the Note Tool. Much appreciated.

    Ok, so I am using the activeDocument.info.keywords property to store my text content. The content is basically a chunk of text that contains some parameters that the user can modify to save out a document. In my script, I am using a variable to store the content from the info.keywords property. But my next hurdle is how can I extract specific part of that variable into other variables, like storing the C:\projects\Textures\ into another variable? I've done some research and got a sense that the "match" method in javascript along with the use of regular expressions might do the job. But I am stuck. Any suggestions?
    info.keywords property has the follow chunk of text:
    // file path to save 
    path(C:\projects\Textures\)  
    // save file format (psd or tga, etc)
    format (tga) 
    // include a single alpha channel with the file y/n 
    alpha(n) 
    // alpha name - default should be "alpha1" 
    alphaName(alpha1) 
    // scale from the original size 
    scale(.5) 
    //sharpening
    sharpen(.5)
    script code:
    var saveDoc = activeDocument.info.keywords;
    var savePath = saveDoc[0].match(regular expression goes here); // how to grab C:\projects\Textures\ from the saveDoc variable???
    alert(savePath);

  • Digital signature properties field name via javascript

    I am creating secure digital signature fields with random number names with similar prefixes.  The idea is to have multiple fields available in a single regular PDF (non portfolio).  So on each sheet we sign 3 fields.  One field is a name, another is a date and the last is a release.  This goes on every sheet and the PDF would contain up to 1500 pages.  Adding a random number to the end of each field name was the only way to make this work....now I have a problem of finding the particular fields for my script to sign the sheets. 
    I am guessing that there must be some way to identify how many fields I have on a sheet and return the name of all the fields.  If I can get the name of all the fields I can use that info to run my script to place the digital signature appearances in their correct field.  My field names all begin with either 'Date', 'Sig' or 'RFC' followed by a random number to avoid duplicate fields.
    So in a nut shell, how can I find the names of the fields via JavaScript?
    Thanks you!

    Are you able to add another prefix, specifically using hierarchical field names that include the page number? For example, on page one the fields could be named:
    P1.Date[random number goes here]
    P1.Sig[random number goes here]
    P1.RFC[random number goes here]
    You can then get all of the P1 fields like this:
    var fields = getField("P1");
    and then use the getArray method to get an array of the individual field references and iterate through the array.
    Otherwise, you can loop through the fields and look at the page property of each to determine which ones are on which pages. You can use the getNthFieldName document method and numFields document property to do this.

Maybe you are looking for

  • Switching video cards crashes to black screen

    Owner of a MPB 6.2 from new, with an intel HD Graphics and an NVIDIA GeForce GT 330M, intel Core i5. OSX 10.6.8 Initially I had the screen going black with a few pixel white line on the top left part of the screen during the hot months of the summer,

  • Centered text not centered on DVD

    I have created a movie from home videos.  I have used the "Vertical Drift" text in a couple places.  Even though the text shows in my preview window with no problems, when burned to a DVD, the text is cut off.  This happens on all settings on our TV

  • Problems connecting to xfinity

    I just upgraded to comcast xfinity Gateway Modem. I went to settings on my ipad, wifi-and pulled up the new network, it has a good signal, I put in the password and it won't connect.  My other wifi devices are working fine with the new modem-   I als

  • Installation of Presenter 10 after uninstalling previous versions

    I have a problem with the installation of Adobe Presenter 10 with a previous installation of presenter 7 as plugin of acrobat. I uninstalled presenter 7, clean cookie, system register with Norton, eliminated any other visible trace of Prsenter 7, but

  • Photoshop Elements 10 Upgrade Version

    I hope this isn't a silly question, but I've been unable to find an answer elsewhere. I've never owned any Photoshop products at all before, and my wife bought me PS Elements 10 Upgrade version yesterday. Our belief was that PSE10 UV was just the mos