Using a Variable for dataProvider Information

I'm trying to use a variable to populate the dataProvider for printing. I pulled the example in Flex 3: training from the source book. When I try to use a variable, I get a Flash Player error, indicating that the provider is not defined. Is anyone know the correct such way to make it work?

Here is the code:

private void doPrint(event:Event):void {}

selection = event.currentTarget.id + "s.dataProvider"

var pj:FlexPrintJob = new FlexPrintJob();

If (PJ. Start()! = true)
{
return;
}

var myPrintView:PrintView = new PrintView();
this.addChild (myPrintView);
myPrintView.myPrintDG.showHeaders = false;
myPrintView.myPrintDG.rowHeight = 18;
myPrintView.contact.text = "username:"+ uname;»
myPrintView.myPrintDG.dataProvider = "(select)";
pj.addObject (myPrintView);
PJ. Send();
removeChild (myPrintView);
}


This is the line I need to work: myPrintView.myPrintDG.dataProvider = "(select)";

If I replace "(selection)" with roles.dataProvider, it works fine. I think it's just a matter of syntax. If you look at the previous line, I use a variable for the user name and which works very well.

Any help would be greatly appreciated.

Dave

"Kurrykid" wrote in message
News:g6vsnc$LPs$1@forums. Macromedia.com...
> I'm trying to use a variable to populate the dataProvider for printing. I have
> supported on the example of the Flex 3: training from the source book.
> When I
> try using a variable, I get a Flash Player error, indicating that the
> provider is
> undefined. Does anyone know the correct way to this guy while he
> works?
>
> Here is the code:
>
> private void doPrint(event:Event):void {}
>
> selection = event.currentTarget.id + "s.dataProvider"

VR;

