Reload a method during a variable change

I want to run a method when a variable changes.. Some sort of
listener on the variable.. Something like that.. Is it possible?
Any ideas?

One way to do this is to use a setter function. to the
outside, it looks just like a variable, but is really a function in
which you can do whatever you want. It has a special format:
[Bindable]private var _sMyString:String;
public function set myString(sValue:String):void {
_sMyString = sValue; //normal variable stuff
//now do whatever special processing you need to do.
Use this property like this
myString = "someValue";
or:
this.myString = "someValue";
or
myClass.myString = "someValue";
You can also look into changeWatcher()
Tracy

Similar Messages

  • TaxonomyWebTaggingControl - how to fire a jquery method during selected index changed event.

    I have a taxonomyWebTaggingControl of Sharepoint 2013. I want to populate other controls on the page on change event of taxonomy Control.
    Is there a way to do this with this control. 
    I have seen from view source that the control is a span with an hidden field, but when I have tried to attach a change event to that hidden field using jquery then could not do the same.
    Can idea would be highly appreciated?
    Thanks & Regards, Soumyadev | Posting is provided "AS IS" with no warranties, and confers no rights.

    Your problem is that you are using the textboxes to perform two separate functions, displaying the current selection and editing. This sort of approach is asking for just the kind of trouble that you are experiencing. Experience tells me that if you persevere
    for long enough, you will eventually get it to work, but the result will be a confusing tangle of setting and unsetting flags based on whether the textboxes have gained or lost the focus (and hence the text change is due to the user typing in the box or not),
    and you won't have any way for the user to cancel their changes if they make a mistake.
    I suggest adding an Edit button which explicitly sets the textboxes into edit mode, and Apply and Cancel buttons to confirm or discard the changes. Or possibly even better, write a new form just for editing that is invoked when the Edit button is pressed.

  • Validations during PO Creation/Change

    Hi I want to do three validations during PO Creation/Change
    1) After entering each item Quantity,a custom validation should be done
    2) When Save Button is pressed in PO, custom values should get updated in custom table.
    3) During save a validation is required.
    So can anyone let me know,how this can be dealt with like with which user-exits / badi.
    Kind Regards
    Sajid

    Hello Sajid,
    Your requirements can be achieved by the BADI ME_PURCHDOC_POSTED as this BADI is called after user presses the save button.
    Now if you want to check quantity after the quantity is entered and before the save button is pressed then you can use BADI ME_PO_PRICING use method PROCESS_KOMP and parameter IM_EKPO.
    Hope this is helpful to you.
    Regards
    Arindam

  • Non-static variable change cannot be referenced from a static context

    My compiler says: : non-static variable change cannot be referenced from a static context
    when i try to compile this. Why is it happening?
    public class change{
      int coin[] = {1,5,10,25,50};
      int change=0;
      public static void main(){
        int val = Integer.parseInt(JOptionPane.showInputDialog(null, "Type the amount: ", "Change", JOptionPane.QUESTION_MESSAGE));
        change = backtrack();
    }

    A static field or method is not associated with any instance of the class; rather it's associated with the class itself.
    When you declared the field to be non-static (by not including the "static" keyword; non-static methods and fields are much more common so it's the default), that meant that the field was a property of an object. But the static main method, being static, didn't have an object associated with it. So there was no "change" property to refer to.
    An alternative way to get this work, would be to make your main method instantiate an object of the class "change", and put the functionality in other instance methods.
    By the way, class names are supposed to start with upper-case letters. That's the convention.

  • Watch object variable change in parent

    Flash CS4
    AS2
    I've been trying to use the object.watch() method.  I've never used this before, so I'm assuming I'm pretty far off base here.
    What I have is a parent movie (_root.) that has a bunch of variables.  As the user progresses through the movie/project the variables change based on the user's actions.  Within this parent movie there is another movie embedded.  In this movie, things change based on the variable changes of the parent movie.  So, for instance, say the user gets through frame #20 and hits the "next" button in the parent movie, this triggers a variable change in the parent movie, which then causes the embedded movie to change its color from blue to red (or whatever, action doesn't matter)
    var btn1:Object = new Object();
    btn1.complete = _root.btn1_comp;
    btn1.watch( "complete", watcher);
    var btn2:Object = new Object();
    btn2.complete = _root.btn2_comp;
    btn2.watch( "complete", watcher);
    function watcher( prop, oldValue, newValue, userData )
      gotoAndPlay(1);
    So this is what I'm doing right now - this is the actions in the embedded "child" movie clip.  I'm not really sure if I'm doing this right - but basically what happens is that this is suppose to watch for the variables "btn1_comp" and "btn2_comp" in the parent movie clip (at the _root.).
    Taken from an example I saw somewhere, this should assign the variable in the root to the property of the object in the child "btn1.complete" and "btn2.complete"  - but basically what I really need, is for it to watch if "_root.btn1_comp" and "_root.btn2_comp" change...
    Anyone have any ideas on how I go about doing this from here??
    The function "watcher" - is supposed to just replay the embedded movie clip - because it has a bunch of AS that changes the state of the movie clip based on the variables it pulls from the parent - but I need it to know to "replay" itself when a parent variable changes - I can't have it continuing to replay itself because that would end in a crazy endless loop.
    Thanks for the help!
    -R.J.

    Any chance anyone can offer some insight for me on which way I need to go with this?

  • Inner class inside a method - how does it access method's local variable?

    hello All:
    I've learnt that, an inner class, if defined inside a method, it can access the method's local variables, only when they are defined as "final".
    Anyone can help explain the rationale behind it?
    Thanks a lot!
    Sway

    fathomBoat wrote:
    In java, everything is about pass-by-reference.
    Wrong! Nothing in Java is ever pass-by-reference.
    Java uses pass-by-value everywhere.
    It makes sense to me if the reason of enforcing a variable to be "final" is to prevent it being messed up.No, the reason is that a copy is made and if the variable weren't final then it could change later on and the developer could be confused because his inner class didn't "see" that change.
    The variable being final prevents that scenario.
    However, if a copy of the variable is made inside the inner class, i dont see how possible it could affect variables outside of class?Such a copy is made, but the language designers wanted to hide that fact from the developer. By forcing all accessed variables to be declared final the developer has no way to realize that he's actually working on a copy.

  • EventListener on variable change?

    Wondering if it's possible and how would you go about doing it..
    Upon a public variable changing in a component, it executes code.
    [Bindable] is fine if I want to display the change as is.  I actually want to execute everytime the variable changes.
    I tried, addEventListener but that doesn't seem to work...is this even possible.

    There are a few main ways you could do this. Let's assume the variable is named chess and is of the datatype Game
    1. ChangeWatcher ... moving on
    2. Or you could write your code like this.
       private var _chess:Game;
       public function set chess( value:Game ):void
            _chess = value;
           dispatchEvent( new Event("gameChanger") );
       [Bindable(Event="gameChanger")]
       public function get chess():Game
          return _chess;
       This method allows you to add an eventlistener that listens for the event "gameChanger".    Now if you want the chess game change event to bubble you may have to use a custom event.  An added advantage to this , is you can run any code you need to when the chess game changes in the set chess method.

  • Check all items during PO Create / Change

    Dear Gurus,
    During PO Create/ Change, I need to check all the items and display an error message if qty exceeds.So can anyone please let me know which user exit / badi /at which enhancement point i  have write the code.
    Kind Regards
    Sajid

    Hello,
    Use this BADI ME_PROCESS_REQ_CUST
    in Method check u should write the code.
    Some sample code
    METHOD if_ex_me_process_req_cust~process_header .
    CLEAR head.
    CALL METHOD im_header->get_data
        RECEIVING
          re_data = head.
    ENDMETHOD.
    at implementation class go to attributes
    ZCL_IM_ME_PROCESS_REQ_CUST
    HEAD                StaticPubl        Type    MEREQ_HEADER         OO Purchase Requisit     
    METHOD if_ex_me_process_req_cust~check .
    DATA : t_item      TYPE mmpur_requisition_items,
           w_item      TYPE mmpur_requisition_item,
           ref_account TYPE REF TO if_acct_container_mm,
           t_acc_objs  TYPE mmpur_accounting_list,
           w_acc_obj   TYPE mmpur_accounting_type,
           ref_model   TYPE REF TO if_accounting_model_mm,
           w_exkn      TYPE exkn,
           t_exkn      TYPE STANDARD TABLE OF exkn,
           ref         TYPE REF TO if_purchase_requisition_item,
           i_act_items TYPE mereq_item,
           t_itemdata  TYPE STANDARD TABLE OF mereq_item,
           w_itemdata  TYPE mereq_item,
           ref_acc     TYPE REF TO if_accounting_model_mm.
    TYPES : BEGIN OF ty_exkn,
             bnfpo   TYPE bnfpo,
             zexkn   TYPE dzekkn,
             loekz   TYPE kloek,
             kostl   TYPE kostl,
             prctr   TYPE prctr,
            END OF ty_exkn.
    DATA : t_exkn_ext TYPE STANDARD TABLE OF ty_exkn,
           t_exkn_one TYPE STANDARD TABLE OF ty_exkn,
           w_exkn_ext TYPE ty_exkn,
           w_exkn_one TYPE ty_exkn.
    TYPES : BEGIN OF ty_eban,
              banfn TYPE banfn,
              bnfpo TYPE bnfpo,
              werks TYPE werks,
              ekorg TYPE ekorg,
              knttp TYPE knttp,
            END OF ty_eban.
    DATA : t_eban  TYPE STANDARD TABLE OF ty_eban,
            w_eban1 TYPE ty_eban.
    TYPES : BEGIN OF ty_account,
              banfn TYPE banfn,
              bnfpo TYPE bnfpo,
              zebkn TYPE dzebkn,
              kostl TYPE kostl,   "Cost Center
              prctr TYPE prctr,   "Profit Center
            END OF ty_account.
    DATA : t_account  TYPE STANDARD TABLE OF ty_account,
           t_account1 TYPE STANDARD TABLE OF ty_account,
           wa_account TYPE ty_account.
    TYPES: BEGIN OF obj_line,
             clustername(30),
             programname(10),
           END OF obj_line.
    DATA : obj_tab    TYPE STANDARD TABLE OF obj_line,
           obj_wa     TYPE obj_line.
    DATA : t_ebkn     TYPE STANDARD TABLE OF ty_account,
           w_ebkn1    TYPE ty_account,
           w_ebkn_old TYPE ty_account,
           v_item_no  TYPE bnfpo,
           v_werks    TYPE eban-werks,
           v_ekorg    TYPE eban-ekorg,
           v_knttp    TYPE eban-knttp,
           v_banfn    TYPE eban-banfn.
    CONSTANTS : c_k TYPE c VALUE 'K',
                c_a TYPE c VALUE 'A',
                c_y TYPE c VALUE 'Y'.
    CLEAR : v_item_no,
            w_ebkn1,
            w_ebkn_old.
    Message include
    INCLUDE mm_messages_mac. "useful macros for message handling
    *Retreving Item details
    CALL METHOD im_header->get_items
      RECEIVING
        re_items = t_item.
    LOOP AT t_item INTO w_item.
      ref = w_item-item.
      CALL METHOD ref->get_data
        RECEIVING
          re_data = i_act_items.
      APPEND i_act_items TO t_itemdata.
    Retreving Account details
      ref_account = ref.
      CALL METHOD ref_account->get_items
        RECEIVING
          re_items = t_acc_objs.
      LOOP AT t_acc_objs INTO w_acc_obj.
        ref_model = w_acc_obj-model.
        CALL METHOD ref_model->get_exkn
          RECEIVING
            re_exkn = w_exkn.
        APPEND w_exkn TO t_exkn.
        MOVE-CORRESPONDING : w_exkn TO w_exkn_ext.
        w_exkn_ext-bnfpo = i_act_items-bnfpo.
        APPEND w_exkn_ext TO t_exkn_ext.
      ENDLOOP.
    ENDLOOP.
    *Deleting the line items which are marked with deletion indicator
    DELETE t_itemdata WHERE loekz NE space.
    SORT t_itemdata BY bnfpo.
    READ TABLE t_itemdata INTO w_itemdata INDEX 1.
    *get first line item no.
    v_item_no = w_itemdata-bnfpo.
    IF w_itemdata-knttp = c_k OR
       w_itemdata-knttp = c_a OR
       w_itemdata-knttp = c_y.
    *Logic to handel while purchase requisitions creation
    LOOP AT t_itemdata INTO w_itemdata.
    *Capturing the first Line item while creating Purchase requisition.
    IF sy-tabix = 1.
      v_item_no = w_itemdata-bnfpo.
    *Plant
    v_werks = w_itemdata-werks.
    *Purchasing Organization
    v_ekorg = w_itemdata-ekorg.
    *Account Assaign Cat.
    v_knttp = w_itemdata-knttp.
    If other than first Line item
    ELSE.
    *Plant
    IF w_itemdata-werks NE v_werks.
    mmpur_message 'E' 'ZMMENHANCEMENT' '006' ' '  ' ' ' ' ' '.
    ENDIF.
    *Purchasing Organization
    IF w_itemdata-ekorg NE v_ekorg.
    mmpur_message 'E' 'ZMMENHANCEMENT' '007' ' '  ' ' ' ' ' '.
    ENDIF.
    *Account Assaignment Cat.
    IF w_itemdata-knttp NE v_knttp.
    mmpur_message 'E' 'ZMMENHANCEMENT' '008' ' '  ' ' ' ' ' '.
    ENDIF.
    ENDIF.
    ENDLOOP.
    *Account assaign. deatils
    LOOP AT t_exkn_ext INTO w_exkn_ext.
    IF w_exkn_ext-bnfpo = v_item_no AND w_exkn_ext-zexkn = '01'.
    *APPEND w_exkn_ext TO t_exkn_one.
    w_exkn_one = w_exkn_ext.
    ELSE.
    IF w_exkn_ext-kostl NE w_exkn_one-kostl.
    mmpur_message 'E' 'ZMMENHANCEMENT' '009' w_exkn_ext-bnfpo ' ' ' ' ' '
    ENDIF.
    *Profit Center
    IF w_exkn_ext-prctr NE w_exkn_one-prctr.
       mmpur_message 'E' 'ZMMENHANCEMENT' '010' ' '  ' ' ' ' ' '.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDIF. "if w_itemdata-KNTTP = 'K' OR 'A' OR 'Y'.
    ENDMETHOD.

  • TS3694 My Ipod is not recognized by Itunes with my Windows 8 PC. Works fine with Windows 7 PC. Device sync test says "No device found". Already performed all of the Ipod device troubleshooting including reload Itunes, stop start Ipod device, changed drive

    Need help? Some of my Ipods are not recognized by Itunes with my Windows 8 PC. (Ipod Nano 4th gen  and Ipod Nano 6th gen), but on my Windows 7 PC, they work fine.  My Ipod 3rd gen and Ipod shuffle work both on Windows 8 and 7 PC's.  On the non-working Ipods, the  Device sync test says "No device found". Already performed all of the Ipod device troubleshooting including reload Itunes, stop start Ipod device, changed drive letter...
    any help is appreciated. Chris4sail

    Hello there, chris4sail.
    The following Knowledge Base article offers up some great step-by-step instructions on troubleshooting your iPod not being recognized in iTunes:
    iPod not recognized in My Computer and in iTunes for Windows
    http://support.apple.com/kb/ts1369
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Can't download anything from app store or itunes. everytime i try to install an app i get "there is abilling problem with a previous purchase. please update ur payment method". i have recently changed my address and visa debit card. please help

    can't download anything from app store or itunes. everytime i try to install an app i get this error "there is a billing problem with a previous purchase. please update ur payment method". i have recently changed my visa debit card and home adress and when i make these changes i still get the same error.
    will u please help me out?

    Are you listing the billing address for the card correctly? The address in the iTunes/MAS account must match the address on your bill exactly.

  • Capture re pricing during order creation/change

    Hi,
    I have to differentiate between standard pricing and re-pricing ( when user has pressed update button on the conditions tab ) in a sales order.
    How and where can i get this information during order creation / change.
    Thanks for your replies.
    Abhishek

    hi,
    KALSM is the pricing procedure and it will be same for the document during creation and re-pricing, how dose it help in determining if user pressed update button.
    Thanks,
    Abhishek

  • Running Mavericks OS on MacBookPro...had some hard crashes past 24 hours...now can't print in Office or Firefox.  Both crash during print dialog - changing printer.  Printed fine before.   Ideas?

    Running Mavericks OS on MacBookPro...had some hard crashes past 24 hours...forced reboots....now can't print anything from Office or Firefox.  Both crash during print dialog - changing printer causes instand crash.  My system printed fine before the crashes yesterday.  I can print from the Stickies app and safari printed fine.  I did a full Shutdown/restart and that didn't work.  Ideas on how to get PPT files to print again or print from firefox??

    Error log from PPT:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2014-03-25 22:12:04 +0000
    Application Name: Microsoft PowerPoint
    Application Bundle ID: com.microsoft.Powerpoint
    Application Signature: PPT3
    Application Version: 14.3.9.131030
    Crashed Module Name: CoreFoundation
    Crashed Module Version: 855.14
    Crashed Module Offset: 0x00012192
    Blame Module Name: Microsoft PowerPoint
    Blame Module Version: 14.3.9.131030
    Blame Module Offset: 0x002a285e
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 0

  • Error during manuel entry/Change of condition.

    Dear friends,
    while I am trying to create standard customer order(VA01), I have faced an error message as: Item 00001:Error during manuel entry/Change of condition.
    Can anyone tell me solution?
    Thanks in advance.

    Hi,
    Goto to V/08 for your pricing procedure, check for the condition type if it is mandatory condition and / or if it is manual condition.
    In V/06, select condition type and check the value for Manual entry field
    Hope you get some inputs
    regards,
    Sagar

  • Any method not allow to change PO price after do the GR

    hi,
    Any method not allow to change PO price after GR had done. Thanks

    Hi jo jo,
    To disallow any price changes, set the Tolerance Key limits for Price Variance (PE-Price Var in Purchasing) for PO in IMG to Zero. This will compare the new price (Effective Price w/ Cash Disc) to the material price in the Material Master. Also set the msg no. 207 (in App Area 06) as a "E"-error message. This will stop end users from making changes.
    If the Tolerance limits are set to zero and the message 207 is set as E, it should work.
    Let me know if this was helpful.

  • AS3 in timeline - variable changes value on its own

    I've just started working with Flash CS4 and Actionscript 3 after being away from Flash for almost 10 years.
    I've set up a menu that allows users to select from five sections. When users select an option, flow goes to the corresponding section of the timeline and a movieclip plays. Stop actions prevent flow from continuing past the current section. A home button takes users back to the menu in the first frame. This works just fine.
    The client wants to provide a 'next' button which should play through all sections in sequence when the learner clicks it. I've defined a variable which I set to true when the user clicks 'next'. I've added if...else logic to the stop actions:
      trace("nextClicked "+nextClicked);
      if (nextClicked == true)
          play();
      else
          stop();
    This should stop flow unless the play button has been pressed setting the variable nextClicked to true. That's not what happens - flow stops even if when I click the 'next' button. I added the trace to verify the variable has the correct value and discovered that the variable value resets to false from true before it gets to this script.
    What am I missing about ActionScript 3 that might account for this behaviour? I have tried to read the Actionscript 3 materials but I get bogged down in the complexity of the programming requirements and the lack of depth in the examples provided. I'm sure the examples are perfectly adequate if you're trying to do what they illustrate but I haven't found an example that fits what I'm trying to do here.
    Thanks.

    Thank you for your suggestion:
    I have declared the variable at the beginning. This is a sample of the code in the first frame:
    //define variable
    var nextClicked:Boolean;
    //define event listeners and the corresponding functions for menu buttons
    //Me
    btn_me.addEventListener(MouseEvent.CLICK, gotome);
    function gotome(event:MouseEvent):void {
        //set var to false to indicate Next has not been clicked
        var nextClicked = false;
        trace("Me selected "+nextClicked);
        gotoAndPlay("me");
    [.....more code defining more listeners...]
    //define listener for Next button
    btn_next.addEventListener(MouseEvent.CLICK,gonext);
    function gonext(event:MouseEvent):void {
        //set var to true to indicate Next has been clicked
        var nextClicked=true;
        trace("Clicked next "+nextClicked);
        play();
    This seems very similar to what you suggested except you also included this line:
    Button1.label = "show Var";
    and I'm not sure what that line does. Does it set a label for the button? Since I've already set these explicitly, I don't see that this would be necessary. More importantly, I don't understand why leaving this out would cause the problem I'm having - the value of the variable changes from true to false without any code being executed.
    I'm still in the dark - and I still need to solve this.
    Thanks.

Maybe you are looking for

  • Tpurcode in Tuxedo 11g

    We have recently upgraded Tuxedo from 8.0 to 11g and SALT from 1.0 to 11g. Using tpreturn with TPFAIL and a non-zero tpurcode used to return the following message to the client - "GWWS_CAT:1033: Internal Error. Fail to call Tuxedo Service 'XXXX'. Tux

  • Customer Address Data

    Hello I am trying to extract customers from ECC to MDM using XI I am sending the DEBMDM idoc but it doesn't contain the adress data E1KNB1M doesnt have the STRAS field when I check on SE16 the KNA1 table I see the adresses of all the customers any id

  • Including Contact person detials in MDG 6.1 - Customer

    Hello All, While Creating MDG - Customer, I need to include Contact person information.  I can see Contact Person tab in Customer FPM screen(Organisation type) but not able to relate to Business Partner ID. My specific questions are 1. How to create

  • There must be some way to load Firmware 1.62.02 into My Vision M?

    O/S Vista- Home 32 bit's Zen Vision M I have sucessfully downloaded Firmware .62.02. There must be some way to get this into the Zen Vision M...

  • Cannot collapse layer groups in Photoshop CC 2014.

    Any solutions out there? Used to be able to just click the arrow next to the folder.  That does not seem to work anymore.