A question about script objects

I placed a script object in my form to control the color of the field and it works very well in Adobe Reader X but not in earlier versions of the reader and not in Acrobat pro 9.

Can someone tell me what is the problem?

The script object looks like this:

form1. #variables [0]. RGA_format - (JavaScript, client)

function RGA_colorOld()

xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = '220,220,220';

function RGA_color()

xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = "255,255,255";

And name fields on the docReady event and the event of modification of this script:

Form1.blanketB.moder.EftNvnMor::docReady - (JavaScript, client)

RGA_format. RGA_colorOld (the);

Form1.blanketB.moder.EftNvnMor::change - (JavaScript, client)

RGA_format. RGA_color (the);

Kind regards

Kirstine

Hi Kirstine,

When you call the function, you pass through the object as a parameter. However the function in the script object doesn't have a setting to receive this.

You can probably get through the object as a reference:

RGA_format.RGA_color(this);

However I prefer to declare a variable first and pass through:

var fieldObj = this.somExpression; // declare a variable to be passed into the function
colourControls.fieldGetsFocus(fieldObj); // calls the function "fieldGetsFocus" in the script object "colourControls"

Notice in the example, I have, when you declare the function, I have a 'fieldObj' parameter, to receive the information that is passed through.

function fieldGetsFocus(fieldObj) // first function
{
     ...
}

A small point on the function in the script object. I know that the function is a single line, but I'd rather see this wrapped in braces.

Finally changing the fill requires access to the properties of the user interface. They are different for each type of object. For example, the script that you have is for a textfield. This does not work on a numericfield.

I have an example here of a function that does what you are looking for: https://acrobat.com/#d=XGj9UEk4lSbDSoArnQU8dQ. Note how to check what is the object and then resolve the correct ui property. What makes the more reusable must function.

Hope that helps,

Niall

Ensure the dynamics

Tags: Adobe LiveCycle