selection = this [event.currentTarget.id +' is] .dataProvider;

HTH;

Amy

Tags: Flex

Similar Questions

  • Can Oracle 10g - I use a variable for the access of the user identifywhat tablesto?

    I have the following code in a trigger (PL/Sql block) of a form:

    Select fieldname in user1.sometable myvar;

    is it possible to use a variable instead of coding hard "user1"? And on the same subject, this variable would also be declared in the world?

    Thanks in advance,
    Darren

    Hello!

    User1 is the owner of the table sometable.

    If only the User1 runs your form, there is no need to put the tableowner in front of the tablename parameter.

    If other users run your form, you must create a public or private (for each user) synonym of this table.
    After that, you don't need to use owner.tablename in your sql statement.

    But:
    You cannot use a variable for the user name without using dynamic sql
    as you do if you create a recordgroup.

    Concerning

  • Applying the addEventListener method to the Clips using a variable for example appoints

    This project is in HTML5 Canvas using Javascript in Adobe animate.

    I have a lot of movie clip symbols of film, all with a single instance (for example name ('arms', 'head', 'leg', 'foot', etc.). I also have a display of graphics and text clip ("text") which has a keyframe labeled corresponding to each of these symbols instance names. When a symbol is clicked, I want the clip "displayText" to access the appropriate section.

    There are a large number of these clickable symbols in each of several animations, so I definitely want to be able to do this in a way auto-tableau, it is too many to write code for each.

    What I have is this:

    var objects = ['arms', 'head', 'leg', 'foot'];

    var clickObject = null;

    for (i = 0; i < objects.length; i ++) {}

    clickObject = (objects [i]);

    clickObject.addEventListener ("click", displayText.bind (this));

    }

    function displayText() {}

    this.displayAndSound.gotoAndStop (clickObject);

    }

    Console says "clickObject.addEventListener is not a function", and I have tried many variations of the scope, using onClick rather than a listener events, etc, etc. What I am doing wrong - something to do with the scope? Something to variables vs channels? Something to do with how javascript regarding instance names? Legally binding?

    I can get it works fine outside of the loop, using names of the current instance, fixed, so hopefully it's a clue to what goes wrong...

    Any help much appreciated.

    Look at what you do in the loop. You do not clickObject for an object reference, configure that you just want it set to a string value.

    Assuming that the objects are at the same level as the code, you should do instead:

    clickObject = this [object [i]];

    Property accessors - JavaScript | DND

    In addition, your event handler probably don't do what you hope, that he will, because the value of clickObject will be just what you set to last in the main code. You may need to use the event object.

    EaselJS tutorial: Mouse Interaction

    EaselJS v0.8.2 API Documentation: MouseEvent

  • Use of variables for name files

    I have an if statement that performs a function. Inside this function, I want a swf to play according to the variable name that appears table shuffle. Can someone help me with the syntax?

    function questions() {}
    it. "' question ' + questionNumb [0] +". play();
    }

    When this function is executed if the vallue of table questionNumb 0 is 2 I want the statement to be executed as question2.play (); I know that I have the wrong syntax, but I can't find a reference to this type of statement in my action script books or online. Any help would be appreciated.

    NetBoss

    function questions() {}
    _root ["issue" + questionNumb [0]] () .play;
    }

  • Using a Global Variable for the input recorder DisplayRange

    I'm assuming; Since I can't do it; that you cannot change the display range of a graphic recorder by using a variable.  If there is a way I'd love to know how.

    Thank you!

    Determine if you can use a global variable is to click right in the parameter field. If the global variable is available in the context menu, then you can use a variable y.

    You can use a variable of the y-axis from the settings.

    You cannot use a variable for the display range of the x-axis parameter. This is because DASYLab needs to know the amount of memory to be allocated at the beginning of the measure.

  • Using a variable db link for interactive report

    I have a requirement where users select an instance a LOV apex (link db) and data in an interactive report query based on the selected db link.

    I use a db link in a report query interactive but only if I provide the exact name of the binding. If I'm doing something link select * from foo@:P12_DBLINK it does not work.

    It seems that my only option is to use something like apex_collection.create_collection_from_query and then I can build my dynamic SQL query and use a variable for the name of dblink. Then I create just a from IRR of my collection.

    This sound correct approach like that or am I missing something?

    Any suggestions are most appreciated,

    John

    Hi John,.

    Why not create a classic report based on a function of PL/SQL returns a query.

    André

  • Estimate of poor cardinality using Bind Variables

    Hi I'm using the 11.2.0.4.0 Oracle version. I have a query that is underway for the plan of the poor execution by the estimate of poor cardinality for two tables (I've extracted and published this part only) as I mentioned below, the individual conditions for which the estimate goes bad and moving entire query execution path.

    These are for two tables and currently we use BIND variable for them in our code, and I notice, its best estimate gives with literals. I need to know how to handle this scenario that I need this query to execute for all types of volumes. Is there something I can do without changing the code, as it works well for most of the execution? In the current scenario of the main query that uses those below tables providing a plan (index + nested loop) that works very well for small volume, but running for 10 hr + for large volume as ideally its going to the same regime.
    And Yes, most time that this request will be hit for small volume, but killing some appearance of large volume presents the performance of the queries.


    Here are the values of the variable binding.

    B1 VARIABLE VARCHAR2 (32);
    B2 VARIABLE VARCHAR2 (32);
    B3 VARIABLE NUMBER;
    B4 VARIABLE VARCHAR2 (32);
    B7 VARIABLE VARCHAR2 (32);
    B5 VARIABLE NUMBER;
    B6 VARIABLE NUMBER;

    EXEC: B1: = 'NONE ';
    EXEC: B2: = NULL;
    EXEC: B3: = 0;
    EXEC: B4: = NULL;
    EXEC: B7: = NULL;
    EXEC: B5: = 0;
    EXEC: B6: = 0;

    ---- For  TABLE1-------
     -- Published Actual VS Etimated cardinality
     
     
    -- With bind values
    select * from TABLE1 SF
    WHERE (   (SF.C1_IDCODE = :B4) OR (NVL (:B4, 'NONE') = 'NONE'))
        AND ( (SF.C2_ID = :B3) OR (NVL (:B3, 0) = 0));
    Plan hash value: 2590266031
    -----------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                 | Name                | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    -----------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT          |                     |      1 |        |  28835 |00:00:00.08 |    2748 |     46 |       |       |          |
    |*  1 |  TABLE ACCESS STORAGE FULL| TABLE1              |      1 |     11 |  28835 |00:00:00.08 |    2748 |     46 |  1025K|  1025K|          |
    -----------------------------------------------------------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - storage((("SF"."C1_IDCODE"=:B4 OR NVL(:B4,'NONE')='NONE') AND ("SF"."C2_ID"=:B3 OR NVL(:B3,0)=0)))
           filter((("SF"."C1_IDCODE"=:B4 OR NVL(:B4,'NONE')='NONE') AND ("SF"."C2_ID"=:B3 OR NVL(:B3,0)=0))) 
     
    -- With literals 
    select * from TABLE1 SF
     WHERE  (   (SF.C1_IDCODE = null) OR (NVL (null, 'NONE') = 'NONE'))
          AND ( (SF.C2_ID = 0) OR (NVL (0, 0) = 0));
       Plan hash value: 2590266031
    --------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                 | Name                | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    --------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT          |                     |      1 |        |  28835 |00:00:00.03 |    2748 |       |       |          |
    |   1 |  TABLE ACCESS STORAGE FULL| TABLE1              |      1 |  28835 |  28835 |00:00:00.03 |    2748 |  1025K|  1025K|          |
    --------------------------------------------------------------------------------------------------------------------------------------
    
    --------For TABLE2 ----------------------- 
    -- Published Autotrace plan, as it was taking long time for completion, and actual cardinality is 45M, but its estimating 49 With bind value---
    
    --withbind value
    select * from TABLE2 MTF
    WHERE (   (MTF.C6_CODE = TRIM (:B2)) OR (NVL (:B2, 'NONE') = 'NONE'))
      AND (   (MTF.C3_CODE = :B1)  OR (NVL (:B1, 'NONE') = 'NONE'))
      AND (   (MTF.C4_CODE = :B7)  OR (:B7 IS NULL))
      AND (   (MTF.C5_AMT <= :B6)  OR (NVL (:B6, 0) = 0))
      AND (   (MTF.C5_AMT >= :B5)  OR (NVL (:B5, 0) = 0));
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1536592532
    -----------------------------------------------------------------------------------------------------------
    | Id  | Operation                  | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT           |              |    49 | 10437 |   358K  (1)| 01:11:43 |       |    |
    |   1 |  PARTITION RANGE ALL       |              |    49 | 10437 |   358K  (1)| 01:11:43 |     1 |  2 |
    |*  2 |   TABLE ACCESS STORAGE FULL| TABLE2       |    49 | 10437 |   358K  (1)| 01:11:43 |     1 |  2 |
    -----------------------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - storage(("MTF"."C4_CODE"=:B7 OR :B7 IS NULL) AND ("MTF"."C3_CODE"=:B1 OR
                  NVL(:B1,'NONE')='NONE') AND ("MTF"."C5_AMT"<=TO_NUMBER(:B6) OR NVL(:B6,0)=0) AND
                  ("MTF"."C5_AMT">=TO_NUMBER(:B5) OR NVL(:B5,0)=0) AND ("MTF"."C6_CODE"=TRIM(:B2) OR
                  NVL(:B2,'NONE')='NONE'))
           filter(("MTF"."C4_CODE"=:B7 OR :B7 IS NULL) AND ("MTF"."C3_CODE"=:B1 OR
                  NVL(:B1,'NONE')='NONE') AND ("MTF"."C5_AMT"<=TO_NUMBER(:B6) OR NVL(:B6,0)=0) AND
                  ("MTF"."C5_AMT">=TO_NUMBER(:B5) OR NVL(:B5,0)=0) AND ("MTF"."C6_CODE"=TRIM(:B2) OR
                  NVL(:B2,'NONE')='NONE'))
      
    -- with literal
    select * from TABLE2 MTF
    WHERE (   (MTF.C6_CODE = TRIM (null)) OR (NVL (null, 'NONE') = 'NONE'))
     AND (   (MTF.C3_CODE = 'NONE') OR (NVL ('NONE', 'NONE') = 'NONE'))
      AND (   (MTF.C4_CODE = null)  OR (null IS NULL))
       AND (   (MTF.C5_AMT <= 0)  OR (NVL (0, 0) = 0))
      AND (   (MTF.C5_AMT >= 0)  OR (NVL (0, 0) = 0));
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1536592532
    -----------------------------------------------------------------------------------------------------------
    | Id  | Operation                  | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -----------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT           |              |    45M|  9151M|   358K  (1)| 01:11:41 |       |    |
    |   1 |  PARTITION RANGE ALL       |              |    45M|  9151M|   358K  (1)| 01:11:41 |     1 |  2 |
    |   2 |   TABLE ACCESS STORAGE FULL| TABLE2 |    45M|  9151M|   358K  (1)| 01:11:41 |     1 |  2 |
    -----------------------------------------------------------------------------------------------------------
    
    select column_name,num_nulls,num_distinct,density
    from dba_tab_col_statistics where table_name='TABLE2'
    and column_name in ('C3_CODE','C4_CODE','C5_AMT','C6_CODE');
    C3_CODE 0 65 0.0153846153846154
    C4_CODE 0 2 0.5
    C5_AMT 0 21544 4.64166357222429E-5
    C6_CODE 1889955 71 0.0140845070422535
    
    

    933257 wrote:

    ((SF. C1_IDCODE =: B4) OR (NVL (: B4, 'NONE') = 'NONE'))

    In fact for literals, I did not find any section of the predicate after running the sql code with activation "set autotrace traceonly explain."

    The main problem is with another large query whose cardinality is underestimated due to the presence of these table (table1, table2) with the above mentioned clause, and the query is for the analysis of index + nested with values of Bind loops and take 10 hr +, whereas with literals, its completion in ~ 8minutes with FTS + Hash Join.

    Your real problem is that you try to have just a single SQL query handle all POSSIBLE thanks to the use of embedded FILTERS ' either / or ' filters in the WHERE clause.  You want only a select this OPTION to run whatever filters have been selected at run time by the user or the application using it.  And it would never work.  You really need to SELECT different queries for different combinations of filter conditions.

    Why?  Think for a minute.  How Oracle works internally?  A SQL SELECT query gets analyzed and an execution plan is produced which is stored in the library cache and gets REUSED on all subsequent executions of this query - except in certain cases where there may exist several plans run through several cursors of the child.  So with only SELECT a query you only AN execution plan in the library cache, to be used by all THE executions of this query, regardless of the value of your run-time binding variables.

    Lets put another way - each library cache execution plan is associated with a SQL statement.  If you want a DIFFERENT execution plan then you need run a DIFFERENT SQL statement.  That's how you get a different execution plan - by running a different SQL statement.  Running the SAME SQL query generally you will get the SAME execution plan every time.

    In addition, because of the "either / or" filters that you use you will end up generally with a full Table Scan on each of the referenced tables.  Why?  Given that the optimizer must produce an implementation plan that manages all possible contingencies for all values of possible bind variables in the SELECT.  If the optimizer should choose to use any index based on one of these "either / or" filters then it would only help performance when real value was provided, but it would be really bad if a NULL value was supplied.  If the optimizer ends up ignoring the index because they are not always optimal for all possible input values and instead chose a plan that is "good enough" for all input values possible.  That means that it will use a scanning Table full.

    I hope you can see that it is precisely what is happening for you with your query.  You select this OPTION to manage the different combinations of filter, which leads to the execution plan only one, which leads to scans full Table on the referenced tables in these ' either / or ' filters.

    The solution?  Build queries SELECT DIFFERENT when input values are NULL.  How you do that?  Read this article to ask Tom that tells you:

    http://www.Oracle.com/technetwork/issue-archive/2009/09-Jul/o49asktom-090487.html

    To sum up - when you have real value for a bind variable 'bind_var1' add the following filter to your CHOICE:

    AND column_name1 =: bind_var1

    When the binding variable is NULL, add the filter according to your CHOICE:

    AND (1 = 1 OR: bind_var1 IS NULL)

    Now, you'll have 2 queries SELECT must be performed, which have exactly the same number of variables in the same order bind, which is important.  When you then run one of these variations, Oracle can analyze and optimize each one SEPARATELY, with a single execution by the SELECT query plan.

    When you provide a real value, the filter is a normal 'column = value' that the optimizer can use all indexes on this column, because NULL values are not referenced.

    When there is no real value, the optimizer will analyze the '1 = 1 GOLD' and realize that "1 = 1" is set to TRUE and GOLD, it is quite TRUE regardless because the binding variable is null or not.  This means that the optimizer will actually REMOVE this filter, because it filters nothing because it is always TRUE.  You will end up with an operating plan based on the other filters in the query, which is what you want because you have no filter on this column.

    What is it - producing distinct SELECT queries to determine if you have a real value to filter or not you end up with DIFFERENT execution plans for each of them, and each of them is OPTIMAL for this particular set of filters.  Now you get good performance for each variation of the performance of the SELECTION, rather than sometimes good and sometimes very bad when using SELECT only one.  It is impossible to try to get multiple shots of execution 'optimal' out of a SELECT query.  That's why you get mediocre performance under different bound the values of the variables.

    John Brady

  • Can I buy a second Apple TV and use my existing account even information on it for use on another TV in the home? These Apple TV count as one of the "peripheral" in the application itunes/environment?

    Can I buy a second Apple TV and use my existing account even information on it for use on another TV in the home? These Apple TV count as one of the "peripheral" in the application itunes/environment?

    Yes, you can. As far as I know, you are allowed 10 devices (including iPads, iPad and Apple TV), of which 5 can be computers.

  • Can I use a variable in step of TS Message for field 'waiting time '?

    Is it possible to use a variable (inhabitants, parameters, etc.) for the field "Wait time" in the stage of message TestStand?

    TestStand 4.1

    Thank you

    Rafi

    Go to the step settings > properties > Expressions > Expression Pre and enter something like:

    Step.TimeToWait = Locals.MyTimeToWait

  • How to use transfer windows for xp to xp. When I plug usb computers are delivered to the top with the same screen and when I try to use the transfer to the new computer, it just said information gathering and sits for hours

    How to use transfer windows for xp to xp.  When I plug usb computers are delivered to the top with the same screen and when I try to use the transfer to the new computer, it just said information gathering and sits for hours

    Hello, welcome.

    The process is automatic and the maximum transfer rate should be about 20 GB/HR. If the process crashes during that long of a time, it's probably because of something internal rather something you're doing wrong.
    For reference purposes, I included this link. It goes into the details of the migration from XP to Vista (and the basic steps you follow). The instructions are for migrating to Vista via the network, but you can easily follow the steps and choose a different option for your specific installation.
    For both machines, I recommend you to prepare for the transfer using the following procedure:
    1. click on START > run
    2 type "msconfig" (without the quotes) and press enter
    3. go to the "Startup" tab and uncheck all the entries displayed
    4. click on 'Apply' at the bottom right
    DO NOT RESTART YOUR COMPUTER AGAIN
    5. click on START > run
    6. Type "cmd" (without the quotes). Right-click on the result at the top of the menu START and select 'run as administrator '.
    7. type chkdsk /r and press enter
    8 allow the system to attempt disassembly of the volume
    9. allow the system to plan restarting
    10. restart your computer
    11 let checkdisk analyze the file system on your hard drive
    12. Once completed, perform the same steps on the other machine
    13. Once completed, repeat the transfer

    Let us know what happens
    Thank you!

    Ryan Thieman
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • You cannot connect because the logon method, you use is not allowed on this computer. Please, see your network administrator for more information.

    Whenever I enter my correct password in my windows account it rejects a message and it comes up saying: "you cannot connect because the logon method, you use is not allowed on this computer." See your network administrator for more information. "I can't seem to be able to enable or disable anything because the profile I'm using on my computer is the profile of"Guest ".

    Karima,

    Applicable to Windows 7.

    The following steps require administrator credentials.

    • Use the Windows + R or "Run" in the start menu, then type gpedit.msc.
    • Navigate to Computer Configuration > Windows settings > local policies > user rights assignment > consider all policies "prohibit the newspaper on" to check if your guest account is listed. Remove account from the list, and you should be fine to continue using your guest profile.

    Good luck.

    James

  • Using ODI SDK for more safety information

    Hi all

    Did someone already used ODI SDK to get information in the security module? I try to get the following information with the SDK:

    SELECT THE METH. I_METH,

    METH. I_CONTEXT,

    METH. I_OBJECTS,

    METH. I_INSTANCE

    OF SNP_USER_OBJ_METH METH;

    Also, do you have examples of how to set the security of an ODI (e.g. workload) object to a user using the SDK? Is this possible?

    Thank you.

    Little play of related security functionality is supported through SDK. Now sdk does not support the control of the access privileges for a user.

  • Use of variable in the For-Each statement

    Hello gurus.

    I'm having a problem using a variable, I created in a statement for each. Here is the code I am using
    My goal is to create a variable based on the type of Bill. If the invoice is a proof or a reprint, a copy should be printed. If it's a final bill, I need two copies.

    <? xdoxslt:set_variable($_XDOCTX,_'x',_0)? >
    for each<? If: Print_Additional_Header_Text_ID238 = "PROOF"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? If: Print_Additional_Header_Text_ID238 = "REPRINT"? > <? xdoxslt:set_variable($_XDOCTX,_'x',_1)? > <? end if? >
    <? : otherwise (Print_Additional_Header_Text_ID238)? > <? xdoxslt:set_variable($_XDOCTX,_'x',2)? > <? end if? >
    <? xdoxslt:get_variable($_XDOCTX,'x')? > <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    foreach is the loop that I use to repeat sections of the Bill.

    When I run with the last impression for each preview, I get an error that says "undefined variable: 'x'"»
    But when I remove the last for each good variable, 1 or 2, will show in the invoice.

    My question is: How can I use the variable 'x' in <? for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)? >

    TIA
    Darius

    Published by: 852460 on May 24, 2011 08:31

    Published by: DEK17 on July 20, 2011 13:15

    Probably, this will help you

    http://winrichman.blogspot.com/search/label/multiple%20copy

    Try

    
    or
    
    
  • Use of global variable from local variables for business rules

    Someone at - it guidelines on the use of overall compared to the local variables for the business rules? I really don't like the world no matter what, so if someone has a compelling reason to use overall.

    If I use a local variable in the world, is there a single character required for the local variable or no problem with the help of the same name local var in all of business rules.

    Thank you

    Hello

    I bet you have a background in programming. Don't let the 'global' nomenclature lure you into thinking that "bad design - not encapsulated, etc" with regard to business rules. According to John, this area, variable overall are a vehicle to reduce maintenance.

    For example if you have a variable in which all its used BR called CurrMonth and its always the current month, it create once, maintain his assignment in one place and use it anywhere. In this case 'global' is in fact less.

    Kind regards
    Robb Salzmann

  • How to set global variables for use by all THE #subform [0] items of form1. ?

    Hi all

    I don't know how to code javascript but am new to Adobe LiveCycle.  When I open the script editor, I have the following code (the code is in United Nations in bold):

    -form1. #subform [0]: initialize :-(FormCalc, client).

    //////////////////////////////
    TO START: SET GLOBAL PRICES.
    //////////////////////////////

    var Cityscope_Sydney_CostUser1 = 60,39;
    var Cityscope_Sydney_CostUsers2to5 = 3.02;
    var Cityscope_Sydney_CostUsers6to20 = 1.21;
    var Cityscope_Sydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_Sydney_CostHardCopyWithoutOnline = 54,67;
    var Cityscope_Sydney_CostHardCopyAdditional = 14.59;

    var Cityscope_NorthSydney_CostUser1 = 48,40;
    var Cityscope_NorthSydney_CostUsers2to5 = 2.42;
    var Cityscope_NorthSydney_CostUsers6to20 = 0.97;
    var Cityscope_NorthSydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_NorthSydney_CostHardCopyWithoutOnline = 43,54;
    var Cityscope_NorthSydney_CostHardCopyAdditional = 14.59;


    ////////////////////////////
    END: SET GLOBAL PRICES.
    ////////////////////////////

    -form1. #subform [0]: enter :-(FormCalc, client).

    -form1. #subform [0]: output :-(FormCalc, client).

    -form1. #subform [0]: calculate :-(FormCalc, client).

    -form1. #subform [0]: validate :-(FormCalc, client).

    -form1. #subform [0]: preSave - (FormCalc, client).

    < < = etc etc etc = > >

    -form1. #subform [0]. Item1Cost::initialize :-(JavaScript, client).

    -form1. #subform [0]. Item1Cost::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    Store the values of the form of friendly names.
    var AreaSelected = Item1Area.rawValue;
    var NumberOfUsersSelected = Item1Users.rawValue;

    Declare other variables.
    var Users1Calculation;
    var Users2to5Calculation;
    var Users6to20Calculation;


    Calculate the cost to the "components" user will depend on the number of users selected for the region.
    Switch (true)
    {
    If (NumberOfUsersSelected < 2):
    Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 0.00;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 1 & & NumberOfUsersSelected < 6):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 5):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
    break;
    by default:
    Alert ("BROKEN: calculate the individual components of cost of use will depend on the number of users selected for the region.");

    }

    apply the total cost for this article
    Item1Cost.RawValue = Users1Calculation + Users2to5Calculation + Users6to20Calculation;

    -form1. #subform [0]. Item1Cost::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::ready:layout - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::initialize :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::calculate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Users::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Users::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::ready:layout - (FormCalc, client)-

    .. and so on and so forth...

    In short, I want the code in:

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    .. .to be able to access the variables I created in:

    -form1. #subform [0]: initialize :-(FormCalc, client).


    (I guess that's where I store global variables)

    At this point, global variables are not accessible with the above configuration.  Was the only one I can get this working is to cut and paste the Globals in each item of form1. #subform [0], which of course defeats the purpose of global variables!  I intend to have a lot more items so wouldn't duplicate global variables for each of them!

    Can someone show me how to do this?

    Any help is very appreciated!

    Thank you

    Stanbridge

    Post edited by: stanbridgej - colors and fonts or not will not save.  Are bolded my question make (non-fat) code easier to read (I hope).

    I haven't used Formccalc, but I thought it would be the same regardless. Insert a script object to the top of the hierarchy and call it, for example "sco." Paste the Globals. Then refer to variables of the extent that sco. Cityscope_Sydney_CostUser1, etc. Make one

    App.Alert (sco. Cityscope_Sydney_CostUser1);

    one of the fields. If the debugger is activated, it will tell you if it cannot resolve the reference as "sco. In this case, you may need to use the som expression to reference the script object, for example

    var scoScript = xfa.resolveNode ("topOfHierarchy.sco");

    scoScript.Cityscope_Sydney_CostUser1

    But if as close as possible to the top of the hierarchy above should work.

Maybe you are looking for

  • How to stop FireFox 9 to move to a tab newly opened?

    As the title suggests, several times when I click on "Open in new tab", Firefox going to (or is), which is annoying as HELL! IE had this option and no way to turn it off for a while and has been one of my main reasons to switch to Firefox. Now, it se

  • excellent save as

    This is a 2 part question: 1. I have a VI that writes data to excel, but I want to touch my original file and save it under a different name, I get an error 2. for the new name, I want to add a timestamp but cannot find how to get the current time PC

  • SL500 series and battery

    Hi all, I just checked on the upgrades and accessories page on the Lenovo site and they list all the SL500 laptop battery accessories. I see batteries are provided for all other models, but why not this one? Thank you

  • Loading Vista error Code 19 window using the VxD loader?

    Hello!!recently, I noticed an error in my Device Manager after strange Beaver on my computer, it will start the slow race, and now it freezes up while my son is using it to play games on line.used of administrative tools to find out that a USB Loader

  • Automatic update KB976098

    Maintains the failure to comply with this update. What can I do to stop switching?