Similar Questions

  • Questions about scripts in ai2

    Hello

    Two questions about the new install script.

    (1) where to find documents on the "object model" which is available for use during the writing of scripts. There the Javadocs available to all classes, getters, setters, etc that can be used?
    For example, I want to write a custom rule to detect foreign keys "without columns. For some reason, this error occurs during generation DOF, but I have not found a standard rule of prior design detect these problems before the generation of DDL. So, I'm interested in knowing how to navigate through the object model to create a rule of mine (IE is it a table.getFK (.getColumns ()) use?).

    (2) is it possible to use Groovy as a scripting language? If Yes, does anyone have the docs (or even draft notes) on how join as a script engine in the Data Modeler?

    Thank you, BP

    Hi BP,.

    to detect foreign keys "without columns. For some reason, this error occurs during generation DDL

    What version did you use to create these cases? There was such a problem in one of the pre-production versions published two years ago.

    Meta definitions, you can watch datamodeler\datamodeler\xmlmetadata directory.
    In fact, it is preferable to define the rule of index/constraint - you will get a clue that is used to represent the PK, UK, the FK constraints and indexes.
    So for your rule, you select index/constraint as object and the next Java scrip will be your rule:
    var index;

    {if (index.isFK () & {index.getElements () .length == 0)}
    fake;
    } else {}
    true;
    }

    If you remove index.isFK (control) then the rule will be valid for all PK, UK, the FK constraints and indexes.

    For script engines - you can start here - https://scripting.dev.java.net/
    I see groovy is supported - http://groovy.codehaus.org/JSR+223+Scripting+with+Groovy
    How to install it - you can follow the instructions in the first link above, it's much easier just to copy related jar in the "ext" directory - for groovy I copied "groovy - 1.7.5.jar" (I downloaded 1.7.5 version)
    in the "D:\jdk1.6.0_20\jre\lib\ext" directory on my computer. You must restart the Data Modeler - I engine script groovy as a choice in the engine drop-down list box.

    You must test how Groovy will return true or false for the Data Modeler - generally ordinary (not library), it is strange that you see in the example. If the library is used then the standard return is used.

    Philippe

  • Question about scripts in the form under repeatbel objects

    Hello

    I'm working on the creation of a form that has a secondary form that can be repeated as many times as the user wants. There is a button 'Add' that creates an instance of the secondary on the form form, when you click on it.

    The secondary form I have 5 numeric fields say a1 - a5 and 1 field b1 which is the sum of all these 5 fields.

    On the main screen, I have a 2 fields - say t1 and f1.

    The requirement is t1 = f1 + b1 + (instance sous-forme 2 B1) + (sub-form instance 3's b1) + and so on... .depending on as many instances sub-shape there that the user adds.

    I created actions using the Action Builder such as when none of the a1 to a5 fields are out, b1 will be updated with the sum of a1 - a5. At the same time t1 will be updated with the sum of f1 and b1.

    This works very well for 1 instance of the form under. But when click on 'Add' and a second instance of the secondary form is added, then the script does not work as it did for the first instance of the secondary form. So for all instances of the subshape added, when values are added to a1 - a5 and the fields are exist, b1 not updated.

    How can I fix?

    See attached form that I create for clarity.

    "The total number of hours worked this week" are the t1 I was talking about. See how it is updated when values are entered in all areas of the time. It works great with the default instance of the form on T100/strategic/advantage customer information as well. But when I click on the button "Add Customer" to add another instance of the form sub, it does not work as expected.

    Please let me know if it is still is not clear and I can explain the problem.

    Hi Ameeth,

    Please find below the link that has your document.

    https://workspaces.Acrobat.com/?d=OEkwisQ99LXgJ4e9GrCnZg

    Hope it works very well...

    I don't know why you created these functions?

    Let me know if you need any clarification.

    Thank you

    Sofiane

  • Question about oracle objects

    Hi people

    I came across the below example on the oracle documentation.

    I'm not quite sure why "emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and" ""emp is NULL #3"isn't even after printing has been assigned to the object with a NULL value."

    Can one of you you please explain about it. or give the overview of the conditions of the NULLable object. Thank you!!

    DECLARE

    EMP employee_typ; -emp is atomically null

    BEGIN

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #1"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #1");

    END IF;

    EMP.employee_id: = 330;

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #2"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #2");

    END IF;

    EMP: = employee_typ (NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    address_typ (NULL, NULL, NULL, NULL));

    -emp: = NULL; -It would have made the following statement of the TRUE IF

    If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #3"); END IF;

    IF emp.employee_id IS NULL THEN

    DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #3");

    END IF;

    EXCEPTION

    WHEN ACCESS_INTO_NULL THEN

    DBMS_OUTPUT. Put_line ('impossible to assign object NULL value');

    END;

    /

    The result is:


    EMP is NULL #1
    EMP.employee_id is NULL #1
    EMP is NULL #2
    EMP.employee_id is NULL #3

    I came across the below example on the oracle documentation.

    I'm not very sure why 'emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and ' emp is NULL #3 "is not get printed even though the object is assigned to null."

    Can one of you you please explain about it. or give the overview of the conditions of the NULLable object.

    Have you actually tried this example? Why not?

    The best and often faster, learn is to DO - not just read.

    If you tried this example, you would see that you have been "bitten" by a documentation bug.

    EMP.employee_id: = 330;

    That the line of code won't work - it will trigger an exception is the output you get really

    PEM is NULL #1

    EMP.employee_id is NULL #1

    Can't assign value to the NULL object

    PL/SQL procedure successfully completed.

    SQL >

    The 'emp' instance has the value NULL as shows it the first message. If you cannot assign the 330 value him.

    For others, the example seems to be the Oracle documentation

    http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14261/objects.htm#CIHEJIBA

  • Question about clicking object behind a mask effect

    First of all, sorry for the title of indescriptive, couldn't really think of anything.

    Okay, so I want an effect to my Flash project. Basically, I have a black background and a simple mask effect that follows the mouse, if you move the mouse and it shows you the layer behind the black background... The script looks like this:

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void

    {

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    And it works very well, but it's not all that I intend to do. In short, the user must move the mask using the mouse and find several colorful objects hidden behind it (it works very well), so I want to do all the clickable object and I want the object to change forms when they are clicked on. I'm pretty new to Flash, but I fiddled around with it and could not get to a solution that worked.

    I tried labeling different frames on the timeline. "color1", "Color2" and then by a

    color_mc.Color1.buttonMode = true

    color_mc.Color1.addEventListener (MouseEvent.CLICK, COLOR1);

    function {(e:MouseEvent) COLOR1}

    gotoAndPlay ("color1");

    }

    So go to this image, but this probably isn't the right way to do it, because the mask effect no longer works (I even tried to copy the action on the framework "color1" script), and I think that if you had clicked on the "color1" first object, and then the "Color2" object after

    I think that he would turn the "color1" action (but I'm not sure)

    * Note * color_mc is the background with objects on I want clickable and objects are called "color1", "Color2" etc.

    Oh and one thing I would also like to recognize when all objects are clicked and then move on to a new frame/scene.

    Sorry, if I could not explain it correctly; as I said I'm not experienced in Flash and I would be really grateful if someone could help me. If there is anything you want to know or if you want to see my flash file, let me know.

    use:

    Import fl.transitions.Tween;

    Import fl.transitions.easing.None;

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void {}

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    var t1:Tween;

    var t2:Tween;

    var colorNum:int = 5;

    var numClicked:int = 0;

    for (var i: int = 1; i<>

    color_mc ['color' + i] .buttonMode = true;

    color_mc ["Color" + i] .addEventListener (MouseEvent.Click, tweenF);

    }

    function tweenF(e:MouseEvent):void {}

    T1 = new Tween(e.currentTarget,"scaleX",None.easeNone,1,1.5,.5,true);

    T2 = new Tween(e.currentTarget,"scaleY",None.easeNone,1,1.5,.5,true);

    e.currentTarget.mouseEnabled = false;

    addChild (MovieClip (e.currentTarget));

    e.currentTarget.x += color_mc.x;

    e.currentTarget.y += color_mc.y;

    numClicked ++;

    {if(numClicked==colorNum)}

    Stop ("framework");

    }

    }

  • Question about l ' object net.rim.device.api.ui.Screen

    Hello world

    I have a class that accepts an object of type "Screen" (net.rim.device.api.ui.Screen) in its constructor. When I instantiate this class, I include a class that extends the screen as a parameter. For example:

    public ClassA extends MainScreen {
         public void tester(){
              ClassB classB = new ClassB(this);
         }
              public void sampleMethod(){        ...     }}
    
    public ClassB {
    
         Screen screen;
    
         public ClassB(Screen screen) {
              this.screen = screen;
         }
         public doStuff(){          screen.sampleMethod();     }}
    

    My problem is that ClassB calls methods that are placed, but unless I change type "Screen" in the "class A", I receive the error: "the sampleMethod() method is not defined for the type of screen.

    How can I me ClassB to accept different classes that extend screen?

    Thank you!

    "each screen implements a SampleMethod() interface.

    Then could ClassB looks like this?

    public ClassB {}

    SampleMethodInterface screen;

    public ClassB (form SampleMethodInterface) {}
    This.screen = screen;
    }

    public doStuff() {}
    screen.sampleMethod ();
    }
    }

  • Question about the object

    public class Testing{
    public void status(Object d){
    System.out.println("object is called " + d);
    }
    
    public  void status(String s){
    System.out.println("String is called " + s);
    }
    
    public static void main(String[] args){
    Testing a = new Testing();
    a.status(null);
    }
    }
    Output : String is called null

    No doubt: I can't understand how including compiler to call status method with the String argument and not the one with the Object.Even argument if he did then why NullPointerException was not thrown during execution, since printing System.out.println ("the string is called" + s), it will call the method toString() on s and since it is null it should throw a NullPointerException.

    Any clarification on this is much appreciated.

    isocdev_mb wrote:
    I'm not clear on the method resolution (perhaps something on the more specific signature)

    NULL is considered as to be more precise in the hierarchy, so if you have overloaded methods where first one takes object, the second takes Foo (a subclass of object) and third takes the Bar (subclass of Foo), then one with the setting Bar would be called.

    But if you have a parameter Object and two methods with the subclasses of object as parameters, you will get a compilation error because specific to one can not be chosen.

    does not imply an invocation of toString(). s is a string already

    Nothing implies a call toString(). The method that is called is String.valueOf (param Object), which returns "null" when given null. No NPE, no problem.

  • question about an object in java

    If I have
    1.class Fizz { 
    2.    int x = 5;
    3.    public static void main(String[] args) {       
    4.        Fizz f2 = new Fizz(); 
    5.        System.out.println("f2 is " + f2);    
    6.    }
    After printing, the result is
    f2 is Fizz@3e25a5
    Should it be
    f2 is Null
    My logic is when line 4 is executed, the manufacturer (super) will be invoked and it initialize f2 with a NULL value. If my logic is not sacred, correct me please. Thank you.

    The Java API for the toString method:

     The toString method for class Object returns a string consisting of the name
    of the class of which the object is an instance, the at-sign character `@',
    and the unsigned hexadecimal representation of the hash code of the object.
    In other words, this method returns a string equal to the value of:
    
         getClass().getName() + '@' + Integer.toHexString(hashCode())
         
    

    Published by: Darryl Burke - divide a long line within the tags of code in 4 lines

  • Question about converting objects in number

    This may sound a little silly, but I have a function that converts an object into a number and then checks if it is NaN to make sure that it is indeed a number, it returns true if it is a valid number, or false if it is not a number

    Now I have a TextInput and when I type for example 'HELLO' and call the function will return false (since it is not a number), if I type 23 it returns true (it is a number), if I hit 20 'a', it returns false. Everything works well except for a combination, if I type any number and the letter 'e', for example, 2nd, 9th, 5th, etc., it returns true, which means that it is a valid why number, is it?

    You can validate the number against a regular expression:

    /\d+(\.\d*)?/

    I think I have this right,
    Tim

  • Question about my script

    I have a question about my script and why Im not return desired output. Could someone please help me solve this and also let me know what I was doing wrong, why their working version vs my return empty result. Thanks in advance and have a nice day.

    Mike P.

    First of all, I ran this for a list of all virtual cards ovf all my virtual machines. It comes out OK but gave me too much, I was looking for something a little more specific.

    Get - VM | Get-NetworkAdapter | Select-Object Parent, name, NetworkName, ConnectionState

    the script above has given me all the names of VM, AdapterName, PortGroup name and the connection status of the adapter of the said

    I wanted to filter this down a little more. I was looking for netowrk adapters connected to a specific NetworkName with a ConnectionState connected object. Mainly because I have another script, I want to run after the fact that would make this particular NotConnected and NoStartConnected adapter.

    I thought I could do it with the following script. The script works fine without errors and filter unwanted information. However, my problem is that it does not return what it finds on the screen as the previous script. I'm missing a piece for this script that will give me the output of the screen for each card that meets the criteria. I tried out channelling to a .csv, of course, it was empty as well. I tried a failed in an echo statement after him as well.

    Get - VM | Get-NetworkAdapter | where {$_.NetworkName - eq "Network 1" - and $_.} ConnectioState - eq 'Connected'}

    Thanks again for your help!

    You can better use the operator contains this

    {$_.NetworkName -eq "Network 1" -and "Connected","NoGuestControl","StartConnected" -contains $_.ConnectionState}
    

    It checks if the value property is present in the array of values that you give on the left side

  • Question about OWA scripts - how much time do need to run or not at all

    Just a question about OWA on Exchange 2010 scripts. I have a site and unique Exchange Server. I noticed that we have a powershell script scheduled in the Task Scheduler running daily that defines all the mailbox OWA strategy. This policy is defined in the EMC access client/organizational Configuration (EMC) tab.

    My question is... If the policy is already configured in the access client/organizational Configuration tab, should this powershell script run at all?  Not all new users get this strategy by default (since we have only one policy OWA) If you enable Outlook Web access on the mailbox of the user in the appearance of the mailbox tab?  My thought is that the powershell script and the calendar was just a postponement of the old Exchange 2003 for strategies for the OWA...

    Thank you.

    Hello

    Your question is beyond the scope of this community.

    I suggest that repost you your Question in Exchange for TechNet Forums.

    https://social.technet.Microsoft.com/forums/Office/en-us/home?category=ExchangeServer

    Or here:

    https://social.technet.Microsoft.com/forums/Exchange/en-us/home?Forum=exchangesvrgeneral

    See you soon.

  • DLLSurrogate on Server 2008 STANDARD (NOT R2) does not not a COM 32 bits of the 64-bit VBS script object.

    I can't get DLLSurrogate on Server 2008 STANDARD (NOT R2) to load a 32-bit to 64-bit VBS script COM object.

    Yes, I tried the Wow6432Node "redirects" and THAT runs on Server 2008 R2, but NOT under the STANDARD!

    The PROBLEM is that the VBS Script is called from SCOM (which is 64 bit [SCOM 32-bit on a 64 bit OS is "unsupported"]), who, in turn, must run the application Code to 32-bit (return MOMScriptAPI.PropertyBag [64-bit, in this case])!

    Under Server 2008 R2, the technique to create entries of DLLSurrogate under HKCR\Wow6432Node...  Works PERFECTLY, the PROBLEM, this is the verion of the 32-bit code we (still) lack in Production does not support running on R2.

    I can't seem to find a way (once again, on Server 2008 R2 (x 64)) interact in a 64-bit environment / 32-bit mixed!

    Anyone have this working?

    Hello

    Your question about Windows Server 2008 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the public on the TechNet Forums. Please post your question in the following link for assistance:

    Link to the forum:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

  • question about stacked sequence

    Hello

    I have a question about stacked sequence.

    I have a stacked with 5 sequences sequence (0,..., 4). I would like to run these as this form

    0, 1, 2, 1, 3, 1, 4, 1 then again 0...

    I don't want to duplicate the section 1 because it contains many objects, variable... One possibility would be to out objects and then duplicate the sequence and use of shift registers, but I don't want to use because in 1, I have some graphs in real time to draw...

    Will there be another (easy) way to do this?

    Thanks for the ideas,

    Concerning

    Why use a stacked sequence?  What you want is a state machine something like this

  • A few questions about FileConnection/JSR 75

    [I posted these issues some time ago, but got no response]

    I am writing an application that targets the 4.2.1 and upward. After reading everything I can find (api docs, forum, kb, guides, web search), I still have many questions about the BlackBerry file system:

    1. Are store / and SDCard / internal name of the memory and the SD card root on all BlackBerry devices?
    2. JSR 75 leaves open the question of whether an application sees the virtual roots that are private to itself or if all applications share the same roots. How does on BBs? I have seen many examples where the path name starts by "/ store/home/user/app_name /" or "/ SDCard/BlackBerry/app_name / '. Is this necessary, or can my request simply use "/ store /" or "/SDCard/" and add the file name? If the former, are there best practices documented anywhere to manage collisions between app names?
    3. If the files are visible in many applications, there are layers of security available to protect data (I think something similar to how a PersistentObject can be encapsulated in an object ControlledAccess using the PersistentStore) or do make us our own?
    4. I read on this forum somewhere that store / is not available when a device is connected via USB and mass storage is active. Is this and other information like this documented somewhere?
    5. May restrict the COMPUTER strategies how an application uses FileConnection, particularly to the store / and SDCard /? If so, is there any guidance on common restrictions that developers should know when you write applications for general use?
    6. What restrictions are there on the names of files (allowed characters, length, etc.)?

    Any guidance or pointers will be appreciated!

    Hi Ted,

    I'm not sure on your remaining questions, but I'll try to answer as best I can:

    1. did not have different names on the devices until today.

    2. you have no problem on SD card and you are allowed to save files anywhere it. Not quite sure

    shop around, but you should be able to save files on the file system visible and own created folders. There will be

    some folders inaccessible devices that require internal processing (installed Te of applications etc..).

    3. you can open files as readonly etc. but elsethere it is not the layers of security installed. If you have data

    issues of security, you must save this Te using the RuntimeStore class!

    4. I don't know, but it's a fact. But for this purpose, you can detect the toggling of mass storage

    programmatically.

    5 see point No. 3

    6 see restrictions as specified in JSR 75.

    Kind regards

    Jochen

  • HTML (Web), I have a question about the models.

    Hello CC animate developers.

    New features are really good.

    HTML (Web), I have a question about the models.

    <! DOCTYPE html >

    < html >

    < head >

    < meta charset = "UTF-8" >

    < title > $TITLE < /title >

    < meta name = "ad.size" content ="width = $WT, height = $HT" > "

    $CREATEJS_SCRIPTS

    $SCRIPT_START

    var canvas, stage, exportRoot;

    function init() {}

    $CJS_INIT

    }

    $PLAYSOUND

    $SCRIPT_END

    < script type = "text/javascript" >

    "clickTAG" var = "";

    < /script >

    < / head >

    < onload = "init (); the body"style =" background-color: #D4D4D4; " margin: 0px; ">

    < a href = "javascript:window.open (window.clickTag)" >

    < div style = "position: absolute;" cursor: pointer; box-sizing: border-box; border: 1px solid #000000; overflow: hidden; height: $HTpx; Width: $WTpx; Background: rgb (255, 255, 255.0); "> < / div >

    < canvas id = "$CANVAS_ID" width = "$WT" height = "$HT" style = "background-color: $BG" > < / canvas >

    < /a >

    < / body >

    < / html >

    In the example above, the model;

    < Meta name = "ad.siz of" content = "width = $ WTI height = $ HT" > "

    and

    < Div style = "position: absolute;" cursor: pointer; box-sizing: border-box; border: 1px solid # 000000; overflow: hidden; height: $HTpx; Width: $WTpx; Background: rgb (255, 255, 255.0); "> < / div >"

    I use labels. But these tags in the template and import, it gives an error does not occur.

    I think it was a mistake. I want to help in this regard.

    $ HT or Properties $WT , I get an error when I use elsewhere.

    I think I should be able to use anywhere I want.

    The same problem here - I worked around by some DRM models with different values of ad.size, but it's a solution quite short-seight

    Also - you are not able to create the model with transparent background by removing style = "" background-color: $BG ' as it also throws errors - is the only solution that I managed to get updates style = "background-color: $BG; background: none; ", but it's a really bad way of coding things.

    It would be really great to have freedom in changing patterns.

Maybe you are looking for